ABAP Select data from SAP table IWBSWITHVERS 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 IWBSWITHVERS 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 IWBSWITHVERS. 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 IWBSWITHVERS 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_IWBSWITHVERS TYPE STANDARD TABLE OF IWBSWITHVERS,
      WA_IWBSWITHVERS TYPE IWBSWITHVERS,
      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: <IWBSWITHVERS> TYPE IWBSWITHVERS.

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

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

*Select data and declare internal table using in-line method @DATA
*SELECT *
*  FROM IWBSWITHVERS
*  INTO TABLE @DATA(IT_IWBSWITHVERS2).
*--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_IWBSWITHVERS INDEX 1 INTO DATA(WA_IWBSWITHVERS2).


*Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL
LOOP AT IT_IWBSWITHVERS ASSIGNING <IWBSWITHVERS>.
*To update a field value using a field symbol simply change the value via the field symbol pointer
<IWBSWITHVERS>-MANDT = 1.
<IWBSWITHVERS>-WBSELEMENT = 1.
<IWBSWITHVERS>-VERSION = 1.
<IWBSWITHVERS>-WBSELEMENTWITHCODINGMASK = 1.
<IWBSWITHVERS>-ISPROJECTVERSIONOBJECT = 1.
ENDLOOP.

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

*Write selected data to screen/report before conversion.
  WRITE:/ sy-vline,   WA_IWBSWITHVERS-WBSELEMENTINTERNALID, sy-vline,
WA_IWBSWITHVERS-WBSELEMENTHIERARCHYLEVEL, sy-vline,
WA_IWBSWITHVERS-OVERHEADCODE, sy-vline,
WA_IWBSWITHVERS-RESULTANALYSISINTERNALID, sy-vline,
WA_IWBSWITHVERS-WBSELEMENTOBJECT, sy-vline,
WA_IWBSWITHVERS-WBSDESCRIPTION, sy-vline.
ENDLOOP. *Add any further fields from structure WA_IWBSWITHVERS 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_IWBSWITHVERS 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_IWBSWITHVERS INTO WA_IWBSWITHVERS. *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 ABPSP, internal->external for field WBSELEMENTINTERNALID CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT' EXPORTING input = WA_IWBSWITHVERS-WBSELEMENTINTERNALID IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_IWBSWITHVERS-WBSELEMENTINTERNALID.
WRITE:/ 'New Value:', ld_input.

*Conversion exit KONPD, internal->external for field PROJECTINTERNALID CALL FUNCTION 'CONVERSION_EXIT_KONPD_OUTPUT' EXPORTING input = WA_IWBSWITHVERS-PROJECTINTERNALID IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_IWBSWITHVERS-PROJECTINTERNALID.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

*Conversion exit TPLNR, internal->external for field FUNCTIONALLOCATION CALL FUNCTION 'CONVERSION_EXIT_TPLNR_OUTPUT' EXPORTING input = WA_IWBSWITHVERS-FUNCTIONALLOCATION IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_IWBSWITHVERS-FUNCTIONALLOCATION.
WRITE:/ 'New Value:', ld_input.

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

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

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

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

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

*Conversion exit CUNIT, internal->external for field FREEDEFINEDQUANTITY2UNIT CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_IWBSWITHVERS-FREEDEFINEDQUANTITY2UNIT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_IWBSWITHVERS-FREEDEFINEDQUANTITY2UNIT.
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_IWBSWITHVERS_STR,
MANDT TYPE STRING,
WBSELEMENT TYPE STRING,
VERSION TYPE STRING,
WBSELEMENTWITHCODINGMASK TYPE STRING,
ISPROJECTVERSIONOBJECT TYPE STRING,
WBSELEMENTINTERNALID TYPE STRING,
WBSELEMENTHIERARCHYLEVEL TYPE STRING,
OVERHEADCODE TYPE STRING,
RESULTANALYSISINTERNALID TYPE STRING,
WBSELEMENTOBJECT TYPE STRING,
WBSDESCRIPTION TYPE STRING,
PROJECTINTERNALID TYPE STRING,
PROJECT TYPE STRING,
RESPONSIBLEPERSON TYPE STRING,
RESPONSIBLEPERSONNAME TYPE STRING,
CREATEDBYUSER TYPE STRING,
CREATIONDATE TYPE STRING,
LASTCHANGEDBYUSER TYPE STRING,
LASTCHANGEDATE TYPE STRING,
APPLICANTCODE TYPE STRING,
APPLICANTNAME TYPE STRING,
PROJECTTYPE TYPE STRING,
WBSELEMENTISPLANNINGELEMENT TYPE STRING,
WBSISACCOUNTASSIGNMENTELEMENT TYPE STRING,
WBSELEMENTISBILLINGELEMENT TYPE STRING,
COSTINGSHEET TYPE STRING,
PRIORITYCODE TYPE STRING,
COMPANYCODE TYPE STRING,
BUSINESSAREA TYPE STRING,
CONTROLLINGAREA TYPE STRING,
REQGCOSTCENTERCONTROLLINGAREA TYPE STRING,
REQUESTINGCOSTCENTER TYPE STRING,
RESPCOSTCENTERCONTROLLINGAREA TYPE STRING,
RESPONSIBLECOSTCENTER TYPE STRING,
PLANT TYPE STRING,
PROFITCENTER TYPE STRING,
CONTROLLINGOBJECTCLASS TYPE STRING,
BASICSTARTDATE TYPE STRING,
BASICENDDATE TYPE STRING,
FORECASTEDSTARTDATE TYPE STRING,
FORECASTEDENDDATE TYPE STRING,
ACTUALSTARTDATE TYPE STRING,
ACTUALENDDATE TYPE STRING,
SCHEDLDBASICEARLIESTSTARTDATE TYPE STRING,
SCHEDLDBASICEARLIESTENDDATE TYPE STRING,
SCHEDLDBASICLATESTSTARTDATE TYPE STRING,
SCHEDULEDBASICLATESTENDDATE TYPE STRING,
TENTATIVEACTUALSTARTDATE TYPE STRING,
TENTATIVEACTUALENDDATE TYPE STRING,
SCHEDLDFCSTDEARLIESTSTARTDATE TYPE STRING,
SCHEDLDFCSTDEARLIESTENDDATE TYPE STRING,
LATESTSCHEDLDFCSTDSTARTDATE TYPE STRING,
LATESTSCHEDLDFCSTDENDDATE TYPE STRING,
ISMARKEDFORDELETION TYPE STRING,
WBSISMARKEDFORINTEGRATEDPLNG TYPE STRING,
WBSISSTATISTICALWBSELEMENT TYPE STRING,
TAXJURISDICTION TYPE STRING,
FUNCTIONALAREA TYPE STRING,
CURRENCY TYPE STRING,
FACTORYCALENDAR TYPE STRING,
CONCATENATEDACTIVESYSTSTSNAME TYPE STRING,
CONCATENATEDACTIVEUSERSTSNAME TYPE STRING,
LOCATION TYPE STRING,
EQUIPMENT TYPE STRING,
FUNCTIONALLOCATION TYPE STRING,
PROJECTOBJECTCHANGENUMBER TYPE STRING,
PROJECTOBJECTREFERENCEELEMENT TYPE STRING,
PROGRESSANLYSAGGREGATIONWEIGHT TYPE STRING,
PROJINTERESTCALCPROFILE TYPE STRING,
INVESTMENTPROFILE TYPE STRING,
FORECASTEDDURATION TYPE STRING,
FORECASTEDDURATIONUNIT TYPE STRING,
ACTUALDURATION TYPE STRING,
BASICDURATION TYPE STRING,
BASICDURATIONUNIT TYPE STRING,
DUETOSTARTDAYS TYPE STRING,
DUETOENDDAYS TYPE STRING,
OVERDUETOSTARTDAYS TYPE STRING,
OVERDUETOENDDAYS TYPE STRING,
DUEDAYS TYPE STRING,
OVERDUEDAYS TYPE STRING,
COSTCENTER TYPE STRING,
FREEDEFINEDTABLEFIELDSEMANTIC TYPE STRING,
FREEDEFINEDATTRIBUTE01 TYPE STRING,
FREEDEFINEDATTRIBUTE02 TYPE STRING,
FREEDEFINEDATTRIBUTE03 TYPE STRING,
FREEDEFINEDATTRIBUTE04 TYPE STRING,
FREEDEFINEDQUANTITY1 TYPE STRING,
FREEDEFINEDQUANTITY1UNIT TYPE STRING,
FREEDEFINEDQUANTITY2 TYPE STRING,
FREEDEFINEDQUANTITY2UNIT TYPE STRING,
FREEDEFINEDAMOUNT1 TYPE STRING,
FREEDEFINEDAMOUNT1CURRENCY TYPE STRING,
FREEDEFINEDAMOUNT2 TYPE STRING,
FREEDEFINEDAMOUNT2CURRENCY TYPE STRING,
FREEDEFINEDDATE1 TYPE STRING,
FREEDEFINEDDATE2 TYPE STRING,
FREEDEFINEDINDICATOR1 TYPE STRING,
FREEDEFINEDINDICATOR2 TYPE STRING,END OF T_EKKO_STR. DATA: WA_IWBSWITHVERS_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_IWBSWITHVERS_STR-MANDT sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENT sy-vline
WA_IWBSWITHVERS_STR-VERSION sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENTWITHCODINGMASK sy-vline
WA_IWBSWITHVERS_STR-ISPROJECTVERSIONOBJECT sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENTINTERNALID sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENTHIERARCHYLEVEL sy-vline
WA_IWBSWITHVERS_STR-OVERHEADCODE sy-vline
WA_IWBSWITHVERS_STR-RESULTANALYSISINTERNALID sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENTOBJECT sy-vline
WA_IWBSWITHVERS_STR-WBSDESCRIPTION sy-vline
WA_IWBSWITHVERS_STR-PROJECTINTERNALID sy-vline
WA_IWBSWITHVERS_STR-PROJECT sy-vline
WA_IWBSWITHVERS_STR-RESPONSIBLEPERSON sy-vline
WA_IWBSWITHVERS_STR-RESPONSIBLEPERSONNAME sy-vline
WA_IWBSWITHVERS_STR-CREATEDBYUSER sy-vline
WA_IWBSWITHVERS_STR-CREATIONDATE sy-vline
WA_IWBSWITHVERS_STR-LASTCHANGEDBYUSER sy-vline
WA_IWBSWITHVERS_STR-LASTCHANGEDATE sy-vline
WA_IWBSWITHVERS_STR-APPLICANTCODE sy-vline
WA_IWBSWITHVERS_STR-APPLICANTNAME sy-vline
WA_IWBSWITHVERS_STR-PROJECTTYPE sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENTISPLANNINGELEMENT sy-vline
WA_IWBSWITHVERS_STR-WBSISACCOUNTASSIGNMENTELEMENT sy-vline
WA_IWBSWITHVERS_STR-WBSELEMENTISBILLINGELEMENT sy-vline
WA_IWBSWITHVERS_STR-COSTINGSHEET sy-vline
WA_IWBSWITHVERS_STR-PRIORITYCODE sy-vline
WA_IWBSWITHVERS_STR-COMPANYCODE sy-vline
WA_IWBSWITHVERS_STR-BUSINESSAREA sy-vline
WA_IWBSWITHVERS_STR-CONTROLLINGAREA sy-vline
WA_IWBSWITHVERS_STR-REQGCOSTCENTERCONTROLLINGAREA sy-vline
WA_IWBSWITHVERS_STR-REQUESTINGCOSTCENTER sy-vline
WA_IWBSWITHVERS_STR-RESPCOSTCENTERCONTROLLINGAREA sy-vline
WA_IWBSWITHVERS_STR-RESPONSIBLECOSTCENTER sy-vline
WA_IWBSWITHVERS_STR-PLANT sy-vline
WA_IWBSWITHVERS_STR-PROFITCENTER sy-vline
WA_IWBSWITHVERS_STR-CONTROLLINGOBJECTCLASS sy-vline
WA_IWBSWITHVERS_STR-BASICSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-BASICENDDATE sy-vline
WA_IWBSWITHVERS_STR-FORECASTEDSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-FORECASTEDENDDATE sy-vline
WA_IWBSWITHVERS_STR-ACTUALSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-ACTUALENDDATE sy-vline
WA_IWBSWITHVERS_STR-SCHEDLDBASICEARLIESTSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-SCHEDLDBASICEARLIESTENDDATE sy-vline
WA_IWBSWITHVERS_STR-SCHEDLDBASICLATESTSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-SCHEDULEDBASICLATESTENDDATE sy-vline
WA_IWBSWITHVERS_STR-TENTATIVEACTUALSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-TENTATIVEACTUALENDDATE sy-vline
WA_IWBSWITHVERS_STR-SCHEDLDFCSTDEARLIESTSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-SCHEDLDFCSTDEARLIESTENDDATE sy-vline
WA_IWBSWITHVERS_STR-LATESTSCHEDLDFCSTDSTARTDATE sy-vline
WA_IWBSWITHVERS_STR-LATESTSCHEDLDFCSTDENDDATE sy-vline
WA_IWBSWITHVERS_STR-ISMARKEDFORDELETION sy-vline
WA_IWBSWITHVERS_STR-WBSISMARKEDFORINTEGRATEDPLNG sy-vline
WA_IWBSWITHVERS_STR-WBSISSTATISTICALWBSELEMENT sy-vline
WA_IWBSWITHVERS_STR-TAXJURISDICTION sy-vline
WA_IWBSWITHVERS_STR-FUNCTIONALAREA sy-vline
WA_IWBSWITHVERS_STR-CURRENCY sy-vline
WA_IWBSWITHVERS_STR-FACTORYCALENDAR sy-vline
WA_IWBSWITHVERS_STR-CONCATENATEDACTIVESYSTSTSNAME sy-vline
WA_IWBSWITHVERS_STR-CONCATENATEDACTIVEUSERSTSNAME sy-vline
WA_IWBSWITHVERS_STR-LOCATION sy-vline
WA_IWBSWITHVERS_STR-EQUIPMENT sy-vline
WA_IWBSWITHVERS_STR-FUNCTIONALLOCATION sy-vline
WA_IWBSWITHVERS_STR-PROJECTOBJECTCHANGENUMBER sy-vline
WA_IWBSWITHVERS_STR-PROJECTOBJECTREFERENCEELEMENT sy-vline
WA_IWBSWITHVERS_STR-PROGRESSANLYSAGGREGATIONWEIGHT sy-vline
WA_IWBSWITHVERS_STR-PROJINTERESTCALCPROFILE sy-vline
WA_IWBSWITHVERS_STR-INVESTMENTPROFILE sy-vline
WA_IWBSWITHVERS_STR-FORECASTEDDURATION sy-vline
WA_IWBSWITHVERS_STR-FORECASTEDDURATIONUNIT sy-vline
WA_IWBSWITHVERS_STR-ACTUALDURATION sy-vline
WA_IWBSWITHVERS_STR-BASICDURATION sy-vline
WA_IWBSWITHVERS_STR-BASICDURATIONUNIT sy-vline
WA_IWBSWITHVERS_STR-DUETOSTARTDAYS sy-vline
WA_IWBSWITHVERS_STR-DUETOENDDAYS sy-vline
WA_IWBSWITHVERS_STR-OVERDUETOSTARTDAYS sy-vline
WA_IWBSWITHVERS_STR-OVERDUETOENDDAYS sy-vline
WA_IWBSWITHVERS_STR-DUEDAYS sy-vline
WA_IWBSWITHVERS_STR-OVERDUEDAYS sy-vline
WA_IWBSWITHVERS_STR-COSTCENTER sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDTABLEFIELDSEMANTIC sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDATTRIBUTE01 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDATTRIBUTE02 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDATTRIBUTE03 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDATTRIBUTE04 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDQUANTITY1 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDQUANTITY1UNIT sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDQUANTITY2 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDQUANTITY2UNIT sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDAMOUNT1 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDAMOUNT1CURRENCY sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDAMOUNT2 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDAMOUNT2CURRENCY sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDDATE1 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDDATE2 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDINDICATOR1 sy-vline
WA_IWBSWITHVERS_STR-FREEDEFINEDINDICATOR2 sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.