ABAP Select data from SAP table ANLAV into internal table



Get Example source ABAP code based on a different SAP table
  

Below is a number of ABAP code snippets to demonstrate how to select data from SAP ANLAV table and store it within an internal table, including using the newer @DATA inline declaration methods. It also shows you various ways to process this data using ABAP work area, inline declaration or field symbols including executing all the relevant CONVERSION_EXIT routines specific to ANLAV. See here for more generic Select statement tips.

Sometimes data within SAP is stored within the database table in a different format to what it is displayed to the user. These input/output conversation FM routines are what translates the data between the two formats.

There is also a full declaration of the ANLAV table where each field has a char/string type for you to simply copy and paste. This allows you to use processing that is only available to these field types such as the CONCATENATE statement.

DATA: IT_ANLAV TYPE STANDARD TABLE OF ANLAV,
      WA_ANLAV TYPE ANLAV,
      GD_STR TYPE STRING.

DATA: lo_typedescr type REF TO cl_abap_typedescr.
DATA: lv_fieldname type fieldname.

FIELD-SYMBOLS: <FIELD> TYPE any.
FIELD-SYMBOLS: <ANLAV> TYPE ANLAV.

*Process all fields in table header/work area as string values
  PERFORM process_as_string_field_values CHANGING wa_ANLAV.

SELECT *
*restrict ABAP select to first 10 rows
 UP TO 10 ROWS      
  FROM ANLAV
  INTO TABLE IT_ANLAV.

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM ANLAV
*  INTO TABLE @DATA(IT_ANLAV2).
*--Further methods of using ABAP code to  select data from SAP database tables

*You can also declare the header/work area using the in-line DATA declaration method
READ TABLE IT_ANLAV INDEX 1 INTO DATA(WA_ANLAV2).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_ANLAV ASSIGNING <ANLAV>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<ANLAV>-MANDT = 1.
<ANLAV>-BUKRS = 1.
<ANLAV>-ANLN1 = 1.
<ANLAV>-ANLN2 = 1.
<ANLAV>-ANLKL = 1.
ENDLOOP.

LOOP AT IT_ANLAV INTO WA_ANLAV.
*Write horizonal line to screen report.
  WRITE:/ sy-uline.

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_ANLAV-GEGST, sy-vline,
WA_ANLAV-ANEQK, sy-vline,
WA_ANLAV-ANEQS, sy-vline,
WA_ANLAV-ERNAM, sy-vline,
WA_ANLAV-ERDAT, sy-vline,
WA_ANLAV-AENAM, sy-vline.
ENDLOOP. *Add any further fields from structure WA_ANLAV you want to display... WRITE:/ sy-uline. * Aternatively use generic code to Write field values (and NAME) to screen report DO. ASSIGN COMPONENT sy-index OF STRUCTURE wa_ANLAV TO <field>. IF sy-subrc <> 0. EXIT. ENDIF. WRITE:/ 'Field Value', <field>, sy-vline. gd_str = <field> . lo_typedescr ?= CL_ABAP_DATADESCR=>DESCRIBE_BY_DATA( <field> ). lv_fieldname = lo_typedescr->GET_RELATIVE_NAME( ). WRITE:/ 'Field Name', lv_fieldname. ENDDO. *Redo loop but convert all fields from internal to out value LOOP AT IT_ANLAV INTO WA_ANLAV. *Write horizonal line to screen report. WRITE:/ sy-uline. *Convert all fields to display/output versions using conversion routines PERFORM convert_all_field_values CHANGING wa_EKKO. ENDLOOP. *&---------------------------------------------------------------------* *& Form convert_all_field_values *&---------------------------------------------------------------------* FORM convert_all_field_values CHANGING p_EKKO LIKE wa_EKKO. DATA: ld_input(1000) TYPE c, ld_output(1000) TYPE C.

*Conversion exit ALPHA, internal->external for field ANLN1 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-ANLN1 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-ANLN1.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field ANLN2 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-ANLN2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-ANLN2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field ANLKL CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-ANLKL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-ANLKL.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field GEGST CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-GEGST IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-GEGST.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field KTOGR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-KTOGR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-KTOGR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field LIFNR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-LIFNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-LIFNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field AIBN1 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-AIBN1 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-AIBN1.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field AIBN2 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-AIBN2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-AIBN2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit GJAHR, internal->external for field URJHR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_ANLAV-URJHR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-URJHR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field EAUFN CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-EAUFN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-EAUFN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit CUNIT, internal->external for field MEINS CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_ANLAV-MEINS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-MEINS.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field VMGLI CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-VMGLI IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-VMGLI.
WRITE:/ 'New Value:', ld_input.

*Conversion exit CUNIT, internal->external for field FEINS CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_ANLAV-FEINS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-FEINS.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field VBUND CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-VBUND IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-VBUND.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field LEAFI CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-LEAFI IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-LEAFI.
WRITE:/ 'New Value:', ld_input.

*Conversion exit KONPD, internal->external for field PSPHI CALL FUNCTION 'CONVERSION_EXIT_KONPD_OUTPUT' EXPORTING input = WA_ANLAV-PSPHI IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PSPHI.
WRITE:/ 'New Value:', ld_input.

*Conversion exit POSNR, internal->external for field PRPOS CALL FUNCTION 'CONVERSION_EXIT_POSNR_OUTPUT' EXPORTING input = WA_ANLAV-PRPOS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PRPOS.
WRITE:/ 'New Value:', ld_input.

*Conversion exit GJAHR, internal->external for field PRGJR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_ANLAV-PRGJR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PRGJR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit REQNR, internal->external for field IMAPO CALL FUNCTION 'CONVERSION_EXIT_REQNR_OUTPUT' EXPORTING input = WA_ANLAV-IMAPO IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-IMAPO.
WRITE:/ 'New Value:', ld_input.

*Conversion exit REQID, internal->external for field IMAPE CALL FUNCTION 'CONVERSION_EXIT_REQID_OUTPUT' EXPORTING input = WA_ANLAV-IMAPE IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-IMAPE.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field IMAVA CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-IMAVA IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-IMAVA.
WRITE:/ 'New Value:', ld_input.

*Conversion exit GJAHR, internal->external for field IMAGN CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_ANLAV-IMAGN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-IMAGN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ABPSN, internal->external for field POSNR CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT' EXPORTING input = WA_ANLAV-POSNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-POSNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ABPSN, internal->external for field PSPID CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT' EXPORTING input = WA_ANLAV-PSPID IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PSPID.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field SERNR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-SERNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-SERNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field KOSTL CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-KOSTL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-KOSTL.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field CAUFN CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-CAUFN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-CAUFN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field IAUFN CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-IAUFN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-IAUFN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit TPLNR, internal->external for field TPLNR CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT' EXPORTING input = WA_ANLAV-TPLNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-TPLNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ABPSP, internal->external for field IPSNR CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT' EXPORTING input = WA_ANLAV-IPSNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-IPSNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field KTANSW CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-KTANSW IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-KTANSW.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field ANLN0 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-ANLN0 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-ANLN0.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field KOSTLV CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-KOSTLV IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-KOSTLV.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field ADDRNUM CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-ADDRNUM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-ADDRNUM.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field KTAUFW CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-KTAUFW IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-KTAUFW.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ABPSN, internal->external for field POSNR2 CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT' EXPORTING input = WA_ANLAV-POSNR2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-POSNR2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ABPSN, internal->external for field PSPID2 CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT' EXPORTING input = WA_ANLAV-PSPID2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PSPID2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field GRANT_NBR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-GRANT_NBR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-GRANT_NBR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field GRANT_NBR2 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-GRANT_NBR2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-GRANT_NBR2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ABPSP, internal->external for field PS_PSP_PNR2 CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT' EXPORTING input = WA_ANLAV-PS_PSP_PNR2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PS_PSP_PNR2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field SEGMENT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-SEGMENT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-SEGMENT.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field PRCTR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-PRCTR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-PRCTR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit CUNIT, internal->external for field GLO_RUS_TXB_TYPE CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_ANLAV-GLO_RUS_TXB_TYPE IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-GLO_RUS_TXB_TYPE.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field VNAME CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-VNAME IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-VNAME.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field EGRUP CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-EGRUP IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-EGRUP.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field RECID CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-RECID IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-RECID.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field ETYPE CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_ANLAV-ETYPE IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_ANLAV-ETYPE.
WRITE:/ 'New Value:', ld_input.
ENDFORM. *&---------------------------------------------------------------------* *& Form process_as_string_field_values *&---------------------------------------------------------------------* FORM process_as_string_field_values CHANGING p_EKKO LIKE wa_EKKO. TYPES: BEGIN OF T_ANLAV_STR,
MANDT TYPE STRING,
BUKRS TYPE STRING,
ANLN1 TYPE STRING,
ANLN2 TYPE STRING,
ANLKL TYPE STRING,
GEGST TYPE STRING,
ANEQK TYPE STRING,
ANEQS TYPE STRING,
ERNAM TYPE STRING,
ERDAT TYPE STRING,
AENAM TYPE STRING,
AEDAT TYPE STRING,
XLOEV TYPE STRING,
XSPEB TYPE STRING,
FELEI TYPE STRING,
KTOGR TYPE STRING,
XOPVW TYPE STRING,
ANLTP TYPE STRING,
AKTIV TYPE STRING,
ABGDT TYPE STRING,
DEAKT TYPE STRING,
GPLAB TYPE STRING,
BSTDT TYPE STRING,
ORD41 TYPE STRING,
ORD42 TYPE STRING,
ORD43 TYPE STRING,
ORD44 TYPE STRING,
ANLUE TYPE STRING,
LIFNR TYPE STRING,
LAND1 TYPE STRING,
LIEFE TYPE STRING,
HERST TYPE STRING,
EIGKZ TYPE STRING,
AIBN1 TYPE STRING,
AIBN2 TYPE STRING,
AIBDT TYPE STRING,
URJHR TYPE STRING,
URWRT TYPE STRING,
ANTEI TYPE STRING,
PROJN TYPE STRING,
EAUFN TYPE STRING,
MEINS TYPE STRING,
MENGE TYPE STRING,
TYPBZ TYPE STRING,
IZWEK TYPE STRING,
INKEN TYPE STRING,
IVDAT TYPE STRING,
INVZU TYPE STRING,
VMGLI TYPE STRING,
XVRMW TYPE STRING,
WRTMA TYPE STRING,
EHWRT TYPE STRING,
AUFLA TYPE STRING,
EHWZU TYPE STRING,
EHWNR TYPE STRING,
GRUVO TYPE STRING,
GREIN TYPE STRING,
GRBND TYPE STRING,
GRBLT TYPE STRING,
GRLFD TYPE STRING,
FLURK TYPE STRING,
FLURN TYPE STRING,
FIAMT TYPE STRING,
STADT TYPE STRING,
GRUND TYPE STRING,
FEINS TYPE STRING,
GRUFL TYPE STRING,
INVNR TYPE STRING,
VBUND TYPE STRING,
TXT50 TYPE STRING,
TXA50 TYPE STRING,
XLTXID TYPE STRING,
XVERID TYPE STRING,
XTCHID TYPE STRING,
XKALID TYPE STRING,
XHERID TYPE STRING,
XLEAID TYPE STRING,
LEAFI TYPE STRING,
LVDAT TYPE STRING,
LKDAT TYPE STRING,
LEABG TYPE STRING,
LEJAR TYPE STRING,
LEPER TYPE STRING,
LRYTH TYPE STRING,
LEGEB TYPE STRING,
LBASW TYPE STRING,
LKAUF TYPE STRING,
LZINS TYPE STRING,
LTZBW TYPE STRING,
LKUZA TYPE STRING,
LKUZI TYPE STRING,
LLAVB TYPE STRING,
LEANZ TYPE STRING,
LVTNR TYPE STRING,
LETXT TYPE STRING,
AIMMO TYPE STRING,
OBJNR TYPE STRING,
OBART TYPE STRING,
PSPHI TYPE STRING,
PRNAM TYPE STRING,
PRPOS TYPE STRING,
PRGJR TYPE STRING,
IMAPO TYPE STRING,
IMAPE TYPE STRING,
IMAVA TYPE STRING,
IMAGN TYPE STRING,
LFDNR TYPE STRING,
LFDHI TYPE STRING,
LEART TYPE STRING,
LVORS TYPE STRING,
GDLGRP TYPE STRING,
POSNR TYPE STRING,
PSPID TYPE STRING,
XERWRT TYPE STRING,
XAFABCH TYPE STRING,
XANLGR TYPE STRING,
XINVM TYPE STRING,
SERNR TYPE STRING,
UMWKZ TYPE STRING,
LRVDAT TYPE STRING,
BDATU TYPE STRING,
ADATU TYPE STRING,
KOSTL TYPE STRING,
WERKS TYPE STRING,
GSBER TYPE STRING,
LSTAR TYPE STRING,
MSFAK TYPE STRING,
XSTIL TYPE STRING,
STORT TYPE STRING,
CAUFN TYPE STRING,
RAUMN TYPE STRING,
IAUFN TYPE STRING,
IPROJ TYPE STRING,
TPLNR TYPE STRING,
TXJCD TYPE STRING,
IPSNR TYPE STRING,
KTANSW TYPE STRING,
ERGSO TYPE STRING,
ERGHB TYPE STRING,
KHINR TYPE STRING,
ANLN0 TYPE STRING,
WRTTP TYPE STRING,
KFZKZ TYPE STRING,
PERNR TYPE STRING,
KOSTLV TYPE STRING,
ANLHTXT TYPE STRING,
ADDRNUM TYPE STRING,
KTSAKAN TYPE STRING,
KTAUFW TYPE STRING,
KTAUFAN TYPE STRING,
POSNR2 TYPE STRING,
PSPID2 TYPE STRING,
HAS_TDDP TYPE STRING,
LAST_REORG_DATE TYPE STRING,
FISTL TYPE STRING,
GEBER TYPE STRING,
FKBER TYPE STRING,
GRANT_NBR TYPE STRING,
GEBER2 TYPE STRING,
FKBER2 TYPE STRING,
GRANT_NBR2 TYPE STRING,
FISTL2 TYPE STRING,
IMKEY TYPE STRING,
PS_PSP_PNR2 TYPE STRING,
BUDGET_PD TYPE STRING,
BUDGET_PD2 TYPE STRING,
SEGMENT TYPE STRING,
PRCTR TYPE STRING,
GLO_RUS_DEPGR TYPE STRING,
GLO_RUS_OKOF TYPE STRING,
GLO_RUS_SERNR TYPE STRING,
GLO_RUS_PRECCT TYPE STRING,
GLO_RUS_PRECQ TYPE STRING,
GLO_RUS_PRECW TYPE STRING,
GLO_RUS_TTX_TYPE TYPE STRING,
GLO_RUS_TTX_VIN TYPE STRING,
GLO_RUS_TTX_MNFD TYPE STRING,
GLO_RUS_TTX_ECOCLASS TYPE STRING,
GLO_RUS_ECOCLASS TYPE STRING,
GLO_RUS_ECO_CLS TYPE STRING,
GLO_RUS_PRT_TYPE TYPE STRING,
GLO_RUS_SHD_RSN TYPE STRING,
GLO_RUS_SHD_DOCN TYPE STRING,
GLO_RUS_PLD_CHCK TYPE STRING,
GLO_RUS_PLD_AMNT TYPE STRING,
GLO_RUS_PLD_RCPN TYPE STRING,
GLO_RUS_DOCNUM TYPE STRING,
GLO_RUS_ICNMB TYPE STRING,
GLO_RUS_TXB_TYPE TYPE STRING,
GLO_RUS_TXB_UNIT TYPE STRING,
GLO_RUS_TTX_EXMP TYPE STRING,
GLO_RUS_TTX_PRVG TYPE STRING,
GLO_RUS_TTX_STLD TYPE STRING,
GLO_RUS_TTX_RTRD TYPE STRING,
GLO_RUS_TTX_RGSD TYPE STRING,
GLO_RUS_TTX_RMVD TYPE STRING,
GLO_RUS_TTX_OKT1 TYPE STRING,
GLO_RUS_TTX_OKT2 TYPE STRING,
GLO_RUS_TTX_OKT3 TYPE STRING,
GLO_RUS_TTX_OKT4 TYPE STRING,
GLO_RUS_TTX_LNUM TYPE STRING,
GLO_RUS_TTX_AMTREDUCTION TYPE STRING,
GLO_RUS_AMTRED TYPE STRING,
GLO_RUS_PRT_OKT1 TYPE STRING,
GLO_RUS_PRT_OKT2 TYPE STRING,
GLO_RUS_PRT_OKT3 TYPE STRING,
GLO_RUS_PRT_OKT4 TYPE STRING,
GLO_RUS_PRT_EXMP TYPE STRING,
GLO_RUS_PRT_PRVG TYPE STRING,
GLO_RUS_PRT_AMTR TYPE STRING,
VNAME TYPE STRING,
EGRUP TYPE STRING,
RECID TYPE STRING,
ETYPE TYPE STRING,END OF T_EKKO_STR. DATA: WA_ANLAV_STR type T_EKKO_STR. DATA: ld_text TYPE string. LOOP AT IT_EKKO INTO WA_EKKO. MOVE-CORRESPONDING wa_EKKO TO WA_EKKO_STR. CONCATENATE: sy-vline
WA_ANLAV_STR-MANDT sy-vline
WA_ANLAV_STR-BUKRS sy-vline
WA_ANLAV_STR-ANLN1 sy-vline
WA_ANLAV_STR-ANLN2 sy-vline
WA_ANLAV_STR-ANLKL sy-vline
WA_ANLAV_STR-GEGST sy-vline
WA_ANLAV_STR-ANEQK sy-vline
WA_ANLAV_STR-ANEQS sy-vline
WA_ANLAV_STR-ERNAM sy-vline
WA_ANLAV_STR-ERDAT sy-vline
WA_ANLAV_STR-AENAM sy-vline
WA_ANLAV_STR-AEDAT sy-vline
WA_ANLAV_STR-XLOEV sy-vline
WA_ANLAV_STR-XSPEB sy-vline
WA_ANLAV_STR-FELEI sy-vline
WA_ANLAV_STR-KTOGR sy-vline
WA_ANLAV_STR-XOPVW sy-vline
WA_ANLAV_STR-ANLTP sy-vline
WA_ANLAV_STR-AKTIV sy-vline
WA_ANLAV_STR-ABGDT sy-vline
WA_ANLAV_STR-DEAKT sy-vline
WA_ANLAV_STR-GPLAB sy-vline
WA_ANLAV_STR-BSTDT sy-vline
WA_ANLAV_STR-ORD41 sy-vline
WA_ANLAV_STR-ORD42 sy-vline
WA_ANLAV_STR-ORD43 sy-vline
WA_ANLAV_STR-ORD44 sy-vline
WA_ANLAV_STR-ANLUE sy-vline
WA_ANLAV_STR-LIFNR sy-vline
WA_ANLAV_STR-LAND1 sy-vline
WA_ANLAV_STR-LIEFE sy-vline
WA_ANLAV_STR-HERST sy-vline
WA_ANLAV_STR-EIGKZ sy-vline
WA_ANLAV_STR-AIBN1 sy-vline
WA_ANLAV_STR-AIBN2 sy-vline
WA_ANLAV_STR-AIBDT sy-vline
WA_ANLAV_STR-URJHR sy-vline
WA_ANLAV_STR-URWRT sy-vline
WA_ANLAV_STR-ANTEI sy-vline
WA_ANLAV_STR-PROJN sy-vline
WA_ANLAV_STR-EAUFN sy-vline
WA_ANLAV_STR-MEINS sy-vline
WA_ANLAV_STR-MENGE sy-vline
WA_ANLAV_STR-TYPBZ sy-vline
WA_ANLAV_STR-IZWEK sy-vline
WA_ANLAV_STR-INKEN sy-vline
WA_ANLAV_STR-IVDAT sy-vline
WA_ANLAV_STR-INVZU sy-vline
WA_ANLAV_STR-VMGLI sy-vline
WA_ANLAV_STR-XVRMW sy-vline
WA_ANLAV_STR-WRTMA sy-vline
WA_ANLAV_STR-EHWRT sy-vline
WA_ANLAV_STR-AUFLA sy-vline
WA_ANLAV_STR-EHWZU sy-vline
WA_ANLAV_STR-EHWNR sy-vline
WA_ANLAV_STR-GRUVO sy-vline
WA_ANLAV_STR-GREIN sy-vline
WA_ANLAV_STR-GRBND sy-vline
WA_ANLAV_STR-GRBLT sy-vline
WA_ANLAV_STR-GRLFD sy-vline
WA_ANLAV_STR-FLURK sy-vline
WA_ANLAV_STR-FLURN sy-vline
WA_ANLAV_STR-FIAMT sy-vline
WA_ANLAV_STR-STADT sy-vline
WA_ANLAV_STR-GRUND sy-vline
WA_ANLAV_STR-FEINS sy-vline
WA_ANLAV_STR-GRUFL sy-vline
WA_ANLAV_STR-INVNR sy-vline
WA_ANLAV_STR-VBUND sy-vline
WA_ANLAV_STR-TXT50 sy-vline
WA_ANLAV_STR-TXA50 sy-vline
WA_ANLAV_STR-XLTXID sy-vline
WA_ANLAV_STR-XVERID sy-vline
WA_ANLAV_STR-XTCHID sy-vline
WA_ANLAV_STR-XKALID sy-vline
WA_ANLAV_STR-XHERID sy-vline
WA_ANLAV_STR-XLEAID sy-vline
WA_ANLAV_STR-LEAFI sy-vline
WA_ANLAV_STR-LVDAT sy-vline
WA_ANLAV_STR-LKDAT sy-vline
WA_ANLAV_STR-LEABG sy-vline
WA_ANLAV_STR-LEJAR sy-vline
WA_ANLAV_STR-LEPER sy-vline
WA_ANLAV_STR-LRYTH sy-vline
WA_ANLAV_STR-LEGEB sy-vline
WA_ANLAV_STR-LBASW sy-vline
WA_ANLAV_STR-LKAUF sy-vline
WA_ANLAV_STR-LZINS sy-vline
WA_ANLAV_STR-LTZBW sy-vline
WA_ANLAV_STR-LKUZA sy-vline
WA_ANLAV_STR-LKUZI sy-vline
WA_ANLAV_STR-LLAVB sy-vline
WA_ANLAV_STR-LEANZ sy-vline
WA_ANLAV_STR-LVTNR sy-vline
WA_ANLAV_STR-LETXT sy-vline
WA_ANLAV_STR-AIMMO sy-vline
WA_ANLAV_STR-OBJNR sy-vline
WA_ANLAV_STR-OBART sy-vline
WA_ANLAV_STR-PSPHI sy-vline
WA_ANLAV_STR-PRNAM sy-vline
WA_ANLAV_STR-PRPOS sy-vline
WA_ANLAV_STR-PRGJR sy-vline
WA_ANLAV_STR-IMAPO sy-vline
WA_ANLAV_STR-IMAPE sy-vline
WA_ANLAV_STR-IMAVA sy-vline
WA_ANLAV_STR-IMAGN sy-vline
WA_ANLAV_STR-LFDNR sy-vline
WA_ANLAV_STR-LFDHI sy-vline
WA_ANLAV_STR-LEART sy-vline
WA_ANLAV_STR-LVORS sy-vline
WA_ANLAV_STR-GDLGRP sy-vline
WA_ANLAV_STR-POSNR sy-vline
WA_ANLAV_STR-PSPID sy-vline
WA_ANLAV_STR-XERWRT sy-vline
WA_ANLAV_STR-XAFABCH sy-vline
WA_ANLAV_STR-XANLGR sy-vline
WA_ANLAV_STR-XINVM sy-vline
WA_ANLAV_STR-SERNR sy-vline
WA_ANLAV_STR-UMWKZ sy-vline
WA_ANLAV_STR-LRVDAT sy-vline
WA_ANLAV_STR-BDATU sy-vline
WA_ANLAV_STR-ADATU sy-vline
WA_ANLAV_STR-KOSTL sy-vline
WA_ANLAV_STR-WERKS sy-vline
WA_ANLAV_STR-GSBER sy-vline
WA_ANLAV_STR-LSTAR sy-vline
WA_ANLAV_STR-MSFAK sy-vline
WA_ANLAV_STR-XSTIL sy-vline
WA_ANLAV_STR-STORT sy-vline
WA_ANLAV_STR-CAUFN sy-vline
WA_ANLAV_STR-RAUMN sy-vline
WA_ANLAV_STR-IAUFN sy-vline
WA_ANLAV_STR-IPROJ sy-vline
WA_ANLAV_STR-TPLNR sy-vline
WA_ANLAV_STR-TXJCD sy-vline
WA_ANLAV_STR-IPSNR sy-vline
WA_ANLAV_STR-KTANSW sy-vline
WA_ANLAV_STR-ERGSO sy-vline
WA_ANLAV_STR-ERGHB sy-vline
WA_ANLAV_STR-KHINR sy-vline
WA_ANLAV_STR-ANLN0 sy-vline
WA_ANLAV_STR-WRTTP sy-vline
WA_ANLAV_STR-KFZKZ sy-vline
WA_ANLAV_STR-PERNR sy-vline
WA_ANLAV_STR-KOSTLV sy-vline
WA_ANLAV_STR-ANLHTXT sy-vline
WA_ANLAV_STR-ADDRNUM sy-vline
WA_ANLAV_STR-KTSAKAN sy-vline
WA_ANLAV_STR-KTAUFW sy-vline
WA_ANLAV_STR-KTAUFAN sy-vline
WA_ANLAV_STR-POSNR2 sy-vline
WA_ANLAV_STR-PSPID2 sy-vline
WA_ANLAV_STR-HAS_TDDP sy-vline
WA_ANLAV_STR-LAST_REORG_DATE sy-vline
WA_ANLAV_STR-FISTL sy-vline
WA_ANLAV_STR-GEBER sy-vline
WA_ANLAV_STR-FKBER sy-vline
WA_ANLAV_STR-GRANT_NBR sy-vline
WA_ANLAV_STR-GEBER2 sy-vline
WA_ANLAV_STR-FKBER2 sy-vline
WA_ANLAV_STR-GRANT_NBR2 sy-vline
WA_ANLAV_STR-FISTL2 sy-vline
WA_ANLAV_STR-IMKEY sy-vline
WA_ANLAV_STR-PS_PSP_PNR2 sy-vline
WA_ANLAV_STR-BUDGET_PD sy-vline
WA_ANLAV_STR-BUDGET_PD2 sy-vline
WA_ANLAV_STR-SEGMENT sy-vline
WA_ANLAV_STR-PRCTR sy-vline
WA_ANLAV_STR-GLO_RUS_DEPGR sy-vline
WA_ANLAV_STR-GLO_RUS_OKOF sy-vline
WA_ANLAV_STR-GLO_RUS_SERNR sy-vline
WA_ANLAV_STR-GLO_RUS_PRECCT sy-vline
WA_ANLAV_STR-GLO_RUS_PRECQ sy-vline
WA_ANLAV_STR-GLO_RUS_PRECW sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_TYPE sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_VIN sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_MNFD sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_ECOCLASS sy-vline
WA_ANLAV_STR-GLO_RUS_ECOCLASS sy-vline
WA_ANLAV_STR-GLO_RUS_ECO_CLS sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_TYPE sy-vline
WA_ANLAV_STR-GLO_RUS_SHD_RSN sy-vline
WA_ANLAV_STR-GLO_RUS_SHD_DOCN sy-vline
WA_ANLAV_STR-GLO_RUS_PLD_CHCK sy-vline
WA_ANLAV_STR-GLO_RUS_PLD_AMNT sy-vline
WA_ANLAV_STR-GLO_RUS_PLD_RCPN sy-vline
WA_ANLAV_STR-GLO_RUS_DOCNUM sy-vline
WA_ANLAV_STR-GLO_RUS_ICNMB sy-vline
WA_ANLAV_STR-GLO_RUS_TXB_TYPE sy-vline
WA_ANLAV_STR-GLO_RUS_TXB_UNIT sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_EXMP sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_PRVG sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_STLD sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_RTRD sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_RGSD sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_RMVD sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_OKT1 sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_OKT2 sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_OKT3 sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_OKT4 sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_LNUM sy-vline
WA_ANLAV_STR-GLO_RUS_TTX_AMTREDUCTION sy-vline
WA_ANLAV_STR-GLO_RUS_AMTRED sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_OKT1 sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_OKT2 sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_OKT3 sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_OKT4 sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_EXMP sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_PRVG sy-vline
WA_ANLAV_STR-GLO_RUS_PRT_AMTR sy-vline
WA_ANLAV_STR-VNAME sy-vline
WA_ANLAV_STR-EGRUP sy-vline
WA_ANLAV_STR-RECID sy-vline
WA_ANLAV_STR-ETYPE sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.