ABAP Select data from SAP table BAPISDITM 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 BAPISDITM 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 BAPISDITM. 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 BAPISDITM 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_BAPISDITM TYPE STANDARD TABLE OF BAPISDITM,
      WA_BAPISDITM TYPE BAPISDITM,
      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: <BAPISDITM> TYPE BAPISDITM.

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

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

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM BAPISDITM
*  INTO TABLE @DATA(IT_BAPISDITM2).
*--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_BAPISDITM INDEX 1 INTO DATA(WA_BAPISDITM2).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_BAPISDITM ASSIGNING <BAPISDITM>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<BAPISDITM>-ITM_NUMBER = 1.
<BAPISDITM>-HG_LV_ITEM = 1.
<BAPISDITM>-PO_ITM_NO = 1.
<BAPISDITM>-MATERIAL = 1.
<BAPISDITM>-ALT_TO_ITM = 1.
ENDLOOP.

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

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_BAPISDITM-CUST_MAT22, sy-vline,
WA_BAPISDITM-BATCH, sy-vline,
WA_BAPISDITM-DLV_GROUP, sy-vline,
WA_BAPISDITM-PART_DLV, sy-vline,
WA_BAPISDITM-REASON_REJ, sy-vline,
WA_BAPISDITM-BILL_BLOCK, sy-vline.
ENDLOOP. *Add any further fields from structure WA_BAPISDITM 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_BAPISDITM 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_BAPISDITM INTO WA_BAPISDITM. *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 PO_ITM_NO CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPISDITM-PO_ITM_NO IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-PO_ITM_NO.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATN5, internal->external for field MATERIAL CALL FUNCTION 'CONVERSION_EXIT_MATN5_OUTPUT' EXPORTING input = WA_BAPISDITM-MATERIAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-MATERIAL.
WRITE:/ 'New Value:', ld_input.

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

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

*Conversion exit EXCRT, internal->external for field EX_RATE_FI CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_BAPISDITM-EX_RATE_FI IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-EX_RATE_FI.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

*Conversion exit MATN5, internal->external for field PR_REF_MAT CALL FUNCTION 'CONVERSION_EXIT_MATN5_OUTPUT' EXPORTING input = WA_BAPISDITM-PR_REF_MAT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-PR_REF_MAT.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

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

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

*Conversion exit EXCRT, internal->external for field EXCH_RATE_FI_V CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_BAPISDITM-EXCH_RATE_FI_V IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-EXCH_RATE_FI_V.
WRITE:/ 'New Value:', ld_input.

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

*Conversion exit MATNL, internal->external for field MAT_EXT CALL FUNCTION 'CONVERSION_EXIT_MATNL_OUTPUT' EXPORTING input = WA_BAPISDITM-MAT_EXT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-MAT_EXT.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATNW, internal->external for field MAT_VERS CALL FUNCTION 'CONVERSION_EXIT_MATNW_OUTPUT' EXPORTING input = WA_BAPISDITM-MAT_VERS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-MAT_VERS.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATNL, internal->external for field P_MAT_EXT CALL FUNCTION 'CONVERSION_EXIT_MATNL_OUTPUT' EXPORTING input = WA_BAPISDITM-P_MAT_EXT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-P_MAT_EXT.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATNW, internal->external for field P_MAT_VERS CALL FUNCTION 'CONVERSION_EXIT_MATNW_OUTPUT' EXPORTING input = WA_BAPISDITM-P_MAT_VERS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-P_MAT_VERS.
WRITE:/ 'New Value:', ld_input.

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

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

*Conversion exit MATN5, internal->external for field MAT_ENTRD CALL FUNCTION 'CONVERSION_EXIT_MATN5_OUTPUT' EXPORTING input = WA_BAPISDITM-MAT_ENTRD IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-MAT_ENTRD.
WRITE:/ 'New Value:', ld_input.

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

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

*Conversion exit MATNL, internal->external for field MAT_ENTRD_EXTERNAL CALL FUNCTION 'CONVERSION_EXIT_MATNL_OUTPUT' EXPORTING input = WA_BAPISDITM-MAT_ENTRD_EXTERNAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-MAT_ENTRD_EXTERNAL.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATNW, internal->external for field MAT_ENTRD_VERSION CALL FUNCTION 'CONVERSION_EXIT_MATNW_OUTPUT' EXPORTING input = WA_BAPISDITM-MAT_ENTRD_VERSION IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-MAT_ENTRD_VERSION.
WRITE:/ 'New Value:', ld_input.

*Conversion exit FMCIL, internal->external for field CMMT_ITEM CALL FUNCTION 'CONVERSION_EXIT_FMCIL_OUTPUT' EXPORTING input = WA_BAPISDITM-CMMT_ITEM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-CMMT_ITEM.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

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

*Conversion exit CUNIT, internal->external for field PO_UNIT CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_BAPISDITM-PO_UNIT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPISDITM-PO_UNIT.
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_BAPISDITM_STR,
ITM_NUMBER TYPE STRING,
HG_LV_ITEM TYPE STRING,
PO_ITM_NO TYPE STRING,
MATERIAL TYPE STRING,
ALT_TO_ITM TYPE STRING,
CUST_MAT22 TYPE STRING,
BATCH TYPE STRING,
DLV_GROUP TYPE STRING,
PART_DLV TYPE STRING,
REASON_REJ TYPE STRING,
BILL_BLOCK TYPE STRING,
BILL_DATE TYPE STRING,
PLANT TYPE STRING,
STORE_LOC TYPE STRING,
TARGET_QTY TYPE STRING,
TARGET_QU TYPE STRING,
T_UNIT_ISO TYPE STRING,
ITEM_CATEG TYPE STRING,
SHORT_TEXT TYPE STRING,
PRC_GROUP1 TYPE STRING,
PRC_GROUP2 TYPE STRING,
PRC_GROUP3 TYPE STRING,
PRC_GROUP4 TYPE STRING,
PRC_GROUP5 TYPE STRING,
PROD_HIERA TYPE STRING,
MATL_GROUP TYPE STRING,
PURCH_NO_C TYPE STRING,
PURCH_DATE TYPE STRING,
PO_METHOD TYPE STRING,
REF_1 TYPE STRING,
PURCH_NO_S TYPE STRING,
PO_DAT_S TYPE STRING,
PO_METH_S TYPE STRING,
REF_1_S TYPE STRING,
POITM_NO_S TYPE STRING,
PRICE_GRP TYPE STRING,
CUST_GROUP TYPE STRING,
SALES_DIST TYPE STRING,
PRICE_LIST TYPE STRING,
INCOTERMS1 TYPE STRING,
INCOTERMS2 TYPE STRING,
ORDCOMP_IN TYPE STRING,
BILL_SCHED TYPE STRING,
INVO_SCHED TYPE STRING,
MN_INVOICE TYPE STRING,
EX_RATE_FI TYPE STRING,
ADD_VAL_DY TYPE STRING,
FIX_VAL_DY TYPE STRING,
PMNTTRMS TYPE STRING,
PYMT_METH TYPE STRING,
ACCNT_ASGN TYPE STRING,
EXCHG_RATE TYPE STRING,
PRICE_DATE TYPE STRING,
SERV_DATE TYPE STRING,
DUNN_KEY TYPE STRING,
DUNN_BLOCK TYPE STRING,
PROMOTION TYPE STRING,
PMTGAR_PRO TYPE STRING,
DOC_NUM_FI TYPE STRING,
DEPARTM_NO TYPE STRING,
REC_POINT TYPE STRING,
CSTCNDGRP1 TYPE STRING,
CSTCNDGRP2 TYPE STRING,
CSTCNDGRP3 TYPE STRING,
CSTCNDGRP4 TYPE STRING,
CSTCNDGRP5 TYPE STRING,
DLV_TIME TYPE STRING,
SALES_UNIT TYPE STRING,
S_UNIT_ISO TYPE STRING,
TRG_QTY_NO TYPE STRING,
TRGQTY_DEN TYPE STRING,
RNDDLV_QTY TYPE STRING,
MAXDEVAMNT TYPE STRING,
MAXDEVPER TYPE STRING,
MAXDEV_DAY TYPE STRING,
USAGE_IND TYPE STRING,
FIXED_QUAN TYPE STRING,
UNLMT_DLV TYPE STRING,
OVERDLVTOL TYPE STRING,
UNDDLV_TOL TYPE STRING,
DIVISION TYPE STRING,
SALQTYNUM TYPE STRING,
SALQTYDEN TYPE STRING,
GROSS_WGHT TYPE STRING,
NET_WEIGHT TYPE STRING,
UNTOF_WGHT TYPE STRING,
UNOF_WTISO TYPE STRING,
VOLUME TYPE STRING,
VOLUNIT TYPE STRING,
VOLUNITISO TYPE STRING,
DLV_PRIO TYPE STRING,
SHIP_POINT TYPE STRING,
ROUTE TYPE STRING,
CREATED_BY TYPE STRING,
TAX_CLASS1 TYPE STRING,
TAX_CLASS2 TYPE STRING,
TAX_CLASS3 TYPE STRING,
TAX_CLASS4 TYPE STRING,
TAX_CLASS5 TYPE STRING,
TAX_CLASS6 TYPE STRING,
TAX_CLASS7 TYPE STRING,
TAX_CLASS8 TYPE STRING,
TAX_CLASS9 TYPE STRING,
MAT_PR_GRP TYPE STRING,
VAL_TYPE TYPE STRING,
FIXDAT_QTY TYPE STRING,
BOMEXPL_NO TYPE STRING,
RESANALKEY TYPE STRING,
REQMTS_TYP TYPE STRING,
NO_GR_POST TYPE STRING,
BUS_TRANST TYPE STRING,
OVERHD_KEY TYPE STRING,
CSTG_SHEET TYPE STRING,
MATFRGTGRP TYPE STRING,
PLDLVSHDIN TYPE STRING,
SEQ_NO TYPE STRING,
BIL_FORM TYPE STRING,
DLI_PROFIL TYPE STRING,
REV_TYPE TYPE STRING,
BEGDEM_PER TYPE STRING,
PR_REF_MAT TYPE STRING,
REFOBJTYPE TYPE STRING,
REFOBJKEY TYPE STRING,
REFLOGSYS TYPE STRING,
ORDER_PROB TYPE STRING,
MAX_PL_DLV TYPE STRING,
CFOP_CODE TYPE STRING,
TAXLAWICMS TYPE STRING,
TAXLAWIPI TYPE STRING,
SD_TAXCODE TYPE STRING,
ASSORT_MOD TYPE STRING,
COMP_QUANT TYPE STRING,
TARGET_VAL TYPE STRING,
CURRENCY TYPE STRING,
CURR_ISO TYPE STRING,
PROFIT_CTR TYPE STRING,
ORDERID TYPE STRING,
WBS_ELEM TYPE STRING,
DEPREC_PER TYPE STRING,
REF_DOC TYPE STRING,
REF_DOC_IT TYPE STRING,
REF_DOC_CA TYPE STRING,
CUST_MAT35 TYPE STRING,
EXCH_RATE_FI_V TYPE STRING,
EXCHG_RATE_V TYPE STRING,
ITEMGUID_ATP TYPE STRING,
VAL_CONTR TYPE STRING,
VAL_CON_I TYPE STRING,
CONFIG_ID TYPE STRING,
INST_ID TYPE STRING,
MAT_EXT TYPE STRING,
MAT_GUID TYPE STRING,
MAT_VERS TYPE STRING,
P_MAT_EXT TYPE STRING,
P_MAT_GUID TYPE STRING,
P_MAT_VERS TYPE STRING,
FUNC_AREA TYPE STRING,
ALTERN_BOM TYPE STRING,
FKK_CONACCT TYPE STRING,
EAN_UPC TYPE STRING,
PRODCAT TYPE STRING,
SHIP_TYPE TYPE STRING,
S_PROC_IND TYPE STRING,
FUNC_AREA_LONG TYPE STRING,
BILL_REL TYPE STRING,
VW_UEPOS TYPE STRING,
CAMPAIGN TYPE STRING,
DLVSCHDUSE TYPE STRING,
CFOP_LONG TYPE STRING,
SELECTION TYPE STRING,
MAT_ENTRD TYPE STRING,
LOG_SYSTEM_OWN TYPE STRING,
ITM_TYPE_USAGE TYPE STRING,
TAXLAWISS TYPE STRING,
MAT_ENTRD_EXTERNAL TYPE STRING,
MAT_ENTRD_GUID TYPE STRING,
MAT_ENTRD_VERSION TYPE STRING,
LOC_TAXCAT TYPE STRING,
LOC_ZEROVAT TYPE STRING,
LOC_ACTCODE TYPE STRING,
LOC_DISTTYPE TYPE STRING,
LOC_TXRELCLAS TYPE STRING,
CALC_MOTIVE TYPE STRING,
COMPREAS TYPE STRING,
FUND TYPE STRING,
FUNDS_CTR TYPE STRING,
CMMT_ITEM TYPE STRING,
GRANT_NBR TYPE STRING,
BUDGET_PERIOD TYPE STRING,
TAXLAWCOFINS TYPE STRING,
TAXLAWPIS TYPE STRING,
TREASURY_ACC_SYMBOL TYPE STRING,
BUSINESS_EVENT_TCODE TYPE STRING,
MODIFICATION_ALLOWED TYPE STRING,
CANCELLATION_ALLOWED TYPE STRING,
PAYMENT_METHODS TYPE STRING,
BUSINESS_PARTNER_NO TYPE STRING,
REPORTING_FREQ TYPE STRING,
SEPA_MANDATE_ID TYPE STRING,
REQ_SEGMENT TYPE STRING,
TP_SUBLEVL TYPE STRING,
TP_AGENCID TYPE STRING,
TP_ALTRAID TYPE STRING,
TP_BEGPER TYPE STRING,
TP_ENDPER TYPE STRING,
TP_AVTYPE TYPE STRING,
TP_MAIN_ACCT TYPE STRING,
TP_SUB_ACCT TYPE STRING,
TP_BETC TYPE STRING,
REVACC_REFID TYPE STRING,
REVACC_REFTYPE TYPE STRING,
REF_DOC_CA_LONG TYPE STRING,
INCOTERMSV TYPE STRING,
INCOTERMS2L TYPE STRING,
INCOTERMS3L TYPE STRING,
MATERIAL_LONG TYPE STRING,
PR_REF_MAT_LONG TYPE STRING,
MAT_ENTRD_LONG TYPE STRING,
PO_QUAN TYPE STRING,
PO_UNIT TYPE STRING,
REQ_SEG_LONG TYPE STRING,
TXS_BUSINESS_TRANSACTION TYPE STRING,
TXS_MATERIAL_USAGE TYPE STRING,
TXS_USAGE_PURPOSE TYPE STRING,END OF T_EKKO_STR. DATA: WA_BAPISDITM_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_BAPISDITM_STR-ITM_NUMBER sy-vline
WA_BAPISDITM_STR-HG_LV_ITEM sy-vline
WA_BAPISDITM_STR-PO_ITM_NO sy-vline
WA_BAPISDITM_STR-MATERIAL sy-vline
WA_BAPISDITM_STR-ALT_TO_ITM sy-vline
WA_BAPISDITM_STR-CUST_MAT22 sy-vline
WA_BAPISDITM_STR-BATCH sy-vline
WA_BAPISDITM_STR-DLV_GROUP sy-vline
WA_BAPISDITM_STR-PART_DLV sy-vline
WA_BAPISDITM_STR-REASON_REJ sy-vline
WA_BAPISDITM_STR-BILL_BLOCK sy-vline
WA_BAPISDITM_STR-BILL_DATE sy-vline
WA_BAPISDITM_STR-PLANT sy-vline
WA_BAPISDITM_STR-STORE_LOC sy-vline
WA_BAPISDITM_STR-TARGET_QTY sy-vline
WA_BAPISDITM_STR-TARGET_QU sy-vline
WA_BAPISDITM_STR-T_UNIT_ISO sy-vline
WA_BAPISDITM_STR-ITEM_CATEG sy-vline
WA_BAPISDITM_STR-SHORT_TEXT sy-vline
WA_BAPISDITM_STR-PRC_GROUP1 sy-vline
WA_BAPISDITM_STR-PRC_GROUP2 sy-vline
WA_BAPISDITM_STR-PRC_GROUP3 sy-vline
WA_BAPISDITM_STR-PRC_GROUP4 sy-vline
WA_BAPISDITM_STR-PRC_GROUP5 sy-vline
WA_BAPISDITM_STR-PROD_HIERA sy-vline
WA_BAPISDITM_STR-MATL_GROUP sy-vline
WA_BAPISDITM_STR-PURCH_NO_C sy-vline
WA_BAPISDITM_STR-PURCH_DATE sy-vline
WA_BAPISDITM_STR-PO_METHOD sy-vline
WA_BAPISDITM_STR-REF_1 sy-vline
WA_BAPISDITM_STR-PURCH_NO_S sy-vline
WA_BAPISDITM_STR-PO_DAT_S sy-vline
WA_BAPISDITM_STR-PO_METH_S sy-vline
WA_BAPISDITM_STR-REF_1_S sy-vline
WA_BAPISDITM_STR-POITM_NO_S sy-vline
WA_BAPISDITM_STR-PRICE_GRP sy-vline
WA_BAPISDITM_STR-CUST_GROUP sy-vline
WA_BAPISDITM_STR-SALES_DIST sy-vline
WA_BAPISDITM_STR-PRICE_LIST sy-vline
WA_BAPISDITM_STR-INCOTERMS1 sy-vline
WA_BAPISDITM_STR-INCOTERMS2 sy-vline
WA_BAPISDITM_STR-ORDCOMP_IN sy-vline
WA_BAPISDITM_STR-BILL_SCHED sy-vline
WA_BAPISDITM_STR-INVO_SCHED sy-vline
WA_BAPISDITM_STR-MN_INVOICE sy-vline
WA_BAPISDITM_STR-EX_RATE_FI sy-vline
WA_BAPISDITM_STR-ADD_VAL_DY sy-vline
WA_BAPISDITM_STR-FIX_VAL_DY sy-vline
WA_BAPISDITM_STR-PMNTTRMS sy-vline
WA_BAPISDITM_STR-PYMT_METH sy-vline
WA_BAPISDITM_STR-ACCNT_ASGN sy-vline
WA_BAPISDITM_STR-EXCHG_RATE sy-vline
WA_BAPISDITM_STR-PRICE_DATE sy-vline
WA_BAPISDITM_STR-SERV_DATE sy-vline
WA_BAPISDITM_STR-DUNN_KEY sy-vline
WA_BAPISDITM_STR-DUNN_BLOCK sy-vline
WA_BAPISDITM_STR-PROMOTION sy-vline
WA_BAPISDITM_STR-PMTGAR_PRO sy-vline
WA_BAPISDITM_STR-DOC_NUM_FI sy-vline
WA_BAPISDITM_STR-DEPARTM_NO sy-vline
WA_BAPISDITM_STR-REC_POINT sy-vline
WA_BAPISDITM_STR-CSTCNDGRP1 sy-vline
WA_BAPISDITM_STR-CSTCNDGRP2 sy-vline
WA_BAPISDITM_STR-CSTCNDGRP3 sy-vline
WA_BAPISDITM_STR-CSTCNDGRP4 sy-vline
WA_BAPISDITM_STR-CSTCNDGRP5 sy-vline
WA_BAPISDITM_STR-DLV_TIME sy-vline
WA_BAPISDITM_STR-SALES_UNIT sy-vline
WA_BAPISDITM_STR-S_UNIT_ISO sy-vline
WA_BAPISDITM_STR-TRG_QTY_NO sy-vline
WA_BAPISDITM_STR-TRGQTY_DEN sy-vline
WA_BAPISDITM_STR-RNDDLV_QTY sy-vline
WA_BAPISDITM_STR-MAXDEVAMNT sy-vline
WA_BAPISDITM_STR-MAXDEVPER sy-vline
WA_BAPISDITM_STR-MAXDEV_DAY sy-vline
WA_BAPISDITM_STR-USAGE_IND sy-vline
WA_BAPISDITM_STR-FIXED_QUAN sy-vline
WA_BAPISDITM_STR-UNLMT_DLV sy-vline
WA_BAPISDITM_STR-OVERDLVTOL sy-vline
WA_BAPISDITM_STR-UNDDLV_TOL sy-vline
WA_BAPISDITM_STR-DIVISION sy-vline
WA_BAPISDITM_STR-SALQTYNUM sy-vline
WA_BAPISDITM_STR-SALQTYDEN sy-vline
WA_BAPISDITM_STR-GROSS_WGHT sy-vline
WA_BAPISDITM_STR-NET_WEIGHT sy-vline
WA_BAPISDITM_STR-UNTOF_WGHT sy-vline
WA_BAPISDITM_STR-UNOF_WTISO sy-vline
WA_BAPISDITM_STR-VOLUME sy-vline
WA_BAPISDITM_STR-VOLUNIT sy-vline
WA_BAPISDITM_STR-VOLUNITISO sy-vline
WA_BAPISDITM_STR-DLV_PRIO sy-vline
WA_BAPISDITM_STR-SHIP_POINT sy-vline
WA_BAPISDITM_STR-ROUTE sy-vline
WA_BAPISDITM_STR-CREATED_BY sy-vline
WA_BAPISDITM_STR-TAX_CLASS1 sy-vline
WA_BAPISDITM_STR-TAX_CLASS2 sy-vline
WA_BAPISDITM_STR-TAX_CLASS3 sy-vline
WA_BAPISDITM_STR-TAX_CLASS4 sy-vline
WA_BAPISDITM_STR-TAX_CLASS5 sy-vline
WA_BAPISDITM_STR-TAX_CLASS6 sy-vline
WA_BAPISDITM_STR-TAX_CLASS7 sy-vline
WA_BAPISDITM_STR-TAX_CLASS8 sy-vline
WA_BAPISDITM_STR-TAX_CLASS9 sy-vline
WA_BAPISDITM_STR-MAT_PR_GRP sy-vline
WA_BAPISDITM_STR-VAL_TYPE sy-vline
WA_BAPISDITM_STR-FIXDAT_QTY sy-vline
WA_BAPISDITM_STR-BOMEXPL_NO sy-vline
WA_BAPISDITM_STR-RESANALKEY sy-vline
WA_BAPISDITM_STR-REQMTS_TYP sy-vline
WA_BAPISDITM_STR-NO_GR_POST sy-vline
WA_BAPISDITM_STR-BUS_TRANST sy-vline
WA_BAPISDITM_STR-OVERHD_KEY sy-vline
WA_BAPISDITM_STR-CSTG_SHEET sy-vline
WA_BAPISDITM_STR-MATFRGTGRP sy-vline
WA_BAPISDITM_STR-PLDLVSHDIN sy-vline
WA_BAPISDITM_STR-SEQ_NO sy-vline
WA_BAPISDITM_STR-BIL_FORM sy-vline
WA_BAPISDITM_STR-DLI_PROFIL sy-vline
WA_BAPISDITM_STR-REV_TYPE sy-vline
WA_BAPISDITM_STR-BEGDEM_PER sy-vline
WA_BAPISDITM_STR-PR_REF_MAT sy-vline
WA_BAPISDITM_STR-REFOBJTYPE sy-vline
WA_BAPISDITM_STR-REFOBJKEY sy-vline
WA_BAPISDITM_STR-REFLOGSYS sy-vline
WA_BAPISDITM_STR-ORDER_PROB sy-vline
WA_BAPISDITM_STR-MAX_PL_DLV sy-vline
WA_BAPISDITM_STR-CFOP_CODE sy-vline
WA_BAPISDITM_STR-TAXLAWICMS sy-vline
WA_BAPISDITM_STR-TAXLAWIPI sy-vline
WA_BAPISDITM_STR-SD_TAXCODE sy-vline
WA_BAPISDITM_STR-ASSORT_MOD sy-vline
WA_BAPISDITM_STR-COMP_QUANT sy-vline
WA_BAPISDITM_STR-TARGET_VAL sy-vline
WA_BAPISDITM_STR-CURRENCY sy-vline
WA_BAPISDITM_STR-CURR_ISO sy-vline
WA_BAPISDITM_STR-PROFIT_CTR sy-vline
WA_BAPISDITM_STR-ORDERID sy-vline
WA_BAPISDITM_STR-WBS_ELEM sy-vline
WA_BAPISDITM_STR-DEPREC_PER sy-vline
WA_BAPISDITM_STR-REF_DOC sy-vline
WA_BAPISDITM_STR-REF_DOC_IT sy-vline
WA_BAPISDITM_STR-REF_DOC_CA sy-vline
WA_BAPISDITM_STR-CUST_MAT35 sy-vline
WA_BAPISDITM_STR-EXCH_RATE_FI_V sy-vline
WA_BAPISDITM_STR-EXCHG_RATE_V sy-vline
WA_BAPISDITM_STR-ITEMGUID_ATP sy-vline
WA_BAPISDITM_STR-VAL_CONTR sy-vline
WA_BAPISDITM_STR-VAL_CON_I sy-vline
WA_BAPISDITM_STR-CONFIG_ID sy-vline
WA_BAPISDITM_STR-INST_ID sy-vline
WA_BAPISDITM_STR-MAT_EXT sy-vline
WA_BAPISDITM_STR-MAT_GUID sy-vline
WA_BAPISDITM_STR-MAT_VERS sy-vline
WA_BAPISDITM_STR-P_MAT_EXT sy-vline
WA_BAPISDITM_STR-P_MAT_GUID sy-vline
WA_BAPISDITM_STR-P_MAT_VERS sy-vline
WA_BAPISDITM_STR-FUNC_AREA sy-vline
WA_BAPISDITM_STR-ALTERN_BOM sy-vline
WA_BAPISDITM_STR-FKK_CONACCT sy-vline
WA_BAPISDITM_STR-EAN_UPC sy-vline
WA_BAPISDITM_STR-PRODCAT sy-vline
WA_BAPISDITM_STR-SHIP_TYPE sy-vline
WA_BAPISDITM_STR-S_PROC_IND sy-vline
WA_BAPISDITM_STR-FUNC_AREA_LONG sy-vline
WA_BAPISDITM_STR-BILL_REL sy-vline
WA_BAPISDITM_STR-VW_UEPOS sy-vline
WA_BAPISDITM_STR-CAMPAIGN sy-vline
WA_BAPISDITM_STR-DLVSCHDUSE sy-vline
WA_BAPISDITM_STR-CFOP_LONG sy-vline
WA_BAPISDITM_STR-SELECTION sy-vline
WA_BAPISDITM_STR-MAT_ENTRD sy-vline
WA_BAPISDITM_STR-LOG_SYSTEM_OWN sy-vline
WA_BAPISDITM_STR-ITM_TYPE_USAGE sy-vline
WA_BAPISDITM_STR-TAXLAWISS sy-vline
WA_BAPISDITM_STR-MAT_ENTRD_EXTERNAL sy-vline
WA_BAPISDITM_STR-MAT_ENTRD_GUID sy-vline
WA_BAPISDITM_STR-MAT_ENTRD_VERSION sy-vline
WA_BAPISDITM_STR-LOC_TAXCAT sy-vline
WA_BAPISDITM_STR-LOC_ZEROVAT sy-vline
WA_BAPISDITM_STR-LOC_ACTCODE sy-vline
WA_BAPISDITM_STR-LOC_DISTTYPE sy-vline
WA_BAPISDITM_STR-LOC_TXRELCLAS sy-vline
WA_BAPISDITM_STR-CALC_MOTIVE sy-vline
WA_BAPISDITM_STR-COMPREAS sy-vline
WA_BAPISDITM_STR-FUND sy-vline
WA_BAPISDITM_STR-FUNDS_CTR sy-vline
WA_BAPISDITM_STR-CMMT_ITEM sy-vline
WA_BAPISDITM_STR-GRANT_NBR sy-vline
WA_BAPISDITM_STR-BUDGET_PERIOD sy-vline
WA_BAPISDITM_STR-TAXLAWCOFINS sy-vline
WA_BAPISDITM_STR-TAXLAWPIS sy-vline
WA_BAPISDITM_STR-TREASURY_ACC_SYMBOL sy-vline
WA_BAPISDITM_STR-BUSINESS_EVENT_TCODE sy-vline
WA_BAPISDITM_STR-MODIFICATION_ALLOWED sy-vline
WA_BAPISDITM_STR-CANCELLATION_ALLOWED sy-vline
WA_BAPISDITM_STR-PAYMENT_METHODS sy-vline
WA_BAPISDITM_STR-BUSINESS_PARTNER_NO sy-vline
WA_BAPISDITM_STR-REPORTING_FREQ sy-vline
WA_BAPISDITM_STR-SEPA_MANDATE_ID sy-vline
WA_BAPISDITM_STR-REQ_SEGMENT sy-vline
WA_BAPISDITM_STR-TP_SUBLEVL sy-vline
WA_BAPISDITM_STR-TP_AGENCID sy-vline
WA_BAPISDITM_STR-TP_ALTRAID sy-vline
WA_BAPISDITM_STR-TP_BEGPER sy-vline
WA_BAPISDITM_STR-TP_ENDPER sy-vline
WA_BAPISDITM_STR-TP_AVTYPE sy-vline
WA_BAPISDITM_STR-TP_MAIN_ACCT sy-vline
WA_BAPISDITM_STR-TP_SUB_ACCT sy-vline
WA_BAPISDITM_STR-TP_BETC sy-vline
WA_BAPISDITM_STR-REVACC_REFID sy-vline
WA_BAPISDITM_STR-REVACC_REFTYPE sy-vline
WA_BAPISDITM_STR-REF_DOC_CA_LONG sy-vline
WA_BAPISDITM_STR-INCOTERMSV sy-vline
WA_BAPISDITM_STR-INCOTERMS2L sy-vline
WA_BAPISDITM_STR-INCOTERMS3L sy-vline
WA_BAPISDITM_STR-MATERIAL_LONG sy-vline
WA_BAPISDITM_STR-PR_REF_MAT_LONG sy-vline
WA_BAPISDITM_STR-MAT_ENTRD_LONG sy-vline
WA_BAPISDITM_STR-PO_QUAN sy-vline
WA_BAPISDITM_STR-PO_UNIT sy-vline
WA_BAPISDITM_STR-REQ_SEG_LONG sy-vline
WA_BAPISDITM_STR-TXS_BUSINESS_TRANSACTION sy-vline
WA_BAPISDITM_STR-TXS_MATERIAL_USAGE sy-vline
WA_BAPISDITM_STR-TXS_USAGE_PURPOSE sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.