ABAP Select data from SAP table /ACCGO/OE_S_SO_HEADERX_API 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 /ACCGO/OE_S_SO_HEADERX_API 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 /ACCGO/OE_S_SO_HEADERX_API. 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 /ACCGO/OE_S_SO_HEADERX_API 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_/ACCGO/OE_S_SO_HEADERX_API TYPE STANDARD TABLE OF /ACCGO/OE_S_SO_HEADERX_API, WA_/ACCGO/OE_S_SO_HEADERX_API TYPE /ACCGO/OE_S_SO_HEADERX_API, 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: </ACCGO/OE_S_SO_HEADERX_API> TYPE /ACCGO/OE_S_SO_HEADERX_API. *Process all fields in table header/work area as string values PERFORM process_as_string_field_values CHANGING wa_/ACCGO/OE_S_SO_HEADERX_API. SELECT * *restrict ABAP select to first 10 rows UP TO 10 ROWS FROM /ACCGO/OE_S_SO_HEADERX_API INTO TABLE IT_/ACCGO/OE_S_SO_HEADERX_API. *Select data and declare internal table using in-line method @DATA *SELECT * * FROM /ACCGO/OE_S_SO_HEADERX_API * INTO TABLE @DATA(IT_/ACCGO/OE_S_SO_HEADERX_API2). *--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_/ACCGO/OE_S_SO_HEADERX_API INDEX 1 INTO DATA(WA_/ACCGO/OE_S_SO_HEADERX_API2). *Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL LOOP AT IT_/ACCGO/OE_S_SO_HEADERX_API ASSIGNING </ACCGO/OE_S_SO_HEADERX_API>.*To update a field value using a field symbol simply change the value via the field symbol pointer
</ACCGO/OE_S_SO_HEADERX_API>-UPDATEFLAG = 1.
</ACCGO/OE_S_SO_HEADERX_API>-DOC_TYPE = 1.
</ACCGO/OE_S_SO_HEADERX_API>-COLLECT_NO = 1.
</ACCGO/OE_S_SO_HEADERX_API>-SALES_ORG = 1.
</ACCGO/OE_S_SO_HEADERX_API>-DISTR_CHAN = 1.
ENDLOOP. LOOP AT IT_/ACCGO/OE_S_SO_HEADERX_API INTO WA_/ACCGO/OE_S_SO_HEADERX_API. *Write horizonal line to screen report. WRITE:/ sy-uline. *Write selected data to screen/report before conversion. WRITE:/ sy-vline, WA_/ACCGO/OE_S_SO_HEADERX_API-DIVISION, sy-vline,
WA_/ACCGO/OE_S_SO_HEADERX_API-SALES_GRP, sy-vline,
WA_/ACCGO/OE_S_SO_HEADERX_API-SALES_OFF, sy-vline,
WA_/ACCGO/OE_S_SO_HEADERX_API-REQ_DATE_H, sy-vline,
WA_/ACCGO/OE_S_SO_HEADERX_API-DATE_TYPE, sy-vline,
WA_/ACCGO/OE_S_SO_HEADERX_API-PURCH_DATE, sy-vline.
ENDLOOP. *Add any further fields from structure WA_/ACCGO/OE_S_SO_HEADERX_API 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_/ACCGO/OE_S_SO_HEADERX_API 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_/ACCGO/OE_S_SO_HEADERX_API INTO WA_/ACCGO/OE_S_SO_HEADERX_API. *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.
ENDFORM. *&---------------------------------------------------------------------* *& Form process_as_string_field_values *&---------------------------------------------------------------------* FORM process_as_string_field_values CHANGING p_EKKO LIKE wa_EKKO. TYPES: BEGIN OF T_/ACCGO/OE_S_SO_HEADERX_API_STR,
UPDATEFLAG TYPE STRING,
DOC_TYPE TYPE STRING,
COLLECT_NO TYPE STRING,
SALES_ORG TYPE STRING,
DISTR_CHAN TYPE STRING,
DIVISION TYPE STRING,
SALES_GRP TYPE STRING,
SALES_OFF TYPE STRING,
REQ_DATE_H TYPE STRING,
DATE_TYPE TYPE STRING,
PURCH_DATE TYPE STRING,
PO_METHOD TYPE STRING,
PO_SUPPLEM TYPE STRING,
REF_1 TYPE STRING,
NAME TYPE STRING,
TELEPHONE TYPE STRING,
PRICE_GRP TYPE STRING,
CUST_GROUP TYPE STRING,
SALES_DIST TYPE STRING,
PRICE_LIST TYPE STRING,
INCOTERMS1 TYPE STRING,
INCOTERMS2 TYPE STRING,
PMNTTRMS TYPE STRING,
DLV_BLOCK TYPE STRING,
BILL_BLOCK TYPE STRING,
ORD_REASON TYPE STRING,
COMPL_DLV TYPE STRING,
PRICE_DATE TYPE STRING,
QT_VALID_F TYPE STRING,
QT_VALID_T TYPE STRING,
CT_VALID_F TYPE STRING,
CT_VALID_T TYPE STRING,
CUST_GRP1 TYPE STRING,
CUST_GRP2 TYPE STRING,
CUST_GRP3 TYPE STRING,
CUST_GRP4 TYPE STRING,
CUST_GRP5 TYPE STRING,
PURCH_NO_C TYPE STRING,
PURCH_NO_S TYPE STRING,
PO_DAT_S TYPE STRING,
PO_METH_S TYPE STRING,
REF_1_S TYPE STRING,
SD_DOC_CAT TYPE STRING,
DOC_DATE TYPE STRING,
WAR_DATE TYPE STRING,
SHIP_COND TYPE STRING,
PP_SEARCH TYPE STRING,
DUN_COUNT TYPE STRING,
DUN_DATE TYPE STRING,
DLVSCHDUSE TYPE STRING,
PLDLVSTYP TYPE STRING,
REF_DOC TYPE STRING,
COMP_CDE_B TYPE STRING,
ALTTAX_CLS 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,
REF_DOC_L TYPE STRING,
ASS_NUMBER TYPE STRING,
REFDOC_CAT TYPE STRING,
ORDCOMB_IN TYPE STRING,
BILL_SCHED TYPE STRING,
INVO_SCHED TYPE STRING,
MN_INVOICE TYPE STRING,
EXRATE_FI TYPE STRING,
ADD_VAL_DY TYPE STRING,
FIX_VAL_DY TYPE STRING,
PYMT_METH TYPE STRING,
ACCNT_ASGN TYPE STRING,
EXCHG_RATE TYPE STRING,
BILL_DATE TYPE STRING,
SERV_DATE TYPE STRING,
DUNN_KEY TYPE STRING,
DUNN_BLOCK TYPE STRING,
PROMOTION TYPE STRING,
PMTGAR_PRO TYPE STRING,
DEPARTM_NO TYPE STRING,
REC_POINT TYPE STRING,
POITM_NO_S TYPE STRING,
DOC_NUM_FI TYPE STRING,
CSTCNDGRP1 TYPE STRING,
CSTCNDGRP2 TYPE STRING,
CSTCNDGRP3 TYPE STRING,
CSTCNDGRP4 TYPE STRING,
CSTCNDGRP5 TYPE STRING,
DLV_TIME TYPE STRING,
CURRENCY TYPE STRING,
TAXDEP_CTY TYPE STRING,
TAXDST_CTY TYPE STRING,
EUTRI_DEAL TYPE STRING,
MAST_CONTR TYPE STRING,
REF_PROC TYPE STRING,
CHKPRTAUTH TYPE STRING,
CMLQTY_DAT TYPE STRING,
VERSION TYPE STRING,
NOTIF_NO TYPE STRING,
WBS_ELEM TYPE STRING,
EXCH_RATE_FI_V TYPE STRING,
EXCHG_RATE_V TYPE STRING,
FKK_CONACCT TYPE STRING,
CAMPAIGN TYPE STRING,
DOC_CLASS TYPE STRING,
H_CURR TYPE STRING,
SHIP_TYPE TYPE STRING,
S_PROC_IND TYPE STRING,
LINE_TIME TYPE STRING,
CALC_MOTIVE TYPE STRING,
PSM_PSTNG_DATE 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,
SD_DOC_CAT_LONG TYPE STRING,
REFDOC_CAT_LONG TYPE STRING,
INCOTERMSV TYPE STRING,
INCOTERMS2L TYPE STRING,
INCOTERMS3L TYPE STRING,END OF T_EKKO_STR. DATA: WA_/ACCGO/OE_S_SO_HEADERX_API_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_/ACCGO/OE_S_SO_HEADERX_API_STR-UPDATEFLAG sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DOC_TYPE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-COLLECT_NO sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SALES_ORG sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DISTR_CHAN sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DIVISION sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SALES_GRP sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SALES_OFF sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REQ_DATE_H sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DATE_TYPE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PURCH_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PO_METHOD sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PO_SUPPLEM sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REF_1 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-NAME sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TELEPHONE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PRICE_GRP sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CUST_GROUP sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SALES_DIST sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PRICE_LIST sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-INCOTERMS1 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-INCOTERMS2 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PMNTTRMS sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DLV_BLOCK sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-BILL_BLOCK sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-ORD_REASON sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-COMPL_DLV sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PRICE_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-QT_VALID_F sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-QT_VALID_T sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CT_VALID_F sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CT_VALID_T sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CUST_GRP1 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CUST_GRP2 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CUST_GRP3 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CUST_GRP4 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CUST_GRP5 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PURCH_NO_C sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PURCH_NO_S sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PO_DAT_S sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PO_METH_S sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REF_1_S sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SD_DOC_CAT sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DOC_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-WAR_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SHIP_COND sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PP_SEARCH sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DUN_COUNT sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DUN_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DLVSCHDUSE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PLDLVSTYP sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REF_DOC sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-COMP_CDE_B sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-ALTTAX_CLS sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS2 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS3 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS4 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS5 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS6 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS7 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS8 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAX_CLASS9 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REF_DOC_L sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-ASS_NUMBER sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REFDOC_CAT sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-ORDCOMB_IN sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-BILL_SCHED sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-INVO_SCHED sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-MN_INVOICE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-EXRATE_FI sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-ADD_VAL_DY sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-FIX_VAL_DY sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PYMT_METH sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-ACCNT_ASGN sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-EXCHG_RATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-BILL_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SERV_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DUNN_KEY sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DUNN_BLOCK sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PROMOTION sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PMTGAR_PRO sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DEPARTM_NO sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REC_POINT sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-POITM_NO_S sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DOC_NUM_FI sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CSTCNDGRP1 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CSTCNDGRP2 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CSTCNDGRP3 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CSTCNDGRP4 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CSTCNDGRP5 sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DLV_TIME sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CURRENCY sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAXDEP_CTY sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TAXDST_CTY sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-EUTRI_DEAL sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-MAST_CONTR sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REF_PROC sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CHKPRTAUTH sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CMLQTY_DAT sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-VERSION sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-NOTIF_NO sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-WBS_ELEM sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-EXCH_RATE_FI_V sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-EXCHG_RATE_V sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-FKK_CONACCT sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CAMPAIGN sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-DOC_CLASS sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-H_CURR sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SHIP_TYPE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-S_PROC_IND sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-LINE_TIME sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CALC_MOTIVE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PSM_PSTNG_DATE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-TREASURY_ACC_SYMBOL sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-BUSINESS_EVENT_TCODE sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-MODIFICATION_ALLOWED sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-CANCELLATION_ALLOWED sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-PAYMENT_METHODS sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-BUSINESS_PARTNER_NO sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REPORTING_FREQ sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SEPA_MANDATE_ID sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-SD_DOC_CAT_LONG sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-REFDOC_CAT_LONG sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-INCOTERMSV sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-INCOTERMS2L sy-vline
WA_/ACCGO/OE_S_SO_HEADERX_API_STR-INCOTERMS3L sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.