ABAP Select data from SAP table BAPIOIL2017_GM_ITM_SHOW_01 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 BAPIOIL2017_GM_ITM_SHOW_01 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 BAPIOIL2017_GM_ITM_SHOW_01. 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 BAPIOIL2017_GM_ITM_SHOW_01 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_BAPIOIL2017_GM_ITM_SHOW_01 TYPE STANDARD TABLE OF BAPIOIL2017_GM_ITM_SHOW_01, WA_BAPIOIL2017_GM_ITM_SHOW_01 TYPE BAPIOIL2017_GM_ITM_SHOW_01, 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: <BAPIOIL2017_GM_ITM_SHOW_01> TYPE BAPIOIL2017_GM_ITM_SHOW_01. *Process all fields in table header/work area as string values PERFORM process_as_string_field_values CHANGING wa_BAPIOIL2017_GM_ITM_SHOW_01. SELECT * *restrict ABAP select to first 10 rows UP TO 10 ROWS FROM BAPIOIL2017_GM_ITM_SHOW_01 INTO TABLE IT_BAPIOIL2017_GM_ITM_SHOW_01. *Select data and declare internal table using in-line method @DATA *SELECT * * FROM BAPIOIL2017_GM_ITM_SHOW_01 * INTO TABLE @DATA(IT_BAPIOIL2017_GM_ITM_SHOW_012). *--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_BAPIOIL2017_GM_ITM_SHOW_01 INDEX 1 INTO DATA(WA_BAPIOIL2017_GM_ITM_SHOW_012). *Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL LOOP AT IT_BAPIOIL2017_GM_ITM_SHOW_01 ASSIGNING <BAPIOIL2017_GM_ITM_SHOW_01>.*To update a field value using a field symbol simply change the value via the field symbol pointer
<BAPIOIL2017_GM_ITM_SHOW_01>-MAT_DOC = 1.
<BAPIOIL2017_GM_ITM_SHOW_01>-DOC_YEAR = 1.
<BAPIOIL2017_GM_ITM_SHOW_01>-MATDOC_ITM = 1.
<BAPIOIL2017_GM_ITM_SHOW_01>-LINE_ID = 1.
<BAPIOIL2017_GM_ITM_SHOW_01>-PARENT_ID = 1.
ENDLOOP. LOOP AT IT_BAPIOIL2017_GM_ITM_SHOW_01 INTO WA_BAPIOIL2017_GM_ITM_SHOW_01. *Write horizonal line to screen report. WRITE:/ sy-uline. *Write selected data to screen/report before conversion. WRITE:/ sy-vline, WA_BAPIOIL2017_GM_ITM_SHOW_01-LINE_DEPTH, sy-vline,
WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL, sy-vline,
WA_BAPIOIL2017_GM_ITM_SHOW_01-PLANT, sy-vline,
WA_BAPIOIL2017_GM_ITM_SHOW_01-STGE_LOC, sy-vline,
WA_BAPIOIL2017_GM_ITM_SHOW_01-BATCH, sy-vline,
WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_TYPE, sy-vline.
ENDLOOP. *Add any further fields from structure WA_BAPIOIL2017_GM_ITM_SHOW_01 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_BAPIOIL2017_GM_ITM_SHOW_01 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_BAPIOIL2017_GM_ITM_SHOW_01 INTO WA_BAPIOIL2017_GM_ITM_SHOW_01. *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 MAT_DOC CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MAT_DOC IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MAT_DOC.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field DOC_YEAR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-DOC_YEAR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-DOC_YEAR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATN5, internal->external for field MATERIAL CALL FUNCTION 'CONVERSION_EXIT_MATN5_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field VENDOR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-VENDOR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-VENDOR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CUSTOMER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-CUSTOMER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-CUSTOMER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field SALES_ORD CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-SALES_ORD IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-SALES_ORD.
WRITE:/ 'New Value:', ld_input.
*Conversion exit CUNIT, internal->external for field ENTRY_UOM CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-ENTRY_UOM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-ENTRY_UOM.
WRITE:/ 'New Value:', ld_input.
*Conversion exit CUNIT, internal->external for field ORDERPR_UN CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-ORDERPR_UN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-ORDERPR_UN.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field PO_NUMBER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-PO_NUMBER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-PO_NUMBER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field COSTCENTER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-COSTCENTER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-COSTCENTER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field ORDERID CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-ORDERID IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-ORDERID.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field ASSET_NO CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-ASSET_NO IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-ASSET_NO.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field SUB_NUMBER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-SUB_NUMBER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-SUB_NUMBER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATN5, internal->external for field MOVE_MAT CALL FUNCTION 'CONVERSION_EXIT_MATN5_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT.
WRITE:/ 'New Value:', ld_input.
*Conversion exit IMKEY, internal->external for field RL_EST_KEY CALL FUNCTION 'CONVERSION_EXIT_IMKEY_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-RL_EST_KEY IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-RL_EST_KEY.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field PROFIT_CTR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-PROFIT_CTR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-PROFIT_CTR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ABPSN, internal->external for field WBS_ELEM CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-WBS_ELEM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-WBS_ELEM.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field NETWORK CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-NETWORK IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-NETWORK.
WRITE:/ 'New Value:', ld_input.
*Conversion exit NUMCV, internal->external for field ACTIVITY CALL FUNCTION 'CONVERSION_EXIT_NUMCV_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-ACTIVITY IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-ACTIVITY.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field PART_ACCT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-PART_ACCT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-PART_ACCT.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field REF_DOC_YR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-REF_DOC_YR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-REF_DOC_YR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field REF_DOC CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-REF_DOC IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-REF_DOC.
WRITE:/ 'New Value:', ld_input.
*Conversion exit FMCIS, internal->external for field CMMT_ITEM CALL FUNCTION 'CONVERSION_EXIT_FMCIS_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-CMMT_ITEM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-CMMT_ITEM.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field VAL_SALES_ORD CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-VAL_SALES_ORD IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-VAL_SALES_ORD.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ABPSN, internal->external for field VAL_WBS_ELEM CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-VAL_WBS_ELEM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-VAL_WBS_ELEM.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CO_BUSPROC CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-CO_BUSPROC IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-CO_BUSPROC.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field SUPPL_VEND CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-SUPPL_VEND IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-SUPPL_VEND.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATNL, internal->external for field MATERIAL_EXTERNAL CALL FUNCTION 'CONVERSION_EXIT_MATNL_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL_EXTERNAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL_EXTERNAL.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATNW, internal->external for field MATERIAL_VERSION CALL FUNCTION 'CONVERSION_EXIT_MATNW_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL_VERSION IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL_VERSION.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATNL, internal->external for field MOVE_MAT_EXTERNAL CALL FUNCTION 'CONVERSION_EXIT_MATNL_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT_EXTERNAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT_EXTERNAL.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATNW, internal->external for field MOVE_MAT_VERSION CALL FUNCTION 'CONVERSION_EXIT_MATNW_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT_VERSION IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT_VERSION.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field GRANT_NBR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-GRANT_NBR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-GRANT_NBR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit FMCIL, internal->external for field CMMT_ITEM_LONG CALL FUNCTION 'CONVERSION_EXIT_FMCIL_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-CMMT_ITEM_LONG IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-CMMT_ITEM_LONG.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATN1, internal->external for field MATERIAL_LONG CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL_LONG IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MATERIAL_LONG.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATN1, internal->external for field MOVE_MAT_LONG CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT_LONG IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIOIL2017_GM_ITM_SHOW_01-MOVE_MAT_LONG.
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_BAPIOIL2017_GM_ITM_SHOW_01_STR,
MAT_DOC TYPE STRING,
DOC_YEAR TYPE STRING,
MATDOC_ITM TYPE STRING,
LINE_ID TYPE STRING,
PARENT_ID TYPE STRING,
LINE_DEPTH TYPE STRING,
MATERIAL TYPE STRING,
PLANT TYPE STRING,
STGE_LOC TYPE STRING,
BATCH TYPE STRING,
MOVE_TYPE TYPE STRING,
STCK_TYPE TYPE STRING,
SPEC_STOCK TYPE STRING,
VENDOR TYPE STRING,
CUSTOMER TYPE STRING,
SALES_ORD TYPE STRING,
S_ORD_ITEM TYPE STRING,
SCHED_LINE TYPE STRING,
VAL_TYPE TYPE STRING,
ENTRY_QNT TYPE STRING,
ENTRY_UOM TYPE STRING,
ENTRY_UOM_ISO TYPE STRING,
PO_PR_QNT TYPE STRING,
ORDERPR_UN TYPE STRING,
ORDERPR_UN_ISO TYPE STRING,
PO_NUMBER TYPE STRING,
PO_ITEM TYPE STRING,
SHIPPING TYPE STRING,
COMP_SHIP TYPE STRING,
NO_MORE_GR TYPE STRING,
ITEM_TEXT TYPE STRING,
GR_RCPT TYPE STRING,
UNLOAD_PT TYPE STRING,
COSTCENTER TYPE STRING,
ORDERID TYPE STRING,
ORDER_ITNO TYPE STRING,
CALC_MOTIVE TYPE STRING,
ASSET_NO TYPE STRING,
SUB_NUMBER TYPE STRING,
RESERV_NO TYPE STRING,
RES_ITEM TYPE STRING,
RES_TYPE TYPE STRING,
WITHDRAWN TYPE STRING,
MOVE_MAT TYPE STRING,
MOVE_PLANT TYPE STRING,
MOVE_STLOC TYPE STRING,
MOVE_BATCH TYPE STRING,
MOVE_VAL_TYPE TYPE STRING,
MVT_IND TYPE STRING,
MOVE_REAS TYPE STRING,
RL_EST_KEY TYPE STRING,
REF_DATE TYPE STRING,
COST_OBJ TYPE STRING,
PROFIT_SEGM_NO TYPE STRING,
PROFIT_CTR TYPE STRING,
WBS_ELEM TYPE STRING,
NETWORK TYPE STRING,
ACTIVITY TYPE STRING,
PART_ACCT TYPE STRING,
AMOUNT_LC TYPE STRING,
AMOUNT_SV TYPE STRING,
CURRENCY TYPE STRING,
CURRENCY_ISO TYPE STRING,
REF_DOC_YR TYPE STRING,
REF_DOC TYPE STRING,
REF_DOC_IT TYPE STRING,
EXPIRYDATE TYPE STRING,
PROD_DATE TYPE STRING,
FUND TYPE STRING,
FUNDS_CTR TYPE STRING,
CMMT_ITEM TYPE STRING,
VAL_SALES_ORD TYPE STRING,
VAL_S_ORD_ITEM TYPE STRING,
VAL_WBS_ELEM TYPE STRING,
CO_BUSPROC TYPE STRING,
ACTTYPE TYPE STRING,
SUPPL_VEND TYPE STRING,
X_AUTO_CRE TYPE STRING,
MATERIAL_EXTERNAL TYPE STRING,
MATERIAL_GUID TYPE STRING,
MATERIAL_VERSION TYPE STRING,
MOVE_MAT_EXTERNAL TYPE STRING,
MOVE_MAT_GUID TYPE STRING,
MOVE_MAT_VERSION TYPE STRING,
GRANT_NBR TYPE STRING,
CMMT_ITEM_LONG TYPE STRING,
FUNC_AREA_LONG TYPE STRING,
MATERIAL_LONG TYPE STRING,
MOVE_MAT_LONG TYPE STRING,END OF T_EKKO_STR. DATA: WA_BAPIOIL2017_GM_ITM_SHOW_01_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_BAPIOIL2017_GM_ITM_SHOW_01_STR-MAT_DOC sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-DOC_YEAR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MATDOC_ITM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-LINE_ID sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PARENT_ID sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-LINE_DEPTH sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MATERIAL sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PLANT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-STGE_LOC sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-BATCH sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_TYPE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-STCK_TYPE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-SPEC_STOCK sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-VENDOR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CUSTOMER sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-SALES_ORD sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-S_ORD_ITEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-SCHED_LINE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-VAL_TYPE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ENTRY_QNT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ENTRY_UOM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ENTRY_UOM_ISO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PO_PR_QNT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ORDERPR_UN sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ORDERPR_UN_ISO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PO_NUMBER sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PO_ITEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-SHIPPING sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-COMP_SHIP sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-NO_MORE_GR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ITEM_TEXT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-GR_RCPT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-UNLOAD_PT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-COSTCENTER sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ORDERID sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ORDER_ITNO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CALC_MOTIVE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ASSET_NO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-SUB_NUMBER sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-RESERV_NO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-RES_ITEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-RES_TYPE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-WITHDRAWN sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_MAT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_PLANT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_STLOC sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_BATCH sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_VAL_TYPE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MVT_IND sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_REAS sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-RL_EST_KEY sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-REF_DATE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-COST_OBJ sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PROFIT_SEGM_NO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PROFIT_CTR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-WBS_ELEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-NETWORK sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ACTIVITY sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PART_ACCT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-AMOUNT_LC sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-AMOUNT_SV sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CURRENCY sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CURRENCY_ISO sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-REF_DOC_YR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-REF_DOC sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-REF_DOC_IT sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-EXPIRYDATE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-PROD_DATE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-FUND sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-FUNDS_CTR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CMMT_ITEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-VAL_SALES_ORD sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-VAL_S_ORD_ITEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-VAL_WBS_ELEM sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CO_BUSPROC sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-ACTTYPE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-SUPPL_VEND sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-X_AUTO_CRE sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MATERIAL_EXTERNAL sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MATERIAL_GUID sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MATERIAL_VERSION sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_MAT_EXTERNAL sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_MAT_GUID sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_MAT_VERSION sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-GRANT_NBR sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-CMMT_ITEM_LONG sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-FUNC_AREA_LONG sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MATERIAL_LONG sy-vline
WA_BAPIOIL2017_GM_ITM_SHOW_01_STR-MOVE_MAT_LONG sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.