ABAP Select data from SAP table CACMPNLNAVAL 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 CACMPNLNAVAL 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 CACMPNLNAVAL. 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 CACMPNLNAVAL 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_CACMPNLNAVAL TYPE STANDARD TABLE OF CACMPNLNAVAL, WA_CACMPNLNAVAL TYPE CACMPNLNAVAL, 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: <CACMPNLNAVAL> TYPE CACMPNLNAVAL. *Process all fields in table header/work area as string values PERFORM process_as_string_field_values CHANGING wa_CACMPNLNAVAL. SELECT * *restrict ABAP select to first 10 rows UP TO 10 ROWS FROM CACMPNLNAVAL INTO TABLE IT_CACMPNLNAVAL. *Select data and declare internal table using in-line method @DATA *SELECT * * FROM CACMPNLNAVAL * INTO TABLE @DATA(IT_CACMPNLNAVAL2). *--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_CACMPNLNAVAL INDEX 1 INTO DATA(WA_CACMPNLNAVAL2). *Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL LOOP AT IT_CACMPNLNAVAL ASSIGNING <CACMPNLNAVAL>.*To update a field value using a field symbol simply change the value via the field symbol pointer
<CACMPNLNAVAL>-MANDT = 1.
<CACMPNLNAVAL>-PRICINGKEY = 1.
<CACMPNLNAVAL>-EVALUATIONDATE = 1.
<CACMPNLNAVAL>-COMPARATIVEEVALUATIONDATE = 1.
<CACMPNLNAVAL>-COMPANYCODE = 1.
ENDLOOP. LOOP AT IT_CACMPNLNAVAL INTO WA_CACMPNLNAVAL. *Write horizonal line to screen report. WRITE:/ sy-uline. *Write selected data to screen/report before conversion. WRITE:/ sy-vline, WA_CACMPNLNAVAL-PROFITCENTER, sy-vline,
WA_CACMPNLNAVAL-PLANT, sy-vline,
WA_CACMPNLNAVAL-COMMODITY, sy-vline,
WA_CACMPNLNAVAL-PHYSICALCOMMODITY, sy-vline,
WA_CACMPNLNAVAL-MTMCALCULATIONGROUP, sy-vline,
WA_CACMPNLNAVAL-ORIGINREFERENCEDOCBUSOBJTYPE, sy-vline.
ENDLOOP. *Add any further fields from structure WA_CACMPNLNAVAL 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_CACMPNLNAVAL 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_CACMPNLNAVAL INTO WA_CACMPNLNAVAL. *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 PROFITCENTER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-PROFITCENTER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-PROFITCENTER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field ORIGINREFERENCEDOCUMENT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-ORIGINREFERENCEDOCUMENT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-ORIGINREFERENCEDOCUMENT.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field SOURCEDOCUMENT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-SOURCEDOCUMENT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-SOURCEDOCUMENT.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CONTRDRVTVCONTRMATURITYCODE CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-CONTRDRVTVCONTRMATURITYCODE IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-CONTRDRVTVCONTRMATURITYCODE.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field MKTDRVTVCONTRMATURITYCODE CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-MKTDRVTVCONTRMATURITYCODE IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-MKTDRVTVCONTRMATURITYCODE.
WRITE:/ 'New Value:', ld_input.
*Conversion exit CUNIT, internal->external for field COMMODITYUNIT CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-COMMODITYUNIT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-COMMODITYUNIT.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CREDITOR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-CREDITOR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-CREDITOR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field SOLDTOPARTY CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-SOLDTOPARTY IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-SOLDTOPARTY.
WRITE:/ 'New Value:', ld_input.
*Conversion exit MATN1, internal->external for field MATERIAL CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-MATERIAL IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-MATERIAL.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field REFERENCEDOCUMENT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_CACMPNLNAVAL-REFERENCEDOCUMENT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_CACMPNLNAVAL-REFERENCEDOCUMENT.
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_CACMPNLNAVAL_STR,
MANDT TYPE STRING,
PRICINGKEY TYPE STRING,
EVALUATIONDATE TYPE STRING,
COMPARATIVEEVALUATIONDATE TYPE STRING,
COMPANYCODE TYPE STRING,
PROFITCENTER TYPE STRING,
PLANT TYPE STRING,
COMMODITY TYPE STRING,
PHYSICALCOMMODITY TYPE STRING,
MTMCALCULATIONGROUP TYPE STRING,
ORIGINREFERENCEDOCBUSOBJTYPE TYPE STRING,
ORIGINREFERENCEDOCUMENT TYPE STRING,
ORIGINREFERENCEDOCUMENTITEM TYPE STRING,
CONDITIONTERMRATEFIXATION TYPE STRING,
CONTRACTCONDITIONTYPE TYPE STRING,
PNLEVENTGROUP TYPE STRING,
PNLEVENTCATEGORY TYPE STRING,
PNLEVENTTYPE TYPE STRING,
PNLELEMENTARYEVENTTYPE TYPE STRING,
SOURCEDOCUMENTBUSOBJTYPE TYPE STRING,
SOURCEDOCUMENT TYPE STRING,
SOURCEDOCUMENTITEM TYPE STRING,
CONDITIONTYPE TYPE STRING,
CONTRACTDCS TYPE STRING,
CONTRACTMARKETIDENTIFIERCODE TYPE STRING,
CONTRDRVTVCONTRMATURITYCODE TYPE STRING,
CONTRACTMATURITYKEYDATE TYPE STRING,
CONTRACTBASISTYPE TYPE STRING,
CONTRACTBASISID TYPE STRING,
CONTRACTQUOTATIONPRICETYPE TYPE STRING,
MARKETDCS TYPE STRING,
MKTMARKETIDENTIFIERCODE TYPE STRING,
MKTDRVTVCONTRMATURITYCODE TYPE STRING,
MKTMATURITYKEYDATE TYPE STRING,
MARKETBASISTYPE TYPE STRING,
MARKETBASISID TYPE STRING,
MKTQUOTATIONPRICETYPE TYPE STRING,
MTMDATASOURCETYPE TYPE STRING,
PRICINGSTATUS TYPE STRING,
VALIDITYSTARTDATE TYPE STRING,
VALIDITYSTARTDATETIME TYPE STRING,
HASERROR TYPE STRING,
SYSTEMMESSAGENUMBER TYPE STRING,
COMMODITYUNIT TYPE STRING,
CONDITIONTERMRATEQUANTITYUNIT TYPE STRING,
STATISTICSCURRENCY TYPE STRING,
PNLVALUE TYPE STRING,
SPREADPNLVALUE TYPE STRING,
COMMODITYQUANTITYINTERMUNIT TYPE STRING,
COMPARCMMDTYQUANTITYINTERMUNIT TYPE STRING,
PNLCALCULATIONRELEVANTQUANTITY TYPE STRING,
CONTRACTCONDITIONTERMRATE TYPE STRING,
COMPARCONTRCNDNTERMRATE TYPE STRING,
MARKETCONDITIONTERMRATE TYPE STRING,
CONTRSPREADCNDNTERMRATE TYPE STRING,
FIXEDMKTSPREADCNDNTERMRATE TYPE STRING,
FLOATINGMKTSPREADCNDNTERMRATE TYPE STRING,
CONTRACTMKTTODOCEXCHRATE TYPE STRING,
COMPARCONTRMKTTODOCEXCHRATE TYPE STRING,
CONTRDOCTOSTSTCEXCHRATE TYPE STRING,
COMPARCONTRDOCTOSTSTCEXCHRATE TYPE STRING,
MKTMARKETTODOCEXCHRATE TYPE STRING,
MKTDOCTOSTSTCEXCHRATE TYPE STRING,
MKTMARKETTOSTSTCEXCHRATE TYPE STRING,
SALESORGANIZATION TYPE STRING,
DISTRIBUTIONCHANNEL TYPE STRING,
DIVISION TYPE STRING,
CREDITOR TYPE STRING,
SOLDTOPARTY TYPE STRING,
MATERIAL TYPE STRING,
STORAGELOCATION TYPE STRING,
BATCH TYPE STRING,
INCOTERMSCLASSIFICATION TYPE STRING,
INCOTERMSTRANSFERLOCATION TYPE STRING,
CONDITIONAPPLICATION TYPE STRING,
REFERENCEDOCUMENT TYPE STRING,
REFERENCEDOCUMENTITEM TYPE STRING,
REFERENCEDOCBUSOBJTYPE TYPE STRING,
DELIVERYDATE TYPE STRING,
EXPECTEDPAYMENTDATE TYPE STRING,
DOCUMENTCURRENCY TYPE STRING,
BUSINESSAREA TYPE STRING,
PURCHASINGORGANIZATION TYPE STRING,
MATERIALGROUP TYPE STRING,
ISINTERCOMPANYTRANSFER TYPE STRING,
EXCHRATEMATURITYDATE TYPE STRING,
FIXEDEXCHRATEDATE TYPE STRING,
QUOTATIONPERIODREFERENCEDATE TYPE STRING,
QUOTATIONPERIODSTARTDATE TYPE STRING,
QUOTATIONPERIODENDDATE TYPE STRING,
QUOTATIONGROUP TYPE STRING,
QUOTATIONGROUPCALCULATIONRULE TYPE STRING,
CNDNTERMRATEFIXATIONDATE TYPE STRING,
CNDNTERMRATEFIXATIONTIME TYPE STRING,
CNDNTERMEXCHRATEFIXATIONDATE TYPE STRING,
CNDNTERMEXCHRATEFIXATIONTIME TYPE STRING,
MTMCONDITIONGROUPCATEGORY TYPE STRING,
MTMCONDITIONGROUP TYPE STRING,
MTMADJUSTMENTTYPE TYPE STRING,
MTMCALCGRPMARKETPRICECONDITION TYPE STRING,
PRICEISREALIZED TYPE STRING,
CONDITIONTERMRATECURRENCY TYPE STRING,
CONTRCONDITIONTERMRATECURRENCY TYPE STRING,END OF T_EKKO_STR. DATA: WA_CACMPNLNAVAL_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_CACMPNLNAVAL_STR-MANDT sy-vline
WA_CACMPNLNAVAL_STR-PRICINGKEY sy-vline
WA_CACMPNLNAVAL_STR-EVALUATIONDATE sy-vline
WA_CACMPNLNAVAL_STR-COMPARATIVEEVALUATIONDATE sy-vline
WA_CACMPNLNAVAL_STR-COMPANYCODE sy-vline
WA_CACMPNLNAVAL_STR-PROFITCENTER sy-vline
WA_CACMPNLNAVAL_STR-PLANT sy-vline
WA_CACMPNLNAVAL_STR-COMMODITY sy-vline
WA_CACMPNLNAVAL_STR-PHYSICALCOMMODITY sy-vline
WA_CACMPNLNAVAL_STR-MTMCALCULATIONGROUP sy-vline
WA_CACMPNLNAVAL_STR-ORIGINREFERENCEDOCBUSOBJTYPE sy-vline
WA_CACMPNLNAVAL_STR-ORIGINREFERENCEDOCUMENT sy-vline
WA_CACMPNLNAVAL_STR-ORIGINREFERENCEDOCUMENTITEM sy-vline
WA_CACMPNLNAVAL_STR-CONDITIONTERMRATEFIXATION sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTCONDITIONTYPE sy-vline
WA_CACMPNLNAVAL_STR-PNLEVENTGROUP sy-vline
WA_CACMPNLNAVAL_STR-PNLEVENTCATEGORY sy-vline
WA_CACMPNLNAVAL_STR-PNLEVENTTYPE sy-vline
WA_CACMPNLNAVAL_STR-PNLELEMENTARYEVENTTYPE sy-vline
WA_CACMPNLNAVAL_STR-SOURCEDOCUMENTBUSOBJTYPE sy-vline
WA_CACMPNLNAVAL_STR-SOURCEDOCUMENT sy-vline
WA_CACMPNLNAVAL_STR-SOURCEDOCUMENTITEM sy-vline
WA_CACMPNLNAVAL_STR-CONDITIONTYPE sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTDCS sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTMARKETIDENTIFIERCODE sy-vline
WA_CACMPNLNAVAL_STR-CONTRDRVTVCONTRMATURITYCODE sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTMATURITYKEYDATE sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTBASISTYPE sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTBASISID sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTQUOTATIONPRICETYPE sy-vline
WA_CACMPNLNAVAL_STR-MARKETDCS sy-vline
WA_CACMPNLNAVAL_STR-MKTMARKETIDENTIFIERCODE sy-vline
WA_CACMPNLNAVAL_STR-MKTDRVTVCONTRMATURITYCODE sy-vline
WA_CACMPNLNAVAL_STR-MKTMATURITYKEYDATE sy-vline
WA_CACMPNLNAVAL_STR-MARKETBASISTYPE sy-vline
WA_CACMPNLNAVAL_STR-MARKETBASISID sy-vline
WA_CACMPNLNAVAL_STR-MKTQUOTATIONPRICETYPE sy-vline
WA_CACMPNLNAVAL_STR-MTMDATASOURCETYPE sy-vline
WA_CACMPNLNAVAL_STR-PRICINGSTATUS sy-vline
WA_CACMPNLNAVAL_STR-VALIDITYSTARTDATE sy-vline
WA_CACMPNLNAVAL_STR-VALIDITYSTARTDATETIME sy-vline
WA_CACMPNLNAVAL_STR-HASERROR sy-vline
WA_CACMPNLNAVAL_STR-SYSTEMMESSAGENUMBER sy-vline
WA_CACMPNLNAVAL_STR-COMMODITYUNIT sy-vline
WA_CACMPNLNAVAL_STR-CONDITIONTERMRATEQUANTITYUNIT sy-vline
WA_CACMPNLNAVAL_STR-STATISTICSCURRENCY sy-vline
WA_CACMPNLNAVAL_STR-PNLVALUE sy-vline
WA_CACMPNLNAVAL_STR-SPREADPNLVALUE sy-vline
WA_CACMPNLNAVAL_STR-COMMODITYQUANTITYINTERMUNIT sy-vline
WA_CACMPNLNAVAL_STR-COMPARCMMDTYQUANTITYINTERMUNIT sy-vline
WA_CACMPNLNAVAL_STR-PNLCALCULATIONRELEVANTQUANTITY sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTCONDITIONTERMRATE sy-vline
WA_CACMPNLNAVAL_STR-COMPARCONTRCNDNTERMRATE sy-vline
WA_CACMPNLNAVAL_STR-MARKETCONDITIONTERMRATE sy-vline
WA_CACMPNLNAVAL_STR-CONTRSPREADCNDNTERMRATE sy-vline
WA_CACMPNLNAVAL_STR-FIXEDMKTSPREADCNDNTERMRATE sy-vline
WA_CACMPNLNAVAL_STR-FLOATINGMKTSPREADCNDNTERMRATE sy-vline
WA_CACMPNLNAVAL_STR-CONTRACTMKTTODOCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-COMPARCONTRMKTTODOCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-CONTRDOCTOSTSTCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-COMPARCONTRDOCTOSTSTCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-MKTMARKETTODOCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-MKTDOCTOSTSTCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-MKTMARKETTOSTSTCEXCHRATE sy-vline
WA_CACMPNLNAVAL_STR-SALESORGANIZATION sy-vline
WA_CACMPNLNAVAL_STR-DISTRIBUTIONCHANNEL sy-vline
WA_CACMPNLNAVAL_STR-DIVISION sy-vline
WA_CACMPNLNAVAL_STR-CREDITOR sy-vline
WA_CACMPNLNAVAL_STR-SOLDTOPARTY sy-vline
WA_CACMPNLNAVAL_STR-MATERIAL sy-vline
WA_CACMPNLNAVAL_STR-STORAGELOCATION sy-vline
WA_CACMPNLNAVAL_STR-BATCH sy-vline
WA_CACMPNLNAVAL_STR-INCOTERMSCLASSIFICATION sy-vline
WA_CACMPNLNAVAL_STR-INCOTERMSTRANSFERLOCATION sy-vline
WA_CACMPNLNAVAL_STR-CONDITIONAPPLICATION sy-vline
WA_CACMPNLNAVAL_STR-REFERENCEDOCUMENT sy-vline
WA_CACMPNLNAVAL_STR-REFERENCEDOCUMENTITEM sy-vline
WA_CACMPNLNAVAL_STR-REFERENCEDOCBUSOBJTYPE sy-vline
WA_CACMPNLNAVAL_STR-DELIVERYDATE sy-vline
WA_CACMPNLNAVAL_STR-EXPECTEDPAYMENTDATE sy-vline
WA_CACMPNLNAVAL_STR-DOCUMENTCURRENCY sy-vline
WA_CACMPNLNAVAL_STR-BUSINESSAREA sy-vline
WA_CACMPNLNAVAL_STR-PURCHASINGORGANIZATION sy-vline
WA_CACMPNLNAVAL_STR-MATERIALGROUP sy-vline
WA_CACMPNLNAVAL_STR-ISINTERCOMPANYTRANSFER sy-vline
WA_CACMPNLNAVAL_STR-EXCHRATEMATURITYDATE sy-vline
WA_CACMPNLNAVAL_STR-FIXEDEXCHRATEDATE sy-vline
WA_CACMPNLNAVAL_STR-QUOTATIONPERIODREFERENCEDATE sy-vline
WA_CACMPNLNAVAL_STR-QUOTATIONPERIODSTARTDATE sy-vline
WA_CACMPNLNAVAL_STR-QUOTATIONPERIODENDDATE sy-vline
WA_CACMPNLNAVAL_STR-QUOTATIONGROUP sy-vline
WA_CACMPNLNAVAL_STR-QUOTATIONGROUPCALCULATIONRULE sy-vline
WA_CACMPNLNAVAL_STR-CNDNTERMRATEFIXATIONDATE sy-vline
WA_CACMPNLNAVAL_STR-CNDNTERMRATEFIXATIONTIME sy-vline
WA_CACMPNLNAVAL_STR-CNDNTERMEXCHRATEFIXATIONDATE sy-vline
WA_CACMPNLNAVAL_STR-CNDNTERMEXCHRATEFIXATIONTIME sy-vline
WA_CACMPNLNAVAL_STR-MTMCONDITIONGROUPCATEGORY sy-vline
WA_CACMPNLNAVAL_STR-MTMCONDITIONGROUP sy-vline
WA_CACMPNLNAVAL_STR-MTMADJUSTMENTTYPE sy-vline
WA_CACMPNLNAVAL_STR-MTMCALCGRPMARKETPRICECONDITION sy-vline
WA_CACMPNLNAVAL_STR-PRICEISREALIZED sy-vline
WA_CACMPNLNAVAL_STR-CONDITIONTERMRATECURRENCY sy-vline
WA_CACMPNLNAVAL_STR-CONTRCONDITIONTERMRATECURRENCY sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.