ABAP Select data from SAP table BAPIACGL02 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 BAPIACGL02 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 BAPIACGL02. 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 BAPIACGL02 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_BAPIACGL02 TYPE STANDARD TABLE OF BAPIACGL02,
      WA_BAPIACGL02 TYPE BAPIACGL02,
      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: <BAPIACGL02> TYPE BAPIACGL02.

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

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

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM BAPIACGL02
*  INTO TABLE @DATA(IT_BAPIACGL022).
*--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_BAPIACGL02 INDEX 1 INTO DATA(WA_BAPIACGL022).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_BAPIACGL02 ASSIGNING <BAPIACGL02>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<BAPIACGL02>-ITEMNO_ACC = 1.
<BAPIACGL02>-GL_ACCOUNT = 1.
<BAPIACGL02>-COMP_CODE = 1.
<BAPIACGL02>-PSTNG_DATE = 1.
<BAPIACGL02>-DOC_TYPE = 1.
ENDLOOP.

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

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_BAPIACGL02-AC_DOC_NO, sy-vline,
WA_BAPIACGL02-FISC_YEAR, sy-vline,
WA_BAPIACGL02-FIS_PERIOD, sy-vline,
WA_BAPIACGL02-LOG_PROC, sy-vline,
WA_BAPIACGL02-STAT_CON, sy-vline,
WA_BAPIACGL02-REF_KEY_1, sy-vline.
ENDLOOP. *Add any further fields from structure WA_BAPIACGL02 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_BAPIACGL02 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_BAPIACGL02 INTO WA_BAPIACGL02. *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 GL_ACCOUNT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIACGL02-GL_ACCOUNT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-GL_ACCOUNT.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

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

*Conversion exit ALPHA, internal->external for field ASSET_NO CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_BAPIACGL02-ASSET_NO IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-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_BAPIACGL02-SUB_NUMBER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-SUB_NUMBER.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*Conversion exit NUMCV, internal->external for field ACTIVITY CALL FUNCTION 'CONVERSION_EXIT_NUMCV_OUTPUT' EXPORTING input = WA_BAPIACGL02-ACTIVITY IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-ACTIVITY.
WRITE:/ 'New Value:', ld_input.

*Conversion exit MATNL, internal->external for field MATERIAL_EXTERNAL CALL FUNCTION 'CONVERSION_EXIT_MATNL_OUTPUT' EXPORTING input = WA_BAPIACGL02-MATERIAL_EXTERNAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-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_BAPIACGL02-MATERIAL_VERSION IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-MATERIAL_VERSION.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

*Conversion exit MATN1, internal->external for field MATERIAL_LONG CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_BAPIACGL02-MATERIAL_LONG IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_BAPIACGL02-MATERIAL_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_BAPIACGL02_STR,
ITEMNO_ACC TYPE STRING,
GL_ACCOUNT TYPE STRING,
COMP_CODE TYPE STRING,
PSTNG_DATE TYPE STRING,
DOC_TYPE TYPE STRING,
AC_DOC_NO TYPE STRING,
FISC_YEAR TYPE STRING,
FIS_PERIOD TYPE STRING,
LOG_PROC TYPE STRING,
STAT_CON TYPE STRING,
REF_KEY_1 TYPE STRING,
REF_KEY_2 TYPE STRING,
REF_KEY_3 TYPE STRING,
ACCT_KEY TYPE STRING,
ACCT_TYPE TYPE STRING,
CUSTOMER TYPE STRING,
VENDOR_NO TYPE STRING,
ITEM_TEXT TYPE STRING,
BUS_AREA TYPE STRING,
COSTCENTER TYPE STRING,
PO_PR_QNT TYPE STRING,
PO_PR_UOM TYPE STRING,
PO_PR_UOM_ISO TYPE STRING,
ORDERID TYPE STRING,
ASSET_NO TYPE STRING,
SUB_NUMBER TYPE STRING,
ASVAL_DATE TYPE STRING,
MATERIAL TYPE STRING,
QUANTITY TYPE STRING,
BASE_UOM TYPE STRING,
BASE_UOM_ISO TYPE STRING,
PLANT TYPE STRING,
TR_PART_BA TYPE STRING,
ORIG_GROUP TYPE STRING,
ORIG_MAT TYPE STRING,
COST_OBJ TYPE STRING,
PROFIT_CTR TYPE STRING,
PART_PRCTR TYPE STRING,
WBS_ELEMENT TYPE STRING,
NETWORK TYPE STRING,
ROUTING_NO TYPE STRING,
ORDER_ITNO TYPE STRING,
CMMT_ITEM TYPE STRING,
FUNDS_CTR TYPE STRING,
FUND TYPE STRING,
SALES_ORD TYPE STRING,
S_ORD_ITEM TYPE STRING,
TRADE_ID TYPE STRING,
VAL_AREA TYPE STRING,
VAL_TYPE TYPE STRING,
OBJ_TYP_P TYPE STRING,
OBJ_KEY_P TYPE STRING,
OBJ_POS_P TYPE STRING,
SERIAL_NO TYPE STRING,
PART_ACCT TYPE STRING,
MVT_IND TYPE STRING,
ITEM_CAT TYPE STRING,
REVAL_IND TYPE STRING,
MATL_TYPE TYPE STRING,
DIVISION TYPE STRING,
GROSS_WT TYPE STRING,
UNIT_OF_WT TYPE STRING,
UNIT_OF_WT_ISO TYPE STRING,
VOLUME TYPE STRING,
VOLUMEUNIT TYPE STRING,
VOLUMEUNIT_ISO TYPE STRING,
ENTRY_QNT TYPE STRING,
ENTRY_UOM TYPE STRING,
ENTRY_UOM_ISO TYPE STRING,
ACTTYPE TYPE STRING,
CO_BUSPROC TYPE STRING,
ACTIVITY TYPE STRING,
MATERIAL_EXTERNAL TYPE STRING,
MATERIAL_GUID TYPE STRING,
MATERIAL_VERSION TYPE STRING,
CMMT_ITEM_LONG TYPE STRING,
GRANT_NBR TYPE STRING,
FUNC_AREA_LONG TYPE STRING,
SEGMENT TYPE STRING,
PARTNER_SEGMENT TYPE STRING,
BUDGET_PERIOD TYPE STRING,
MATERIAL_LONG TYPE STRING,END OF T_EKKO_STR. DATA: WA_BAPIACGL02_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_BAPIACGL02_STR-ITEMNO_ACC sy-vline
WA_BAPIACGL02_STR-GL_ACCOUNT sy-vline
WA_BAPIACGL02_STR-COMP_CODE sy-vline
WA_BAPIACGL02_STR-PSTNG_DATE sy-vline
WA_BAPIACGL02_STR-DOC_TYPE sy-vline
WA_BAPIACGL02_STR-AC_DOC_NO sy-vline
WA_BAPIACGL02_STR-FISC_YEAR sy-vline
WA_BAPIACGL02_STR-FIS_PERIOD sy-vline
WA_BAPIACGL02_STR-LOG_PROC sy-vline
WA_BAPIACGL02_STR-STAT_CON sy-vline
WA_BAPIACGL02_STR-REF_KEY_1 sy-vline
WA_BAPIACGL02_STR-REF_KEY_2 sy-vline
WA_BAPIACGL02_STR-REF_KEY_3 sy-vline
WA_BAPIACGL02_STR-ACCT_KEY sy-vline
WA_BAPIACGL02_STR-ACCT_TYPE sy-vline
WA_BAPIACGL02_STR-CUSTOMER sy-vline
WA_BAPIACGL02_STR-VENDOR_NO sy-vline
WA_BAPIACGL02_STR-ITEM_TEXT sy-vline
WA_BAPIACGL02_STR-BUS_AREA sy-vline
WA_BAPIACGL02_STR-COSTCENTER sy-vline
WA_BAPIACGL02_STR-PO_PR_QNT sy-vline
WA_BAPIACGL02_STR-PO_PR_UOM sy-vline
WA_BAPIACGL02_STR-PO_PR_UOM_ISO sy-vline
WA_BAPIACGL02_STR-ORDERID sy-vline
WA_BAPIACGL02_STR-ASSET_NO sy-vline
WA_BAPIACGL02_STR-SUB_NUMBER sy-vline
WA_BAPIACGL02_STR-ASVAL_DATE sy-vline
WA_BAPIACGL02_STR-MATERIAL sy-vline
WA_BAPIACGL02_STR-QUANTITY sy-vline
WA_BAPIACGL02_STR-BASE_UOM sy-vline
WA_BAPIACGL02_STR-BASE_UOM_ISO sy-vline
WA_BAPIACGL02_STR-PLANT sy-vline
WA_BAPIACGL02_STR-TR_PART_BA sy-vline
WA_BAPIACGL02_STR-ORIG_GROUP sy-vline
WA_BAPIACGL02_STR-ORIG_MAT sy-vline
WA_BAPIACGL02_STR-COST_OBJ sy-vline
WA_BAPIACGL02_STR-PROFIT_CTR sy-vline
WA_BAPIACGL02_STR-PART_PRCTR sy-vline
WA_BAPIACGL02_STR-WBS_ELEMENT sy-vline
WA_BAPIACGL02_STR-NETWORK sy-vline
WA_BAPIACGL02_STR-ROUTING_NO sy-vline
WA_BAPIACGL02_STR-ORDER_ITNO sy-vline
WA_BAPIACGL02_STR-CMMT_ITEM sy-vline
WA_BAPIACGL02_STR-FUNDS_CTR sy-vline
WA_BAPIACGL02_STR-FUND sy-vline
WA_BAPIACGL02_STR-SALES_ORD sy-vline
WA_BAPIACGL02_STR-S_ORD_ITEM sy-vline
WA_BAPIACGL02_STR-TRADE_ID sy-vline
WA_BAPIACGL02_STR-VAL_AREA sy-vline
WA_BAPIACGL02_STR-VAL_TYPE sy-vline
WA_BAPIACGL02_STR-OBJ_TYP_P sy-vline
WA_BAPIACGL02_STR-OBJ_KEY_P sy-vline
WA_BAPIACGL02_STR-OBJ_POS_P sy-vline
WA_BAPIACGL02_STR-SERIAL_NO sy-vline
WA_BAPIACGL02_STR-PART_ACCT sy-vline
WA_BAPIACGL02_STR-MVT_IND sy-vline
WA_BAPIACGL02_STR-ITEM_CAT sy-vline
WA_BAPIACGL02_STR-REVAL_IND sy-vline
WA_BAPIACGL02_STR-MATL_TYPE sy-vline
WA_BAPIACGL02_STR-DIVISION sy-vline
WA_BAPIACGL02_STR-GROSS_WT sy-vline
WA_BAPIACGL02_STR-UNIT_OF_WT sy-vline
WA_BAPIACGL02_STR-UNIT_OF_WT_ISO sy-vline
WA_BAPIACGL02_STR-VOLUME sy-vline
WA_BAPIACGL02_STR-VOLUMEUNIT sy-vline
WA_BAPIACGL02_STR-VOLUMEUNIT_ISO sy-vline
WA_BAPIACGL02_STR-ENTRY_QNT sy-vline
WA_BAPIACGL02_STR-ENTRY_UOM sy-vline
WA_BAPIACGL02_STR-ENTRY_UOM_ISO sy-vline
WA_BAPIACGL02_STR-ACTTYPE sy-vline
WA_BAPIACGL02_STR-CO_BUSPROC sy-vline
WA_BAPIACGL02_STR-ACTIVITY sy-vline
WA_BAPIACGL02_STR-MATERIAL_EXTERNAL sy-vline
WA_BAPIACGL02_STR-MATERIAL_GUID sy-vline
WA_BAPIACGL02_STR-MATERIAL_VERSION sy-vline
WA_BAPIACGL02_STR-CMMT_ITEM_LONG sy-vline
WA_BAPIACGL02_STR-GRANT_NBR sy-vline
WA_BAPIACGL02_STR-FUNC_AREA_LONG sy-vline
WA_BAPIACGL02_STR-SEGMENT sy-vline
WA_BAPIACGL02_STR-PARTNER_SEGMENT sy-vline
WA_BAPIACGL02_STR-BUDGET_PERIOD sy-vline
WA_BAPIACGL02_STR-MATERIAL_LONG sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.