ABAP Select data from SAP table WCB_S_COND_LIST 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 WCB_S_COND_LIST 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 WCB_S_COND_LIST. 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 WCB_S_COND_LIST 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_WCB_S_COND_LIST TYPE STANDARD TABLE OF WCB_S_COND_LIST,
      WA_WCB_S_COND_LIST TYPE WCB_S_COND_LIST,
      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: <WCB_S_COND_LIST> TYPE WCB_S_COND_LIST.

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

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

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM WCB_S_COND_LIST
*  INTO TABLE @DATA(IT_WCB_S_COND_LIST2).
*--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_WCB_S_COND_LIST INDEX 1 INTO DATA(WA_WCB_S_COND_LIST2).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_WCB_S_COND_LIST ASSIGNING <WCB_S_COND_LIST>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<WCB_S_COND_LIST>-CLIENT = 1.
<WCB_S_COND_LIST>-NUM = 1.
<WCB_S_COND_LIST>-CONTRACT_TYPE = 1.
<WCB_S_COND_LIST>-VEND_OWNER = 1.
<WCB_S_COND_LIST>-CUST_OWNER = 1.
ENDLOOP.

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

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_WCB_S_COND_LIST-REFERENCE, sy-vline,
WA_WCB_S_COND_LIST-ASSIGNMENT, sy-vline,
WA_WCB_S_COND_LIST-EXT_PARTNER, sy-vline,
WA_WCB_S_COND_LIST-CREATED_BY, sy-vline,
WA_WCB_S_COND_LIST-CREATED_ON, sy-vline,
WA_WCB_S_COND_LIST-REC_TIME, sy-vline.
ENDLOOP. *Add any further fields from structure WA_WCB_S_COND_LIST 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_WCB_S_COND_LIST 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_WCB_S_COND_LIST INTO WA_WCB_S_COND_LIST. *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 NUM CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_WCB_S_COND_LIST-NUM IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_WCB_S_COND_LIST-NUM.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

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

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

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

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

*Conversion exit KOTAB, internal->external for field KOTABNR_D CALL FUNCTION 'CONVERSION_EXIT_KOTAB_OUTPUT' EXPORTING input = WA_WCB_S_COND_LIST-KOTABNR_D IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_WCB_S_COND_LIST-KOTABNR_D.
WRITE:/ 'New Value:', ld_input.

*Conversion exit CUNIT, internal->external for field KMEIN_D CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_WCB_S_COND_LIST-KMEIN_D IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_WCB_S_COND_LIST-KMEIN_D.
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_WCB_S_COND_LIST_STR,
CLIENT TYPE STRING,
NUM TYPE STRING,
CONTRACT_TYPE TYPE STRING,
VEND_OWNER TYPE STRING,
CUST_OWNER TYPE STRING,
REFERENCE TYPE STRING,
ASSIGNMENT TYPE STRING,
EXT_PARTNER TYPE STRING,
CREATED_BY TYPE STRING,
CREATED_ON TYPE STRING,
REC_TIME TYPE STRING,
EKORG TYPE STRING,
EKGRP TYPE STRING,
VKORG TYPE STRING,
VTWEG TYPE STRING,
SPART TYPE STRING,
ZTERM TYPE STRING,
ZBD1T TYPE STRING,
ZBD1P TYPE STRING,
ZBD2T TYPE STRING,
ZBD2P TYPE STRING,
ZBD3T TYPE STRING,
ZLSCH TYPE STRING,
GUID TYPE STRING,
DEACT TYPE STRING,
DATE_FROM TYPE STRING,
DATE_TO TYPE STRING,
ZONLO TYPE STRING,
EXT_NUM TYPE STRING,
CC_CURR TYPE STRING,
RATE TYPE STRING,
RATE_DATE TYPE STRING,
RATE_TYPE TYPE STRING,
VKGRP TYPE STRING,
VKBUR TYPE STRING,
ACCESS_TYPE TYPE STRING,
SETTL_MATNR TYPE STRING,
SETTL_TYPE_VEND TYPE STRING,
SETTL_CAL_FINAL TYPE STRING,
SETTL_CAL_PART TYPE STRING,
BUKRS TYPE STRING,
SETTL_TYPE_CUST TYPE STRING,
CH_NAME TYPE STRING,
CH_DATE TYPE STRING,
CH_TIME TYPE STRING,
EXTENSION_CAL TYPE STRING,
PRED_CC TYPE STRING,
CATEGORY TYPE STRING,
CC_PURPOSE TYPE STRING,
EXT_REF_CAT TYPE STRING,
EXT_REF TYPE STRING,
KOLIF TYPE STRING,
SETTL_CAL_DELTA TYPE STRING,
BVTAB_GROUP TYPE STRING,
SETTL_CAL_ACCR TYPE STRING,
AF_GROUP TYPE STRING,
SETTL_MEINS TYPE STRING,
SETTL_GEWEI TYPE STRING,
SETTL_VOLEH TYPE STRING,
SETTL_PUNEI TYPE STRING,
ACCRUALS_UPD_REQ TYPE STRING,
SETTL_CAL_ACCR_ROLLO TYPE STRING,
_DATAAGING TYPE STRING,
CREATED_ON_TSTMP TYPE STRING,
CH_TSTMP TYPE STRING,
STCEG TYPE STRING,
PERSON_OWNER TYPE STRING,
AFSC_GROUP TYPE STRING,
TAX_COUNTRY TYPE STRING,
PROCESS_VARIANT TYPE STRING,
EXT_REF_ITEM TYPE STRING,
COCO_DET_REL_CONTR TYPE STRING,
TAX_REPORTING_COUNTRY TYPE STRING,
SETTL_VARIANT TYPE STRING,
OWNER_TYPE TYPE STRING,
PROCESS_CATEGORY TYPE STRING,
REBATE_TYPE TYPE STRING,
SDM_VERSION TYPE STRING,
DUMMY_WCOCOH_INCL_EEW_PS TYPE STRING,
EXT_GUID TYPE STRING,
BEZEI_VEND_OWNER_GT TYPE STRING,
NAME1_VEND_GT TYPE STRING,
BEZEI_CUST_OWNER_GT TYPE STRING,
NAME1_CUST_GT TYPE STRING,
SYS_STATUS1_GT TYPE STRING,
SYS_STATUS2_GT TYPE STRING,
SYS_STATUS3_GT TYPE STRING,
SYS_STATUS4_GT TYPE STRING,
SYS_STATUS5_GT TYPE STRING,
USER_STATUS1_GT TYPE STRING,
USER_STATUS2_GT TYPE STRING,
USER_STATUS3_GT TYPE STRING,
BEZEI_KOLIF_GT TYPE STRING,
NAME1_KOLIF_GT TYPE STRING,
UI_CHANGE_GT TYPE STRING,
CONTRACT_SIDE_GT TYPE STRING,
NAME_PERSON_OWNER_GT TYPE STRING,
PROCESS_VARIANT_TEXT_GT TYPE STRING,
SELKZ TYPE STRING,
DATAB_K TYPE STRING,
DATBI_K TYPE STRING,
KNUMH_D TYPE STRING,
KOTABNR_D TYPE STRING,
KAPPL_D TYPE STRING,
KSCHL_D TYPE STRING,
KSCHL_TEXT_D TYPE STRING,
KRECH_D TYPE STRING,
KBETR_OUT_D TYPE STRING,
KONWA_D TYPE STRING,
KPEIN_D TYPE STRING,
KMEIN_D TYPE STRING,
VTEXT_D TYPE STRING,
KZNEP_D TYPE STRING,
ZTERM_D TYPE STRING,
LOEVM_KO_D TYPE STRING,
KZBZG_D TYPE STRING,
SCALE_S TYPE STRING,
SCALE_UNIT_S TYPE STRING,END OF T_EKKO_STR. DATA: WA_WCB_S_COND_LIST_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_WCB_S_COND_LIST_STR-CLIENT sy-vline
WA_WCB_S_COND_LIST_STR-NUM sy-vline
WA_WCB_S_COND_LIST_STR-CONTRACT_TYPE sy-vline
WA_WCB_S_COND_LIST_STR-VEND_OWNER sy-vline
WA_WCB_S_COND_LIST_STR-CUST_OWNER sy-vline
WA_WCB_S_COND_LIST_STR-REFERENCE sy-vline
WA_WCB_S_COND_LIST_STR-ASSIGNMENT sy-vline
WA_WCB_S_COND_LIST_STR-EXT_PARTNER sy-vline
WA_WCB_S_COND_LIST_STR-CREATED_BY sy-vline
WA_WCB_S_COND_LIST_STR-CREATED_ON sy-vline
WA_WCB_S_COND_LIST_STR-REC_TIME sy-vline
WA_WCB_S_COND_LIST_STR-EKORG sy-vline
WA_WCB_S_COND_LIST_STR-EKGRP sy-vline
WA_WCB_S_COND_LIST_STR-VKORG sy-vline
WA_WCB_S_COND_LIST_STR-VTWEG sy-vline
WA_WCB_S_COND_LIST_STR-SPART sy-vline
WA_WCB_S_COND_LIST_STR-ZTERM sy-vline
WA_WCB_S_COND_LIST_STR-ZBD1T sy-vline
WA_WCB_S_COND_LIST_STR-ZBD1P sy-vline
WA_WCB_S_COND_LIST_STR-ZBD2T sy-vline
WA_WCB_S_COND_LIST_STR-ZBD2P sy-vline
WA_WCB_S_COND_LIST_STR-ZBD3T sy-vline
WA_WCB_S_COND_LIST_STR-ZLSCH sy-vline
WA_WCB_S_COND_LIST_STR-GUID sy-vline
WA_WCB_S_COND_LIST_STR-DEACT sy-vline
WA_WCB_S_COND_LIST_STR-DATE_FROM sy-vline
WA_WCB_S_COND_LIST_STR-DATE_TO sy-vline
WA_WCB_S_COND_LIST_STR-ZONLO sy-vline
WA_WCB_S_COND_LIST_STR-EXT_NUM sy-vline
WA_WCB_S_COND_LIST_STR-CC_CURR sy-vline
WA_WCB_S_COND_LIST_STR-RATE sy-vline
WA_WCB_S_COND_LIST_STR-RATE_DATE sy-vline
WA_WCB_S_COND_LIST_STR-RATE_TYPE sy-vline
WA_WCB_S_COND_LIST_STR-VKGRP sy-vline
WA_WCB_S_COND_LIST_STR-VKBUR sy-vline
WA_WCB_S_COND_LIST_STR-ACCESS_TYPE sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_MATNR sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_TYPE_VEND sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_CAL_FINAL sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_CAL_PART sy-vline
WA_WCB_S_COND_LIST_STR-BUKRS sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_TYPE_CUST sy-vline
WA_WCB_S_COND_LIST_STR-CH_NAME sy-vline
WA_WCB_S_COND_LIST_STR-CH_DATE sy-vline
WA_WCB_S_COND_LIST_STR-CH_TIME sy-vline
WA_WCB_S_COND_LIST_STR-EXTENSION_CAL sy-vline
WA_WCB_S_COND_LIST_STR-PRED_CC sy-vline
WA_WCB_S_COND_LIST_STR-CATEGORY sy-vline
WA_WCB_S_COND_LIST_STR-CC_PURPOSE sy-vline
WA_WCB_S_COND_LIST_STR-EXT_REF_CAT sy-vline
WA_WCB_S_COND_LIST_STR-EXT_REF sy-vline
WA_WCB_S_COND_LIST_STR-KOLIF sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_CAL_DELTA sy-vline
WA_WCB_S_COND_LIST_STR-BVTAB_GROUP sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_CAL_ACCR sy-vline
WA_WCB_S_COND_LIST_STR-AF_GROUP sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_MEINS sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_GEWEI sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_VOLEH sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_PUNEI sy-vline
WA_WCB_S_COND_LIST_STR-ACCRUALS_UPD_REQ sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_CAL_ACCR_ROLLO sy-vline
WA_WCB_S_COND_LIST_STR-_DATAAGING sy-vline
WA_WCB_S_COND_LIST_STR-CREATED_ON_TSTMP sy-vline
WA_WCB_S_COND_LIST_STR-CH_TSTMP sy-vline
WA_WCB_S_COND_LIST_STR-STCEG sy-vline
WA_WCB_S_COND_LIST_STR-PERSON_OWNER sy-vline
WA_WCB_S_COND_LIST_STR-AFSC_GROUP sy-vline
WA_WCB_S_COND_LIST_STR-TAX_COUNTRY sy-vline
WA_WCB_S_COND_LIST_STR-PROCESS_VARIANT sy-vline
WA_WCB_S_COND_LIST_STR-EXT_REF_ITEM sy-vline
WA_WCB_S_COND_LIST_STR-COCO_DET_REL_CONTR sy-vline
WA_WCB_S_COND_LIST_STR-TAX_REPORTING_COUNTRY sy-vline
WA_WCB_S_COND_LIST_STR-SETTL_VARIANT sy-vline
WA_WCB_S_COND_LIST_STR-OWNER_TYPE sy-vline
WA_WCB_S_COND_LIST_STR-PROCESS_CATEGORY sy-vline
WA_WCB_S_COND_LIST_STR-REBATE_TYPE sy-vline
WA_WCB_S_COND_LIST_STR-SDM_VERSION sy-vline
WA_WCB_S_COND_LIST_STR-DUMMY_WCOCOH_INCL_EEW_PS sy-vline
WA_WCB_S_COND_LIST_STR-EXT_GUID sy-vline
WA_WCB_S_COND_LIST_STR-BEZEI_VEND_OWNER_GT sy-vline
WA_WCB_S_COND_LIST_STR-NAME1_VEND_GT sy-vline
WA_WCB_S_COND_LIST_STR-BEZEI_CUST_OWNER_GT sy-vline
WA_WCB_S_COND_LIST_STR-NAME1_CUST_GT sy-vline
WA_WCB_S_COND_LIST_STR-SYS_STATUS1_GT sy-vline
WA_WCB_S_COND_LIST_STR-SYS_STATUS2_GT sy-vline
WA_WCB_S_COND_LIST_STR-SYS_STATUS3_GT sy-vline
WA_WCB_S_COND_LIST_STR-SYS_STATUS4_GT sy-vline
WA_WCB_S_COND_LIST_STR-SYS_STATUS5_GT sy-vline
WA_WCB_S_COND_LIST_STR-USER_STATUS1_GT sy-vline
WA_WCB_S_COND_LIST_STR-USER_STATUS2_GT sy-vline
WA_WCB_S_COND_LIST_STR-USER_STATUS3_GT sy-vline
WA_WCB_S_COND_LIST_STR-BEZEI_KOLIF_GT sy-vline
WA_WCB_S_COND_LIST_STR-NAME1_KOLIF_GT sy-vline
WA_WCB_S_COND_LIST_STR-UI_CHANGE_GT sy-vline
WA_WCB_S_COND_LIST_STR-CONTRACT_SIDE_GT sy-vline
WA_WCB_S_COND_LIST_STR-NAME_PERSON_OWNER_GT sy-vline
WA_WCB_S_COND_LIST_STR-PROCESS_VARIANT_TEXT_GT sy-vline
WA_WCB_S_COND_LIST_STR-SELKZ sy-vline
WA_WCB_S_COND_LIST_STR-DATAB_K sy-vline
WA_WCB_S_COND_LIST_STR-DATBI_K sy-vline
WA_WCB_S_COND_LIST_STR-KNUMH_D sy-vline
WA_WCB_S_COND_LIST_STR-KOTABNR_D sy-vline
WA_WCB_S_COND_LIST_STR-KAPPL_D sy-vline
WA_WCB_S_COND_LIST_STR-KSCHL_D sy-vline
WA_WCB_S_COND_LIST_STR-KSCHL_TEXT_D sy-vline
WA_WCB_S_COND_LIST_STR-KRECH_D sy-vline
WA_WCB_S_COND_LIST_STR-KBETR_OUT_D sy-vline
WA_WCB_S_COND_LIST_STR-KONWA_D sy-vline
WA_WCB_S_COND_LIST_STR-KPEIN_D sy-vline
WA_WCB_S_COND_LIST_STR-KMEIN_D sy-vline
WA_WCB_S_COND_LIST_STR-VTEXT_D sy-vline
WA_WCB_S_COND_LIST_STR-KZNEP_D sy-vline
WA_WCB_S_COND_LIST_STR-ZTERM_D sy-vline
WA_WCB_S_COND_LIST_STR-LOEVM_KO_D sy-vline
WA_WCB_S_COND_LIST_STR-KZBZG_D sy-vline
WA_WCB_S_COND_LIST_STR-SCALE_S sy-vline
WA_WCB_S_COND_LIST_STR-SCALE_UNIT_S sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.