ABAP Select data from SAP table MARA 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 MARA 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 MARA. 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 MARA 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_MARA TYPE STANDARD TABLE OF MARA,
      WA_MARA TYPE MARA,
      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: <MARA> TYPE MARA.

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

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

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM MARA
*  INTO TABLE @DATA(IT_MARA2).
*--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_MARA INDEX 1 INTO DATA(WA_MARA2).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_MARA ASSIGNING <MARA>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<MARA>-MANDT = 1.
<MARA>-MATNR = 1.
<MARA>-ERSDA = 1.
<MARA>-ERNAM = 1.
<MARA>-LAEDA = 1.
ENDLOOP.

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

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_MARA-AENAM, sy-vline,
WA_MARA-VPSTA, sy-vline,
WA_MARA-PSTAT, sy-vline,
WA_MARA-LVORM, sy-vline,
WA_MARA-MTART, sy-vline,
WA_MARA-MBRSH, sy-vline.
ENDLOOP. *Add any further fields from structure WA_MARA 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_MARA 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_MARA INTO WA_MARA. *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 MATN1, internal->external for field MATNR CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-MATNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-MATNR.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

*Conversion exit MATN1, internal->external for field STOFF CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-STOFF IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-STOFF.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

*Conversion exit MATN1, internal->external for field SATNR CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-SATNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-SATNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATN1, internal->external for field PMATA CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-PMATA IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-PMATA.
WRITE:/ 'New Value:', ld_input.

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

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

*Conversion exit MATN1, internal->external for field BMATN CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-BMATN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-BMATN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit PERKZ, internal->external for field IPRKZ CALL FUNCTION 'CONVERSION_EXIT_PERKZ_OUTPUT' EXPORTING input = WA_MARA-IPRKZ IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-IPRKZ.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATN1, internal->external for field GENNR CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-GENNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-GENNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATN1, internal->external for field RMATP CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-RMATP IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-RMATP.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

*Conversion exit MATN1, internal->external for field MSBOOKPARTNO CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-MSBOOKPARTNO IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-MSBOOKPARTNO.
WRITE:/ 'New Value:', ld_input.

*Conversion exit AENNR, internal->external for field VCHNR CALL FUNCTION 'CONVERSION_EXIT_AENNR_OUTPUT' EXPORTING input = WA_MARA-VCHNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-VCHNR.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATN1, internal->external for field DVERS CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-DVERS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-DVERS.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATN1, internal->external for field IMATN CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_MARA-IMATN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-IMATN.
WRITE:/ 'New Value:', ld_input.

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

*Conversion exit ATINN, internal->external for field COLOR_ATINN CALL FUNCTION 'CONVERSION_EXIT_ATINN_OUTPUT' EXPORTING input = WA_MARA-COLOR_ATINN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-COLOR_ATINN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ATINN, internal->external for field SIZE1_ATINN CALL FUNCTION 'CONVERSION_EXIT_ATINN_OUTPUT' EXPORTING input = WA_MARA-SIZE1_ATINN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-SIZE1_ATINN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ATINN, internal->external for field SIZE2_ATINN CALL FUNCTION 'CONVERSION_EXIT_ATINN_OUTPUT' EXPORTING input = WA_MARA-SIZE2_ATINN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-SIZE2_ATINN.
WRITE:/ 'New Value:', ld_input.

*Conversion exit FIBER, internal->external for field FIBER_CODE1 CALL FUNCTION 'CONVERSION_EXIT_FIBER_OUTPUT' EXPORTING input = WA_MARA-FIBER_CODE1 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-FIBER_CODE1.
WRITE:/ 'New Value:', ld_input.

*Conversion exit FIBER, internal->external for field FIBER_CODE2 CALL FUNCTION 'CONVERSION_EXIT_FIBER_OUTPUT' EXPORTING input = WA_MARA-FIBER_CODE2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-FIBER_CODE2.
WRITE:/ 'New Value:', ld_input.

*Conversion exit FIBER, internal->external for field FIBER_CODE3 CALL FUNCTION 'CONVERSION_EXIT_FIBER_OUTPUT' EXPORTING input = WA_MARA-FIBER_CODE3 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-FIBER_CODE3.
WRITE:/ 'New Value:', ld_input.

*Conversion exit FIBER, internal->external for field FIBER_CODE4 CALL FUNCTION 'CONVERSION_EXIT_FIBER_OUTPUT' EXPORTING input = WA_MARA-FIBER_CODE4 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-FIBER_CODE4.
WRITE:/ 'New Value:', ld_input.

*Conversion exit FIBER, internal->external for field FIBER_CODE5 CALL FUNCTION 'CONVERSION_EXIT_FIBER_OUTPUT' EXPORTING input = WA_MARA-FIBER_CODE5 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-FIBER_CODE5.
WRITE:/ 'New Value:', ld_input.

*Conversion exit ALPHA, internal->external for field OIGROUPNAM CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_MARA-OIGROUPNAM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_MARA-OIGROUPNAM.
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_MARA_STR,
MANDT TYPE STRING,
MATNR TYPE STRING,
ERSDA TYPE STRING,
ERNAM TYPE STRING,
LAEDA TYPE STRING,
AENAM TYPE STRING,
VPSTA TYPE STRING,
PSTAT TYPE STRING,
LVORM TYPE STRING,
MTART TYPE STRING,
MBRSH TYPE STRING,
MATKL TYPE STRING,
BISMT TYPE STRING,
MEINS TYPE STRING,
BSTME TYPE STRING,
AESZN TYPE STRING,
BLATT TYPE STRING,
BLANZ TYPE STRING,
FERTH TYPE STRING,
FORMT TYPE STRING,
GROES TYPE STRING,
WRKST TYPE STRING,
NORMT TYPE STRING,
LABOR TYPE STRING,
EKWSL TYPE STRING,
BRGEW TYPE STRING,
NTGEW TYPE STRING,
GEWEI TYPE STRING,
VOLUM TYPE STRING,
VOLEH TYPE STRING,
BEHVO TYPE STRING,
RAUBE TYPE STRING,
TEMPB TYPE STRING,
DISST TYPE STRING,
TRAGR TYPE STRING,
STOFF TYPE STRING,
SPART TYPE STRING,
KUNNR TYPE STRING,
EANNR TYPE STRING,
WESCH TYPE STRING,
BWVOR TYPE STRING,
BWSCL TYPE STRING,
SAISO TYPE STRING,
ETIAR TYPE STRING,
ETIFO TYPE STRING,
ENTAR TYPE STRING,
EAN11 TYPE STRING,
NUMTP TYPE STRING,
LAENG TYPE STRING,
BREIT TYPE STRING,
HOEHE TYPE STRING,
MEABM TYPE STRING,
PRDHA TYPE STRING,
AEKLK TYPE STRING,
CADKZ TYPE STRING,
QMPUR TYPE STRING,
ERGEW TYPE STRING,
ERGEI TYPE STRING,
ERVOL TYPE STRING,
ERVOE TYPE STRING,
GEWTO TYPE STRING,
VOLTO TYPE STRING,
VABME TYPE STRING,
KZREV TYPE STRING,
KZKFG TYPE STRING,
XCHPF TYPE STRING,
VHART TYPE STRING,
FUELG TYPE STRING,
STFAK TYPE STRING,
MAGRV TYPE STRING,
BEGRU TYPE STRING,
DATAB TYPE STRING,
LIQDT TYPE STRING,
SAISJ TYPE STRING,
PLGTP TYPE STRING,
MLGUT TYPE STRING,
EXTWG TYPE STRING,
SATNR TYPE STRING,
ATTYP TYPE STRING,
KZKUP TYPE STRING,
KZNFM TYPE STRING,
PMATA TYPE STRING,
MSTAE TYPE STRING,
MSTAV TYPE STRING,
MSTDE TYPE STRING,
MSTDV TYPE STRING,
TAKLV TYPE STRING,
RBNRM TYPE STRING,
MHDRZ TYPE STRING,
MHDHB TYPE STRING,
MHDLP TYPE STRING,
INHME TYPE STRING,
INHAL TYPE STRING,
VPREH TYPE STRING,
ETIAG TYPE STRING,
INHBR TYPE STRING,
CMETH TYPE STRING,
CUOBF TYPE STRING,
KZUMW TYPE STRING,
KOSCH TYPE STRING,
SPROF TYPE STRING,
NRFHG TYPE STRING,
MFRPN TYPE STRING,
MFRNR TYPE STRING,
BMATN TYPE STRING,
MPROF TYPE STRING,
KZWSM TYPE STRING,
SAITY TYPE STRING,
PROFL TYPE STRING,
IHIVI TYPE STRING,
ILOOS TYPE STRING,
SERLV TYPE STRING,
KZGVH TYPE STRING,
XGCHP TYPE STRING,
KZEFF TYPE STRING,
COMPL TYPE STRING,
IPRKZ TYPE STRING,
RDMHD TYPE STRING,
PRZUS TYPE STRING,
MTPOS_MARA TYPE STRING,
BFLME TYPE STRING,
MATFI TYPE STRING,
CMREL TYPE STRING,
BBTYP TYPE STRING,
SLED_BBD TYPE STRING,
GTIN_VARIANT TYPE STRING,
GENNR TYPE STRING,
RMATP TYPE STRING,
GDS_RELEVANT TYPE STRING,
WEORA TYPE STRING,
HUTYP_DFLT TYPE STRING,
PILFERABLE TYPE STRING,
WHSTC TYPE STRING,
WHMATGR TYPE STRING,
HNDLCODE TYPE STRING,
HAZMAT TYPE STRING,
HUTYP TYPE STRING,
TARE_VAR TYPE STRING,
MAXC TYPE STRING,
MAXC_TOL TYPE STRING,
MAXL TYPE STRING,
MAXB TYPE STRING,
MAXH TYPE STRING,
MAXDIM_UOM TYPE STRING,
HERKL TYPE STRING,
MFRGR TYPE STRING,
QQTIME TYPE STRING,
QQTIMEUOM TYPE STRING,
QGRP TYPE STRING,
SERIAL TYPE STRING,
PS_SMARTFORM TYPE STRING,
LOGUNIT TYPE STRING,
CWQREL TYPE STRING,
CWQPROC TYPE STRING,
CWQTOLGR TYPE STRING,
ADPROF TYPE STRING,
IPMIPPRODUCT TYPE STRING,
ALLOW_PMAT_IGNO TYPE STRING,
MEDIUM TYPE STRING,
COMMODITY TYPE STRING,
ANIMAL_ORIGIN TYPE STRING,
TEXTILE_COMP_IND TYPE STRING,
ANP TYPE STRING,
/BEV1/LULEINH TYPE STRING,
/BEV1/LULDEGRP TYPE STRING,
/BEV1/NESTRUCCAT TYPE STRING,
/DSD/SL_TOLTYP TYPE STRING,
/DSD/SV_CNT_GRP TYPE STRING,
/DSD/VC_GROUP TYPE STRING,
/SAPMP/KADU TYPE STRING,
/SAPMP/ABMEIN TYPE STRING,
/SAPMP/KADP TYPE STRING,
/SAPMP/BRAD TYPE STRING,
/SAPMP/SPBI TYPE STRING,
/SAPMP/TRAD TYPE STRING,
/SAPMP/KEDU TYPE STRING,
/SAPMP/SPTR TYPE STRING,
/SAPMP/FBDK TYPE STRING,
/SAPMP/FBHK TYPE STRING,
/SAPMP/RILI TYPE STRING,
/SAPMP/FBAK TYPE STRING,
/SAPMP/AHO TYPE STRING,
/SAPMP/MIFRR TYPE STRING,
/VSO/R_TILT_IND TYPE STRING,
/VSO/R_STACK_IND TYPE STRING,
/VSO/R_BOT_IND TYPE STRING,
/VSO/R_TOP_IND TYPE STRING,
/VSO/R_STACK_NO TYPE STRING,
/VSO/R_PAL_IND TYPE STRING,
/VSO/R_PAL_OVR_D TYPE STRING,
/VSO/R_PAL_OVR_W TYPE STRING,
/VSO/R_PAL_B_HT TYPE STRING,
/VSO/R_PAL_MIN_H TYPE STRING,
/VSO/R_TOL_B_HT TYPE STRING,
/VSO/R_NO_P_GVH TYPE STRING,
/VSO/R_QUAN_UNIT TYPE STRING,
/VSO/R_KZGVH_IND TYPE STRING,
PACKCODE TYPE STRING,
DG_PACK_STATUS TYPE STRING,
MCOND TYPE STRING,
RETDELC TYPE STRING,
LOGLEV_RETO TYPE STRING,
NSNID TYPE STRING,
OVLPN TYPE STRING,
ADSPC_SPC TYPE STRING,
VARID TYPE STRING,
MSBOOKPARTNO TYPE STRING,
VTYPE TYPE STRING,
VCHNR TYPE STRING,
EVVAL TYPE STRING,
DVERS TYPE STRING,
DPCBT TYPE STRING,
XGRDT TYPE STRING,
IMATN TYPE STRING,
PICNUM TYPE STRING,
BSTAT TYPE STRING,
COLOR_ATINN TYPE STRING,
SIZE1_ATINN TYPE STRING,
SIZE2_ATINN TYPE STRING,
COLOR TYPE STRING,
SIZE1 TYPE STRING,
SIZE2 TYPE STRING,
FREE_CHAR TYPE STRING,
CARE_CODE TYPE STRING,
BRAND_ID TYPE STRING,
FIBER_CODE1 TYPE STRING,
FIBER_PART1 TYPE STRING,
FIBER_CODE2 TYPE STRING,
FIBER_PART2 TYPE STRING,
FIBER_CODE3 TYPE STRING,
FIBER_PART3 TYPE STRING,
FIBER_CODE4 TYPE STRING,
FIBER_PART4 TYPE STRING,
FIBER_CODE5 TYPE STRING,
FIBER_PART5 TYPE STRING,
FASHGRD TYPE STRING,
COBJID TYPE STRING,
COTYPE TYPE STRING,
OIGROUPNAM TYPE STRING,
OITRIND TYPE STRING,
OIHMTXGR TYPE STRING,END OF T_EKKO_STR. DATA: WA_MARA_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_MARA_STR-MANDT sy-vline
WA_MARA_STR-MATNR sy-vline
WA_MARA_STR-ERSDA sy-vline
WA_MARA_STR-ERNAM sy-vline
WA_MARA_STR-LAEDA sy-vline
WA_MARA_STR-AENAM sy-vline
WA_MARA_STR-VPSTA sy-vline
WA_MARA_STR-PSTAT sy-vline
WA_MARA_STR-LVORM sy-vline
WA_MARA_STR-MTART sy-vline
WA_MARA_STR-MBRSH sy-vline
WA_MARA_STR-MATKL sy-vline
WA_MARA_STR-BISMT sy-vline
WA_MARA_STR-MEINS sy-vline
WA_MARA_STR-BSTME sy-vline
WA_MARA_STR-AESZN sy-vline
WA_MARA_STR-BLATT sy-vline
WA_MARA_STR-BLANZ sy-vline
WA_MARA_STR-FERTH sy-vline
WA_MARA_STR-FORMT sy-vline
WA_MARA_STR-GROES sy-vline
WA_MARA_STR-WRKST sy-vline
WA_MARA_STR-NORMT sy-vline
WA_MARA_STR-LABOR sy-vline
WA_MARA_STR-EKWSL sy-vline
WA_MARA_STR-BRGEW sy-vline
WA_MARA_STR-NTGEW sy-vline
WA_MARA_STR-GEWEI sy-vline
WA_MARA_STR-VOLUM sy-vline
WA_MARA_STR-VOLEH sy-vline
WA_MARA_STR-BEHVO sy-vline
WA_MARA_STR-RAUBE sy-vline
WA_MARA_STR-TEMPB sy-vline
WA_MARA_STR-DISST sy-vline
WA_MARA_STR-TRAGR sy-vline
WA_MARA_STR-STOFF sy-vline
WA_MARA_STR-SPART sy-vline
WA_MARA_STR-KUNNR sy-vline
WA_MARA_STR-EANNR sy-vline
WA_MARA_STR-WESCH sy-vline
WA_MARA_STR-BWVOR sy-vline
WA_MARA_STR-BWSCL sy-vline
WA_MARA_STR-SAISO sy-vline
WA_MARA_STR-ETIAR sy-vline
WA_MARA_STR-ETIFO sy-vline
WA_MARA_STR-ENTAR sy-vline
WA_MARA_STR-EAN11 sy-vline
WA_MARA_STR-NUMTP sy-vline
WA_MARA_STR-LAENG sy-vline
WA_MARA_STR-BREIT sy-vline
WA_MARA_STR-HOEHE sy-vline
WA_MARA_STR-MEABM sy-vline
WA_MARA_STR-PRDHA sy-vline
WA_MARA_STR-AEKLK sy-vline
WA_MARA_STR-CADKZ sy-vline
WA_MARA_STR-QMPUR sy-vline
WA_MARA_STR-ERGEW sy-vline
WA_MARA_STR-ERGEI sy-vline
WA_MARA_STR-ERVOL sy-vline
WA_MARA_STR-ERVOE sy-vline
WA_MARA_STR-GEWTO sy-vline
WA_MARA_STR-VOLTO sy-vline
WA_MARA_STR-VABME sy-vline
WA_MARA_STR-KZREV sy-vline
WA_MARA_STR-KZKFG sy-vline
WA_MARA_STR-XCHPF sy-vline
WA_MARA_STR-VHART sy-vline
WA_MARA_STR-FUELG sy-vline
WA_MARA_STR-STFAK sy-vline
WA_MARA_STR-MAGRV sy-vline
WA_MARA_STR-BEGRU sy-vline
WA_MARA_STR-DATAB sy-vline
WA_MARA_STR-LIQDT sy-vline
WA_MARA_STR-SAISJ sy-vline
WA_MARA_STR-PLGTP sy-vline
WA_MARA_STR-MLGUT sy-vline
WA_MARA_STR-EXTWG sy-vline
WA_MARA_STR-SATNR sy-vline
WA_MARA_STR-ATTYP sy-vline
WA_MARA_STR-KZKUP sy-vline
WA_MARA_STR-KZNFM sy-vline
WA_MARA_STR-PMATA sy-vline
WA_MARA_STR-MSTAE sy-vline
WA_MARA_STR-MSTAV sy-vline
WA_MARA_STR-MSTDE sy-vline
WA_MARA_STR-MSTDV sy-vline
WA_MARA_STR-TAKLV sy-vline
WA_MARA_STR-RBNRM sy-vline
WA_MARA_STR-MHDRZ sy-vline
WA_MARA_STR-MHDHB sy-vline
WA_MARA_STR-MHDLP sy-vline
WA_MARA_STR-INHME sy-vline
WA_MARA_STR-INHAL sy-vline
WA_MARA_STR-VPREH sy-vline
WA_MARA_STR-ETIAG sy-vline
WA_MARA_STR-INHBR sy-vline
WA_MARA_STR-CMETH sy-vline
WA_MARA_STR-CUOBF sy-vline
WA_MARA_STR-KZUMW sy-vline
WA_MARA_STR-KOSCH sy-vline
WA_MARA_STR-SPROF sy-vline
WA_MARA_STR-NRFHG sy-vline
WA_MARA_STR-MFRPN sy-vline
WA_MARA_STR-MFRNR sy-vline
WA_MARA_STR-BMATN sy-vline
WA_MARA_STR-MPROF sy-vline
WA_MARA_STR-KZWSM sy-vline
WA_MARA_STR-SAITY sy-vline
WA_MARA_STR-PROFL sy-vline
WA_MARA_STR-IHIVI sy-vline
WA_MARA_STR-ILOOS sy-vline
WA_MARA_STR-SERLV sy-vline
WA_MARA_STR-KZGVH sy-vline
WA_MARA_STR-XGCHP sy-vline
WA_MARA_STR-KZEFF sy-vline
WA_MARA_STR-COMPL sy-vline
WA_MARA_STR-IPRKZ sy-vline
WA_MARA_STR-RDMHD sy-vline
WA_MARA_STR-PRZUS sy-vline
WA_MARA_STR-MTPOS_MARA sy-vline
WA_MARA_STR-BFLME sy-vline
WA_MARA_STR-MATFI sy-vline
WA_MARA_STR-CMREL sy-vline
WA_MARA_STR-BBTYP sy-vline
WA_MARA_STR-SLED_BBD sy-vline
WA_MARA_STR-GTIN_VARIANT sy-vline
WA_MARA_STR-GENNR sy-vline
WA_MARA_STR-RMATP sy-vline
WA_MARA_STR-GDS_RELEVANT sy-vline
WA_MARA_STR-WEORA sy-vline
WA_MARA_STR-HUTYP_DFLT sy-vline
WA_MARA_STR-PILFERABLE sy-vline
WA_MARA_STR-WHSTC sy-vline
WA_MARA_STR-WHMATGR sy-vline
WA_MARA_STR-HNDLCODE sy-vline
WA_MARA_STR-HAZMAT sy-vline
WA_MARA_STR-HUTYP sy-vline
WA_MARA_STR-TARE_VAR sy-vline
WA_MARA_STR-MAXC sy-vline
WA_MARA_STR-MAXC_TOL sy-vline
WA_MARA_STR-MAXL sy-vline
WA_MARA_STR-MAXB sy-vline
WA_MARA_STR-MAXH sy-vline
WA_MARA_STR-MAXDIM_UOM sy-vline
WA_MARA_STR-HERKL sy-vline
WA_MARA_STR-MFRGR sy-vline
WA_MARA_STR-QQTIME sy-vline
WA_MARA_STR-QQTIMEUOM sy-vline
WA_MARA_STR-QGRP sy-vline
WA_MARA_STR-SERIAL sy-vline
WA_MARA_STR-PS_SMARTFORM sy-vline
WA_MARA_STR-LOGUNIT sy-vline
WA_MARA_STR-CWQREL sy-vline
WA_MARA_STR-CWQPROC sy-vline
WA_MARA_STR-CWQTOLGR sy-vline
WA_MARA_STR-ADPROF sy-vline
WA_MARA_STR-IPMIPPRODUCT sy-vline
WA_MARA_STR-ALLOW_PMAT_IGNO sy-vline
WA_MARA_STR-MEDIUM sy-vline
WA_MARA_STR-COMMODITY sy-vline
WA_MARA_STR-ANIMAL_ORIGIN sy-vline
WA_MARA_STR-TEXTILE_COMP_IND sy-vline
WA_MARA_STR-ANP sy-vline
WA_MARA_STR-/BEV1/LULEINH sy-vline
WA_MARA_STR-/BEV1/LULDEGRP sy-vline
WA_MARA_STR-/BEV1/NESTRUCCAT sy-vline
WA_MARA_STR-/DSD/SL_TOLTYP sy-vline
WA_MARA_STR-/DSD/SV_CNT_GRP sy-vline
WA_MARA_STR-/DSD/VC_GROUP sy-vline
WA_MARA_STR-/SAPMP/KADU sy-vline
WA_MARA_STR-/SAPMP/ABMEIN sy-vline
WA_MARA_STR-/SAPMP/KADP sy-vline
WA_MARA_STR-/SAPMP/BRAD sy-vline
WA_MARA_STR-/SAPMP/SPBI sy-vline
WA_MARA_STR-/SAPMP/TRAD sy-vline
WA_MARA_STR-/SAPMP/KEDU sy-vline
WA_MARA_STR-/SAPMP/SPTR sy-vline
WA_MARA_STR-/SAPMP/FBDK sy-vline
WA_MARA_STR-/SAPMP/FBHK sy-vline
WA_MARA_STR-/SAPMP/RILI sy-vline
WA_MARA_STR-/SAPMP/FBAK sy-vline
WA_MARA_STR-/SAPMP/AHO sy-vline
WA_MARA_STR-/SAPMP/MIFRR sy-vline
WA_MARA_STR-/VSO/R_TILT_IND sy-vline
WA_MARA_STR-/VSO/R_STACK_IND sy-vline
WA_MARA_STR-/VSO/R_BOT_IND sy-vline
WA_MARA_STR-/VSO/R_TOP_IND sy-vline
WA_MARA_STR-/VSO/R_STACK_NO sy-vline
WA_MARA_STR-/VSO/R_PAL_IND sy-vline
WA_MARA_STR-/VSO/R_PAL_OVR_D sy-vline
WA_MARA_STR-/VSO/R_PAL_OVR_W sy-vline
WA_MARA_STR-/VSO/R_PAL_B_HT sy-vline
WA_MARA_STR-/VSO/R_PAL_MIN_H sy-vline
WA_MARA_STR-/VSO/R_TOL_B_HT sy-vline
WA_MARA_STR-/VSO/R_NO_P_GVH sy-vline
WA_MARA_STR-/VSO/R_QUAN_UNIT sy-vline
WA_MARA_STR-/VSO/R_KZGVH_IND sy-vline
WA_MARA_STR-PACKCODE sy-vline
WA_MARA_STR-DG_PACK_STATUS sy-vline
WA_MARA_STR-MCOND sy-vline
WA_MARA_STR-RETDELC sy-vline
WA_MARA_STR-LOGLEV_RETO sy-vline
WA_MARA_STR-NSNID sy-vline
WA_MARA_STR-OVLPN sy-vline
WA_MARA_STR-ADSPC_SPC sy-vline
WA_MARA_STR-VARID sy-vline
WA_MARA_STR-MSBOOKPARTNO sy-vline
WA_MARA_STR-VTYPE sy-vline
WA_MARA_STR-VCHNR sy-vline
WA_MARA_STR-EVVAL sy-vline
WA_MARA_STR-DVERS sy-vline
WA_MARA_STR-DPCBT sy-vline
WA_MARA_STR-XGRDT sy-vline
WA_MARA_STR-IMATN sy-vline
WA_MARA_STR-PICNUM sy-vline
WA_MARA_STR-BSTAT sy-vline
WA_MARA_STR-COLOR_ATINN sy-vline
WA_MARA_STR-SIZE1_ATINN sy-vline
WA_MARA_STR-SIZE2_ATINN sy-vline
WA_MARA_STR-COLOR sy-vline
WA_MARA_STR-SIZE1 sy-vline
WA_MARA_STR-SIZE2 sy-vline
WA_MARA_STR-FREE_CHAR sy-vline
WA_MARA_STR-CARE_CODE sy-vline
WA_MARA_STR-BRAND_ID sy-vline
WA_MARA_STR-FIBER_CODE1 sy-vline
WA_MARA_STR-FIBER_PART1 sy-vline
WA_MARA_STR-FIBER_CODE2 sy-vline
WA_MARA_STR-FIBER_PART2 sy-vline
WA_MARA_STR-FIBER_CODE3 sy-vline
WA_MARA_STR-FIBER_PART3 sy-vline
WA_MARA_STR-FIBER_CODE4 sy-vline
WA_MARA_STR-FIBER_PART4 sy-vline
WA_MARA_STR-FIBER_CODE5 sy-vline
WA_MARA_STR-FIBER_PART5 sy-vline
WA_MARA_STR-FASHGRD sy-vline
WA_MARA_STR-COBJID sy-vline
WA_MARA_STR-COTYPE sy-vline
WA_MARA_STR-OIGROUPNAM sy-vline
WA_MARA_STR-OITRIND sy-vline
WA_MARA_STR-OIHMTXGR sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.