ABAP Select data from SAP table EDOC_MX_SRC_RELATED_DOC_DATA 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 EDOC_MX_SRC_RELATED_DOC_DATA 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 EDOC_MX_SRC_RELATED_DOC_DATA. 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 EDOC_MX_SRC_RELATED_DOC_DATA 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_EDOC_MX_SRC_RELATED_DOC_DATA TYPE STANDARD TABLE OF EDOC_MX_SRC_RELATED_DOC_DATA, WA_EDOC_MX_SRC_RELATED_DOC_DATA TYPE EDOC_MX_SRC_RELATED_DOC_DATA, 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: <EDOC_MX_SRC_RELATED_DOC_DATA> TYPE EDOC_MX_SRC_RELATED_DOC_DATA. *Process all fields in table header/work area as string values PERFORM process_as_string_field_values CHANGING wa_EDOC_MX_SRC_RELATED_DOC_DATA. SELECT * *restrict ABAP select to first 10 rows UP TO 10 ROWS FROM EDOC_MX_SRC_RELATED_DOC_DATA INTO TABLE IT_EDOC_MX_SRC_RELATED_DOC_DATA. *Select data and declare internal table using in-line method @DATA *SELECT * * FROM EDOC_MX_SRC_RELATED_DOC_DATA * INTO TABLE @DATA(IT_EDOC_MX_SRC_RELATED_DOC_DATA2). *--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_EDOC_MX_SRC_RELATED_DOC_DATA INDEX 1 INTO DATA(WA_EDOC_MX_SRC_RELATED_DOC_DATA2). *Demonstrate how to loop at an internal table and update values using a FIELD-SYMBOL LOOP AT IT_EDOC_MX_SRC_RELATED_DOC_DATA ASSIGNING <EDOC_MX_SRC_RELATED_DOC_DATA>.*To update a field value using a field symbol simply change the value via the field symbol pointer
<EDOC_MX_SRC_RELATED_DOC_DATA>-BUKRS = 1.
<EDOC_MX_SRC_RELATED_DOC_DATA>-BELNR = 1.
<EDOC_MX_SRC_RELATED_DOC_DATA>-GJAHR = 1.
<EDOC_MX_SRC_RELATED_DOC_DATA>-DOCUMENT_HEADER = 1.
<EDOC_MX_SRC_RELATED_DOC_DATA>-MANDT = 1.
ENDLOOP. LOOP AT IT_EDOC_MX_SRC_RELATED_DOC_DATA INTO WA_EDOC_MX_SRC_RELATED_DOC_DATA. *Write horizonal line to screen report. WRITE:/ sy-uline. *Write selected data to screen/report before conversion. WRITE:/ sy-vline, WA_EDOC_MX_SRC_RELATED_DOC_DATA-BUKRS, sy-vline,
WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR, sy-vline,
WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR, sy-vline,
WA_EDOC_MX_SRC_RELATED_DOC_DATA-BLART, sy-vline,
WA_EDOC_MX_SRC_RELATED_DOC_DATA-BLDAT, sy-vline,
WA_EDOC_MX_SRC_RELATED_DOC_DATA-BUDAT, sy-vline.
ENDLOOP. *Add any further fields from structure WA_EDOC_MX_SRC_RELATED_DOC_DATA 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_EDOC_MX_SRC_RELATED_DOC_DATA 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_EDOC_MX_SRC_RELATED_DOC_DATA INTO WA_EDOC_MX_SRC_RELATED_DOC_DATA. *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 BELNR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field GJAHR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field BELNR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field GJAHR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field DBBLG CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-DBBLG IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-DBBLG.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field DBBLG_GJAHR CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-DBBLG_GJAHR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-DBBLG_GJAHR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field STBLG CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-STBLG IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-STBLG.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field STJAH CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-STJAH IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-STJAH.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRT, internal->external for field KURSF CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURSF IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURSF.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRT, internal->external for field KZKRS CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KZKRS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KZKRS.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRT, internal->external for field KURS2 CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURS2 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURS2.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRT, internal->external for field KURS3 CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURS3 IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURS3.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field AWSYS CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-AWSYS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-AWSYS.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRT, internal->external for field TXKRS CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-TXKRS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-TXKRS.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRT, internal->external for field CTXKRS CALL FUNCTION 'CONVERSION_EXIT_EXCRT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-CTXKRS IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-CTXKRS.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field LOTKZ CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-LOTKZ IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-LOTKZ.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field RLDNR CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-RLDNR IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-RLDNR.
WRITE:/ 'New Value:', ld_input.
*Conversion exit PRPMN, internal->external for field PROPMANO CALL FUNCTION 'CONVERSION_EXIT_PRPMN_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-PROPMANO IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-PROPMANO.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ODNIT, internal->external for field XBLNR_ALT CALL FUNCTION 'CONVERSION_EXIT_ODNIT_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-XBLNR_ALT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-XBLNR_ALT.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRX, internal->external for field KURSX CALL FUNCTION 'CONVERSION_EXIT_EXCRX_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURSX IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KURSX.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRX, internal->external for field KUR2X CALL FUNCTION 'CONVERSION_EXIT_EXCRX_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KUR2X IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KUR2X.
WRITE:/ 'New Value:', ld_input.
*Conversion exit EXCRX, internal->external for field KUR3X CALL FUNCTION 'CONVERSION_EXIT_EXCRX_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-KUR3X IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-KUR3X.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field LOGSYSTEM_SENDER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-LOGSYSTEM_SENDER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-LOGSYSTEM_SENDER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field BELNR_SENDER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR_SENDER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-BELNR_SENDER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit GJAHR, internal->external for field GJAHR_SENDER CALL FUNCTION 'CONVERSION_EXIT_GJAHR_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR_SENDER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-GJAHR_SENDER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field AWREF_REV CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-AWREF_REV IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-AWREF_REV.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CO_ALEBN CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-CO_ALEBN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-CO_ALEBN.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CO_BELNR_SENDER CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-CO_BELNR_SENDER IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-CO_BELNR_SENDER.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field TRAVA_PN CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-TRAVA_PN IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-TRAVA_PN.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field GLO_BP1_HD CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-GLO_BP1_HD IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-GLO_BP1_HD.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field GLO_BP2_HD CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-GLO_BP2_HD IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-GLO_BP2_HD.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field BATCH CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-BATCH IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-BATCH.
WRITE:/ 'New Value:', ld_input.
*Conversion exit ALPHA, internal->external for field CNT CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = WA_EDOC_MX_SRC_RELATED_DOC_DATA-CNT IMPORTING output = ld_input.
WRITE:/ 'Org Value:', WA_EDOC_MX_SRC_RELATED_DOC_DATA-CNT.
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_EDOC_MX_SRC_RELATED_DOC_DATA_STR,
BUKRS TYPE STRING,
BELNR TYPE STRING,
GJAHR TYPE STRING,
DOCUMENT_HEADER TYPE STRING,
MANDT TYPE STRING,
BUKRS TYPE STRING,
BELNR TYPE STRING,
GJAHR TYPE STRING,
BLART TYPE STRING,
BLDAT TYPE STRING,
BUDAT TYPE STRING,
MONAT TYPE STRING,
CPUDT TYPE STRING,
CPUTM TYPE STRING,
AEDAT TYPE STRING,
UPDDT TYPE STRING,
WWERT TYPE STRING,
USNAM TYPE STRING,
TCODE TYPE STRING,
BVORG TYPE STRING,
XBLNR TYPE STRING,
DBBLG TYPE STRING,
DBBLG_GJAHR TYPE STRING,
DBBLG_BUKRS TYPE STRING,
STBLG TYPE STRING,
STJAH TYPE STRING,
BKTXT TYPE STRING,
WAERS TYPE STRING,
KURSF TYPE STRING,
KZWRS TYPE STRING,
KZKRS TYPE STRING,
BSTAT TYPE STRING,
XNETB TYPE STRING,
FRATH TYPE STRING,
XRUEB TYPE STRING,
GLVOR TYPE STRING,
GRPID TYPE STRING,
DOKID TYPE STRING,
ARCID TYPE STRING,
IBLAR TYPE STRING,
AWTYP TYPE STRING,
AWKEY TYPE STRING,
FIKRS TYPE STRING,
HWAER TYPE STRING,
HWAE2 TYPE STRING,
HWAE3 TYPE STRING,
KURS2 TYPE STRING,
KURS3 TYPE STRING,
BASW2 TYPE STRING,
BASW3 TYPE STRING,
UMRD2 TYPE STRING,
UMRD3 TYPE STRING,
XSTOV TYPE STRING,
STODT TYPE STRING,
XMWST TYPE STRING,
CURT2 TYPE STRING,
CURT3 TYPE STRING,
KUTY2 TYPE STRING,
KUTY3 TYPE STRING,
XSNET TYPE STRING,
AUSBK TYPE STRING,
XUSVR TYPE STRING,
DUEFL TYPE STRING,
AWSYS TYPE STRING,
TXKRS TYPE STRING,
CTXKRS TYPE STRING,
LOTKZ TYPE STRING,
XWVOF TYPE STRING,
STGRD TYPE STRING,
PPNAM TYPE STRING,
PPDAT TYPE STRING,
PPTME TYPE STRING,
PPTCOD TYPE STRING,
BRNCH TYPE STRING,
NUMPG TYPE STRING,
ADISC TYPE STRING,
XREF1_HD TYPE STRING,
XREF2_HD TYPE STRING,
XREVERSAL TYPE STRING,
REINDAT TYPE STRING,
RLDNR TYPE STRING,
LDGRP TYPE STRING,
PROPMANO TYPE STRING,
XBLNR_ALT TYPE STRING,
VATDATE TYPE STRING,
FULFILLDATE TYPE STRING,
DOCCAT TYPE STRING,
XSPLIT TYPE STRING,
CASH_ALLOC TYPE STRING,
FOLLOW_ON TYPE STRING,
XREORG TYPE STRING,
SUBSET TYPE STRING,
KURST TYPE STRING,
KURSX TYPE STRING,
KUR2X TYPE STRING,
KUR3X TYPE STRING,
XMCA TYPE STRING,
RESUBMISSION TYPE STRING,
LOGSYSTEM_SENDER TYPE STRING,
BUKRS_SENDER TYPE STRING,
BELNR_SENDER TYPE STRING,
GJAHR_SENDER TYPE STRING,
INTSUBID TYPE STRING,
AWORG_REV TYPE STRING,
AWREF_REV TYPE STRING,
XREVERSING TYPE STRING,
XREVERSED TYPE STRING,
GLBTGRP TYPE STRING,
CO_VRGNG TYPE STRING,
CO_REFBT TYPE STRING,
CO_ALEBN TYPE STRING,
CO_VALDT TYPE STRING,
CO_BELNR_SENDER TYPE STRING,
KOKRS_SENDER TYPE STRING,
ACC_PRINCIPLE TYPE STRING,
_DATAAGING TYPE STRING,
TRAVA_PN TYPE STRING,
LDGRPSPEC_PN TYPE STRING,
AFABESPEC_PN TYPE STRING,
XSECONDARY TYPE STRING,
REPROCESSING_STATUS_CODE TYPE STRING,
TRR_PARTIAL_IND TYPE STRING,
ITEM_REMOVAL_STATUS TYPE STRING,
PENRC TYPE STRING,
GLO_REF1_HD TYPE STRING,
GLO_DAT1_HD TYPE STRING,
GLO_REF2_HD TYPE STRING,
GLO_DAT2_HD TYPE STRING,
GLO_REF3_HD TYPE STRING,
GLO_DAT3_HD TYPE STRING,
GLO_REF4_HD TYPE STRING,
GLO_DAT4_HD TYPE STRING,
GLO_REF5_HD TYPE STRING,
GLO_DAT5_HD TYPE STRING,
GLO_BP1_HD TYPE STRING,
GLO_BP2_HD TYPE STRING,
EV_POSTNG_CTRL TYPE STRING,
WHTDATE TYPE STRING,
CBTTYPE TYPE STRING,
CLOSINGSTEP TYPE STRING,
ANXTYPE TYPE STRING,
ANXAMNT TYPE STRING,
ANXPERC TYPE STRING,
ZVAT_INDC TYPE STRING,
/SAPF15/STATUS TYPE STRING,
PSOTY TYPE STRING,
PSOAK TYPE STRING,
PSOKS TYPE STRING,
PSOSG TYPE STRING,
PSOFN TYPE STRING,
INTFORM TYPE STRING,
INTDATE TYPE STRING,
PSOBT TYPE STRING,
PSOZL TYPE STRING,
PSODT TYPE STRING,
PSOTM TYPE STRING,
FM_UMART TYPE STRING,
CCINS TYPE STRING,
CCNUM TYPE STRING,
SSBLK TYPE STRING,
BATCH TYPE STRING,
SNAME TYPE STRING,
SAMPLED TYPE STRING,
EXCLUDE_FLAG TYPE STRING,
BLIND TYPE STRING,
OFFSET_STATUS TYPE STRING,
OFFSET_REFER_DAT TYPE STRING,
KNUMV TYPE STRING,
BLO TYPE STRING,
CNT TYPE STRING,
PYBASTYP TYPE STRING,
PYBASNO TYPE STRING,
PYBASDAT TYPE STRING,
PYIBAN TYPE STRING,
INWARDNO_HD TYPE STRING,
INWARDDT_HD TYPE STRING,
DOCUMENT_ITEM TYPE STRING,
PAYMENT_DATA TYPE STRING,END OF T_EKKO_STR. DATA: WA_EDOC_MX_SRC_RELATED_DOC_DATA_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_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BUKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BELNR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GJAHR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DOCUMENT_HEADER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-MANDT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BUKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BELNR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GJAHR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BLART sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BLDAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BUDAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-MONAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CPUDT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CPUTM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AEDAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-UPDDT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-WWERT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-USNAM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-TCODE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BVORG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XBLNR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DBBLG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DBBLG_GJAHR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DBBLG_BUKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-STBLG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-STJAH sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BKTXT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-WAERS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KURSF sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KZWRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KZKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BSTAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XNETB sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-FRATH sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XRUEB sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLVOR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GRPID sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DOKID sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ARCID sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-IBLAR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AWTYP sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AWKEY sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-FIKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-HWAER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-HWAE2 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-HWAE3 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KURS2 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KURS3 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BASW2 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BASW3 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-UMRD2 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-UMRD3 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XSTOV sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-STODT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XMWST sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CURT2 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CURT3 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KUTY2 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KUTY3 sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XSNET sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AUSBK sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XUSVR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DUEFL sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AWSYS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-TXKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CTXKRS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-LOTKZ sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XWVOF sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-STGRD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PPNAM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PPDAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PPTME sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PPTCOD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BRNCH sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-NUMPG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ADISC sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XREF1_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XREF2_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XREVERSAL sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-REINDAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-RLDNR sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-LDGRP sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PROPMANO sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XBLNR_ALT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-VATDATE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-FULFILLDATE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DOCCAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XSPLIT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CASH_ALLOC sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-FOLLOW_ON sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XREORG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-SUBSET sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KURST sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KURSX sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KUR2X sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KUR3X sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XMCA sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-RESUBMISSION sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-LOGSYSTEM_SENDER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BUKRS_SENDER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BELNR_SENDER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GJAHR_SENDER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-INTSUBID sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AWORG_REV sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AWREF_REV sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XREVERSING sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XREVERSED sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLBTGRP sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CO_VRGNG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CO_REFBT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CO_ALEBN sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CO_VALDT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CO_BELNR_SENDER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KOKRS_SENDER sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ACC_PRINCIPLE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-_DATAAGING sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-TRAVA_PN sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-LDGRPSPEC_PN sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-AFABESPEC_PN sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-XSECONDARY sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-REPROCESSING_STATUS_CODE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-TRR_PARTIAL_IND sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ITEM_REMOVAL_STATUS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PENRC sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_REF1_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_DAT1_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_REF2_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_DAT2_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_REF3_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_DAT3_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_REF4_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_DAT4_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_REF5_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_DAT5_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_BP1_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-GLO_BP2_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-EV_POSTNG_CTRL sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-WHTDATE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CBTTYPE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CLOSINGSTEP sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ANXTYPE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ANXAMNT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ANXPERC sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-ZVAT_INDC sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-/SAPF15/STATUS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOTY sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOAK sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOKS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOSG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOFN sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-INTFORM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-INTDATE sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOBT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOZL sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSODT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PSOTM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-FM_UMART sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CCINS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CCNUM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-SSBLK sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BATCH sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-SNAME sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-SAMPLED sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-EXCLUDE_FLAG sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BLIND sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-OFFSET_STATUS sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-OFFSET_REFER_DAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-KNUMV sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-BLO sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-CNT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PYBASTYP sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PYBASNO sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PYBASDAT sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PYIBAN sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-INWARDNO_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-INWARDDT_HD sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-DOCUMENT_ITEM sy-vline
WA_EDOC_MX_SRC_RELATED_DOC_DATA_STR-PAYMENT_DATA sy-vline INTO ld_text SEPARATED BY SPACE. *Add any further fields from structure WA_EKKO_STR you want to CONCATENATE... ENDLOOP. ENDFORM.