ABAP Select data from SAP table TDS_CREDBLOCKDOC2 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 TDS_CREDBLOCKDOC2 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 TDS_CREDBLOCKDOC2. 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 TDS_CREDBLOCKDOC2 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_TDS_CREDBLOCKDOC2 TYPE STANDARD TABLE OF TDS_CREDBLOCKDOC2,
      WA_TDS_CREDBLOCKDOC2 TYPE TDS_CREDBLOCKDOC2,
      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: <TDS_CREDBLOCKDOC2> TYPE TDS_CREDBLOCKDOC2.

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

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

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM TDS_CREDBLOCKDOC2
*  INTO TABLE @DATA(IT_TDS_CREDBLOCKDOC22).
*--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_TDS_CREDBLOCKDOC2 INDEX 1 INTO DATA(WA_TDS_CREDBLOCKDOC22).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_TDS_CREDBLOCKDOC2 ASSIGNING <TDS_CREDBLOCKDOC2>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<TDS_CREDBLOCKDOC2>-PROCSTATUS = 1.
<TDS_CREDBLOCKDOC2>-MANDT = 1.
<TDS_CREDBLOCKDOC2>-KKBER = 1.
<TDS_CREDBLOCKDOC2>-VBELN = 1.
<TDS_CREDBLOCKDOC2>-POSNR = 1.
ENDLOOP.

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

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_TDS_CREDBLOCKDOC2-VBTYP, sy-vline,
WA_TDS_CREDBLOCKDOC2-VKORG, sy-vline,
WA_TDS_CREDBLOCKDOC2-VTWEG, sy-vline,
WA_TDS_CREDBLOCKDOC2-SPART, sy-vline,
WA_TDS_CREDBLOCKDOC2-KNKLI, sy-vline,
WA_TDS_CREDBLOCKDOC2-NAME1, sy-vline.
ENDLOOP. *Add any further fields from structure WA_TDS_CREDBLOCKDOC2 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_TDS_CREDBLOCKDOC2 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_TDS_CREDBLOCKDOC2 INTO WA_TDS_CREDBLOCKDOC2. *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 VBELN CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_TDS_CREDBLOCKDOC2-VBELN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_TDS_CREDBLOCKDOC2-VBELN.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

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

*Conversion exit AUART, internal->external for field AUART CALL FUNCTION 'CONVERSION_EXIT_AUART_OUTPUT' EXPORTING input = WA_TDS_CREDBLOCKDOC2-AUART IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_TDS_CREDBLOCKDOC2-AUART.
WRITE:/ 'New Value:', ld_input.

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

*Conversion exit PARVW, internal->external for field DISPZPAVW CALL FUNCTION 'CONVERSION_EXIT_PARVW_OUTPUT' EXPORTING input = WA_TDS_CREDBLOCKDOC2-DISPZPAVW IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_TDS_CREDBLOCKDOC2-DISPZPAVW.
WRITE:/ 'New Value:', ld_input.

*Conversion exit PARVW, internal->external for field ZPAVW CALL FUNCTION 'CONVERSION_EXIT_PARVW_OUTPUT' EXPORTING input = WA_TDS_CREDBLOCKDOC2-ZPAVW IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_TDS_CREDBLOCKDOC2-ZPAVW.
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_TDS_CREDBLOCKDOC2_STR,
PROCSTATUS TYPE STRING,
MANDT TYPE STRING,
KKBER TYPE STRING,
VBELN TYPE STRING,
POSNR TYPE STRING,
VBTYP TYPE STRING,
VKORG TYPE STRING,
VTWEG TYPE STRING,
SPART TYPE STRING,
KNKLI TYPE STRING,
NAME1 TYPE STRING,
ORT01 TYPE STRING,
LAND TYPE STRING,
ADRNR TYPE STRING,
ERDAT TYPE STRING,
ERNAM TYPE STRING,
BNAME TYPE STRING,
TELF1 TYPE STRING,
GRUPP TYPE STRING,
SBGRP TYPE STRING,
CTLPC TYPE STRING,
CMWAE TYPE STRING,
CMFRE TYPE STRING,
CMNUP TYPE STRING,
CMNGV TYPE STRING,
CMPRE TYPE STRING,
CMTFG TYPE STRING,
CMPNT TYPE STRING,
CMKUA TYPE STRING,
AMTBL TYPE STRING,
KLPRZ TYPE STRING,
KWKKB TYPE STRING,
KWKKC TYPE STRING,
KWKKD TYPE STRING,
KWKKE TYPE STRING,
OEIKW TYPE STRING,
OLIKW TYPE STRING,
OFAKW TYPE STRING,
WAERS TYPE STRING,
AWAER TYPE STRING,
ZTERM TYPE STRING,
CSTAT TYPE STRING,
CMPSA TYPE STRING,
CMPSB TYPE STRING,
CMPSC TYPE STRING,
CMPSD TYPE STRING,
CMPSE TYPE STRING,
CMPSF TYPE STRING,
CMPSG TYPE STRING,
CMPSH TYPE STRING,
CMPSI TYPE STRING,
CMPSJ TYPE STRING,
CMPSK TYPE STRING,
CMPSL TYPE STRING,
CMPSM TYPE STRING,
CMPS0 TYPE STRING,
CMPS1 TYPE STRING,
CMPS2 TYPE STRING,
CMGST TYPE STRING,
SKFOR TYPE STRING,
SSOBL TYPE STRING,
CRBLB TYPE STRING,
NXTRV TYPE STRING,
KRAUS TYPE STRING,
DBPAY TYPE STRING,
DBRTG TYPE STRING,
REVDB TYPE STRING,
AEDAT TYPE STRING,
AETXT TYPE STRING,
ZAEHL TYPE STRING,
SELKZ TYPE STRING,
ACTIV TYPE STRING,
KLIMK TYPE STRING,
BSTNK TYPE STRING,
SIZEC TYPE STRING,
GBSTK TYPE STRING,
WBSTK TYPE STRING,
WAERK TYPE STRING,
NETWR TYPE STRING,
CRMGR TYPE STRING,
TAGEF TYPE STRING,
KWKKF TYPE STRING,
KWKKG TYPE STRING,
LCNUM TYPE STRING,
KUNAG TYPE STRING,
VKBUR TYPE STRING,
VKGRP TYPE STRING,
AUST1 TYPE STRING,
AUST2 TYPE STRING,
AUST3 TYPE STRING,
AUST5 TYPE STRING,
AUST1TXT TYPE STRING,
AUST2TXT TYPE STRING,
AUST3TXT TYPE STRING,
AGNAME1 TYPE STRING,
AGORT01 TYPE STRING,
AGADRNR TYPE STRING,
VBKLA TYPE STRING,
VSTEL TYPE STRING,
CMPS_CM TYPE STRING,
DUMMY TYPE STRING,
CMPS_TE TYPE STRING,
ABGRU_NEW TYPE STRING,
SBGRP_NEW TYPE STRING,
ABGRU_READONLY TYPE STRING,
AUART TYPE STRING,
AUARTT TYPE STRING,
VBTYP_T TYPE STRING,
VDATU TYPE STRING,
TRVOG TYPE STRING,
TRVOGT TYPE STRING,
AUDAT TYPE STRING,
AUTLF TYPE STRING,
AUGRU TYPE STRING,
AUGRUT TYPE STRING,
VSBED TYPE STRING,
VSBEDT TYPE STRING,
GBSTKT TYPE STRING,
VSART TYPE STRING,
TRATY TYPE STRING,
TRMTYP TYPE STRING,
INCO1 TYPE STRING,
INCO2 TYPE STRING,
BSARK TYPE STRING,
BSTDK TYPE STRING,
DISPZPAVW TYPE STRING,
PZPERS_T TYPE STRING,
PARVW_T TYPE STRING,
ZPAVW TYPE STRING,
ZPERS TYPE STRING,END OF T_EKKO_STR. DATA: WA_TDS_CREDBLOCKDOC2_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_TDS_CREDBLOCKDOC2_STR-PROCSTATUS sy-vline
WA_TDS_CREDBLOCKDOC2_STR-MANDT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KKBER sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VBELN sy-vline
WA_TDS_CREDBLOCKDOC2_STR-POSNR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VBTYP sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VKORG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VTWEG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SPART sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KNKLI sy-vline
WA_TDS_CREDBLOCKDOC2_STR-NAME1 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ORT01 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-LAND sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ADRNR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ERDAT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ERNAM sy-vline
WA_TDS_CREDBLOCKDOC2_STR-BNAME sy-vline
WA_TDS_CREDBLOCKDOC2_STR-TELF1 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-GRUPP sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SBGRP sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CTLPC sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMWAE sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMFRE sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMNUP sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMNGV sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPRE sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMTFG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPNT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMKUA sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AMTBL sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KLPRZ sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KWKKB sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KWKKC sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KWKKD sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KWKKE sy-vline
WA_TDS_CREDBLOCKDOC2_STR-OEIKW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-OLIKW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-OFAKW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-WAERS sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AWAER sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ZTERM sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CSTAT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSA sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSB sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSC sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSD sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSE sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSF sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSH sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSI sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSJ sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSL sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPSM sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPS0 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPS1 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPS2 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMGST sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SKFOR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SSOBL sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CRBLB sy-vline
WA_TDS_CREDBLOCKDOC2_STR-NXTRV sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KRAUS sy-vline
WA_TDS_CREDBLOCKDOC2_STR-DBPAY sy-vline
WA_TDS_CREDBLOCKDOC2_STR-DBRTG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-REVDB sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AEDAT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AETXT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ZAEHL sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SELKZ sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ACTIV sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KLIMK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-BSTNK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SIZEC sy-vline
WA_TDS_CREDBLOCKDOC2_STR-GBSTK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-WBSTK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-WAERK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-NETWR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CRMGR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-TAGEF sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KWKKF sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KWKKG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-LCNUM sy-vline
WA_TDS_CREDBLOCKDOC2_STR-KUNAG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VKBUR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VKGRP sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST1 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST2 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST3 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST5 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST1TXT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST2TXT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUST3TXT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AGNAME1 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AGORT01 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AGADRNR sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VBKLA sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VSTEL sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPS_CM sy-vline
WA_TDS_CREDBLOCKDOC2_STR-DUMMY sy-vline
WA_TDS_CREDBLOCKDOC2_STR-CMPS_TE sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ABGRU_NEW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-SBGRP_NEW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ABGRU_READONLY sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUART sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUARTT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VBTYP_T sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VDATU sy-vline
WA_TDS_CREDBLOCKDOC2_STR-TRVOG sy-vline
WA_TDS_CREDBLOCKDOC2_STR-TRVOGT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUDAT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUTLF sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUGRU sy-vline
WA_TDS_CREDBLOCKDOC2_STR-AUGRUT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VSBED sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VSBEDT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-GBSTKT sy-vline
WA_TDS_CREDBLOCKDOC2_STR-VSART sy-vline
WA_TDS_CREDBLOCKDOC2_STR-TRATY sy-vline
WA_TDS_CREDBLOCKDOC2_STR-TRMTYP sy-vline
WA_TDS_CREDBLOCKDOC2_STR-INCO1 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-INCO2 sy-vline
WA_TDS_CREDBLOCKDOC2_STR-BSARK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-BSTDK sy-vline
WA_TDS_CREDBLOCKDOC2_STR-DISPZPAVW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-PZPERS_T sy-vline
WA_TDS_CREDBLOCKDOC2_STR-PARVW_T sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ZPAVW sy-vline
WA_TDS_CREDBLOCKDOC2_STR-ZPERS sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.