Skip to Content

We create a PI adapter module that calls a ABAP function module to process the messages payload. The function module must accept the message payload and encoding and return the resulting payload and an error text if an error ocurred.

The module uses the java resource architecture (JRA) to call the RFC runtime. This eases transport of the PI communication channel because no module parameters have to be changed in the different stages. Also credentials for RFC connection can be maintained using NWA.

image  

Motivation  

Why do we need to call ABAP from the module processor?

At a customer site we are dealing with an Idoc to Idoc scenario where one system creates Idocs and dumps the textual representation of the Idoc into a flat file. Starting from PI 7.11 a module is available to convert Idoc flat files to Idoc xml, see [1]. As no backport of this solution was available for PI 7.10 we decided to create an ABAP mapping to do the job as there are standard ABAP functions to do this kind of conversion.

Later we realized we need enhanced receiver determination for dynamically adressing different target systems. However enhanced receiver determination requires that the payload of the actual message is xml which was not the case for our Idoc scenario. So we created an adapter module to call a ABAP function module which in turn called the ABAP mapping. This way we got xml before we enter receiver determination.

It turns out that our module is quite generic. It uses the SAP Java Resource Adapter (SAP JRA) to call the RFC module. The parameters of the module are given but its name is configurable as module parameter. The host it runs on as well as the credentials are configured for the JRA connection factory in the Netweaver Administrator.

What is the advantage of JRA?

JRA does all the resource handling for you. This way you avoid common pitfalls like memory leaks due to resources that are not freed correctly. User and password for the RFC call can be maintained using the NWA and not as module parameter. Module parameters can be transported without change as long as the connection factory is maintained in all the landscapes using the same name.

How to use the module

Module parameters
Parameter name  Description 
 JNDINameOfJRAConnectionFactory  Name of the JRA connection factory configured e.g. deployedAdapters/CBFC_JRC_CF/nonGlobalTx/CBFC_JRC_CF
 NameOfRfc  Name of the RFC function module that is to be called e.g. CBFC_FLAT_IDOC_2_XML
 Encoding  The encoding will be passed one to one to the called ABAP function module e.g. 1100

 

 

 

 

 Example configuration might look like this 

 image

Parameters of the ABAP function module

The ABAP function module will have a defined signature. Apart from the message payload we decided to pass the encoding to do a conversion within the module if necessary. Also we added an export parameter for passing error information. The module will exit gracefully if it encounters non empty error message. The error text will be shown in the adapter log.

Name  Dirction Type Description 
SOURCE   Import XSTRING Bytestream of the message payload 
ENCODING Import STRING Either empty (binary) or encoding
RESULT  Export XSTRING Bytestream of the message payload
ERROR Export STRING Error text. If error text != null Module will finish with exception

  

  
  
  
  
  

A typical implementation might look like this (This is only a wrapper module that calls our former ABAP mapping. It does the encoding conversion and error handling)

  
How to setup the connection factory for use of JRA?

It is discribed in detail in [1]. For our example it will look like

image

Module source

References 

[1] How to Use User-Module for Conversion of IDoc Messages Between Flat and XML Formats, How to Use User-Module for Conversion of IDoc Messages Between Flat and XML Formats

[2] SAP Java Resource Adapter (SAP JRA), http://help.sap.com/saphelp_nwpi71/helpdata/EN/6f/1bd5caa85b11d6b28500508b5d5211/frameset.htm

http://help.sap.com/saphelp_nwpi71/helpdata/EN/6f/1bd5caa85b11d6b28500508b5d5211/frameset.htm

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Bhavesh Kantilal
    Hello,
    Thanks for this interesting line of option to deal with a rather interesting issue.
    Just one question – You have mentioned that you use a ABAP mapping to convert the IDoc Flat File into IDoc XML. Does this use the standard SAP function module IDOC_INBOUND_FROM_FILE ?
    Can you also share this code excerpt if possible?

    Regards,
    Bhavesh

    (0) 
    1. Jochen Damzog Post author

      Hi Bhavesh,<br/><br/>the code is grown a little ugly because it handles different IDOC control record formats. I will post it anyway<br/><br/>METHOD if_mapping~execute.<br/>* ==================================================================<br/>* 1. Convert IDOC-XML (XSTRING) to STRING<br/>* Umwandlung des Bytestreams in eine Zeichenkette (UTF-8)<br/>* ==================================================================<br/>  DATA: l_convin   TYPE REF TO cl_abap_conv_in_ce.<br/>  DATA: l_msgstr   TYPE string.<br/>  DATA: l_exception TYPE REF TO cx_root.<br/>  DATA: g_mq_input_message TYPE string.<br/>  DATA: g_mq_output_message TYPE string.<br/>  DATA: g_mq_message TYPE string.<br/>  DATA: lv_text(255) TYPE c.<br/><br/>  TRY.<br/>      CALL METHOD cl_abap_conv_in_ce=>create<br/>        EXPORTING<br/>          encoding    = ‘UTF-8′<br/>          input       = source<br/>*         ignore_cerr = ‘X'<br/>        RECEIVING<br/>          conv        = l_convin.<br/><br/>      CALL METHOD l_convin->read<br/>        IMPORTING<br/>          data = g_mq_input_message.<br/><br/>    CATCH cx_root INTO l_exception.<br/>*     Bei der Zeichenkonvertierung ist ein Fehler aufgetreten<br/>      CALL METHOD l_exception->get_text<br/>        RECEIVING<br/>          result = l_msgstr.<br/>*      l_msgstr = text-001.<br/>*      MESSAGE l_msgstr TYPE ‘E’.<br/>      RAISE EXCEPTION TYPE cx_mapping_fault<br/>        EXPORTING<br/>          error_text = l_msgstr.<br/>  ENDTRY.<br/><br/><br/>* ================================================================================================<br/>* 2. Set the meta data port (IDX1 port used for meta data lookup)<br/><br/> In diesem Schritt muss der relevante IDX1 Port gesetzt werden, welcher für das Lesen der Metadaten<br/>* verwendet werden soll. Der im Mapping verwendete Funktionsbaustein IDX_IDOC_TO_XML stammt aus dem<br/>* IDOC-Sender Adapter, so dass nachfolgende Logik zu beachten ist:<br/><br/> IDOC-Adapter Szenario:<br/>* SAP ® IDOC-Sender-Adapter ® XI<br/><br/> Flat_to_IDOC Szenario:<br/>* File ® XI (IDX_IDOC_TO_XML) ® IDOC-Receiver-Adapter ® SAPXXX<br/><br/> IDX_IDOC_TO_XML ruft IDX_SYNTAX_CHECK und IDOC Direction = 1  auf ® dort werden Metadaten gelesen<br/>* IDOC Direction: 1 ® SNDPOR des IDOCs<br/>* IDOC Direction: 2 ® RCVPOR des IDOCs<br/><br/> D.h. in diesem Szenario kann nur vom SNDPOR gelesen werden. Dieser muss temp. Auf SAPXX gesetzt<br/>* werden (d.h. um vom tatsächlichen Empfänger zu lesen. Einstellung wir dann im<br/>* IDOC-Receiver Adapter wieder umgestellt (automatisch).<br/><br/> ================================================================================================<br/>*  data: ls_parameter type ZNPM_PARAMETER.<br/>*  data: lt_parameter type table of ZNPM_PARAMETER.<br/><br/>  select single * from ZNPM_PARAMETER  into ls_parameter<br/>*                  where werk = ‘077’<br/>*                  and REPORT = ‘Z_NACOS_FLAT_TO_IDOC'<br/>*                  and P_NAME = ‘METADATA4IDOCMAPPING’.<br/><br/>  G_METADATA_PORT = ls_parameter-P_WERT.<br/>*   G_METADATA_PORT = ‘SAPE1R’.<br/><br/>* ==================================================================<br/>* 3. Convert EDI_DC40 & EDI_DD40 structures to IDOC XML<br/>* Umwandlung der flachen Struktur auf die IDOC-XML Struktur<br/>* ==================================================================<br/>* new structures<br/>  DATA: ls_edi_dc40 TYPE edi_dc40.<br/>  DATA: ls_edi_dd40 TYPE edi_dd40.<br/>  DATA: lt_edi_dd40 TYPE TABLE OF edi_dd40.<br/>* old structures<br/>  DATA: ls_edi_dc TYPE edi_dc.<br/>  DATA: ls_edi_dd TYPE edi_dd.<br/>  DATA: lt_edi_dd TYPE TABLE OF edi_dd.<br/><br/>* ==================================================================<br/>* 3A. extract EDI_DC40 & EDI_DD40<br/>* ==================================================================<br/><br/>  DATA: result_tab TYPE match_result_tab.<br/>  DATA: result_wa TYPE match_result.<br/>  DATA: idx_start TYPE i.<br/>  DATA: length TYPE i.<br/>  DATA: length1 TYPE i.<br/>  DATA: tempstring TYPE string.<br/>  DATA: lv_version(3) TYPE c.<br/>  DATA: lv_spaces55(55) TYPE c.<br/>  DATA: lv_spaces63(63) TYPE c.<br/>  DATA: lv_length TYPE i.<br/><br/>** convert SAP R/3 Idoc 3.0/3.1 structure to SAP R/3 4.x structure<br/>*  ls_edi_dc40-MANDT = G_MQ_INPUT_MESSAGE0(3).<br/>*  ls_edi_dc40-DOCNUM = G_MQ_INPUT_MESSAGE3(16).<br/>*  ls_edi_dc40-DOCREL = G_MQ_INPUT_MESSAGE19(4).<br/>*  ls_edi_dc40-STATUS = G_MQ_INPUT_MESSAGE23(2).<br/>*  ls_edi_dc40-DIRECT = G_MQ_INPUT_MESSAGE33(1).<br/>*  ls_edi_dc40-OUTMOD = G_MQ_INPUT_MESSAGE166(1).<br/>*  ls_edi_dc40-EXPRSS = ”.<br/>*  ls_edi_dc40-TEST = G_MQ_INPUT_MESSAGE167(1).<br/>*  ls_edi_dc40-RCVPOR = G_MQ_INPUT_MESSAGE34(10).<br/>*  ls_edi_dc40-RCVPRT = G_MQ_INPUT_MESSAGE44(2).<br/>*  ls_edi_dc40-RCVPRN = G_MQ_INPUT_MESSAGE46(10).<br/>*  ls_edi_dc40-SNDPOR = G_MQ_INPUT_MESSAGE168(10).<br/>*  ls_edi_dc40-SNDPRT = G_MQ_INPUT_MESSAGE178(2).<br/>*  ls_edi_dc40-SNDPRN = G_MQ_INPUT_MESSAGE180(10).<br/>*  ls_edi_dc40-CREDAT = G_MQ_INPUT_MESSAGE358(8).<br/>*  ls_edi_dc40-CRETIM = G_MQ_INPUT_MESSAGE366(6).<br/>*  ls_edi_dc40-MESTYP = G_MQ_INPUT_MESSAGE407(6).<br/>*  ls_edi_dc40-IDOCTYP = G_MQ_INPUT_MESSAGE+437(8).<br/><br/>* ==================================================================<br/>* 3B. Loop:<br/>* Splitting der flachen Struktur und Aufbau interner ABAP Tabellen<br/>* ==================================================================<br/>  FIND ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN g_mq_input_message RESULTS result_tab.<br/><br/>  IF sy-subrc = 0.<br/>    lv_length = strlen( g_mq_input_message ) – 2.<br/>    READ TABLE result_tab INTO result_wa<br/>     WITH KEY offset = lv_length.<br/>    IF sy-subrc <> 0.<br/>      CLEAR result_wa.<br/>      result_wa-offset = lv_length + 2.<br/>      result_wa-length = 2.<br/>      APPEND result_wa TO result_tab.<br/>    ENDIF.<br/>    idx_start = 0.<br/>    CLEAR: ls_edi_dd40, ls_edi_dd,<br/>           ls_edi_dc40, ls_edi_dc,<br/>           tempstring,<br/>           g_mq_output_message.<br/>    REFRESH: lt_edi_dd40.<br/>    LOOP AT result_tab INTO result_wa.<br/>      length = result_wa-offset – idx_start.<br/>      IF lv_version = ‘NEW’.<br/>        IF length < 63.<br/>          lv_spaces63 = ‘                                                               ‘.<br/>          MOVE g_mq_input_messageidx_start(length) TO lv_spaces63.<br/>          length = 63.<br/>        ELSE.<br/>          tempstring = g_mq_input_messageidx_start(length).<br/>        ENDIF.<br/>      ELSEIF lv_version = ‘OLD’.<br/>        IF length < 55.<br/>          lv_spaces55 = ‘                                                       ‘.<br/>          MOVE g_mq_input_messageidx_start(length) TO lv_spaces55.<br/>          length = 55.<br/>        ELSE.<br/>          tempstring = g_mq_input_messageidx_start(length).<br/>        ENDIF.<br/>      ELSE.<br/>        tempstring = g_mq_input_message+idx_start(length).<br/>      ENDIF.<br/>      idx_start = result_wa-offset + 2.<br/>      IF sy-tabix = 1.<br/>        IF tempstring(6) <> ‘EDI_DC’.<br/>* corrupt data<br/>          MESSAGE e000(message_identifier) WITH text-001 INTO lv_text.<br/>          l_msgstr = lv_text.<br/>          RAISE EXCEPTION TYPE cx_mapping_fault<br/>            EXPORTING<br/>              error_text = l_msgstr.<br/>        ENDIF.<br/>      ENDIF.<br/>      IF tempstring(8) = ‘EDI_DC40’.<br/>        lv_version = ‘NEW’.<br/>        IF ls_edi_dc40 IS NOT INITIAL AND lt_edi_dd40[] IS NOT INITIAL.<br/>          ls_edi_dc40-sndpor = ‘SAPE1R’.<br/>          CLEAR g_mq_message.<br/>          CALL FUNCTION ‘IDX_IDOC_TO_XML'<br/>            EXPORTING<br/>              edidc40           = ls_edi_dc40<br/>*             DEF_TYP           = ‘X'<br/>*             SYNTAX_CHECK      = ‘X'<br/>              tunnel            = ‘ ‘<br/>              rfc_codepage      = 1133<br/>*             MULTI             =<br/>            IMPORTING<br/>              xml_data          = g_mq_message<br/>            TABLES<br/>              idoc_data_40      = lt_edi_dd40<br/>            EXCEPTIONS<br/>              conversion_failed = 1<br/>              system_error      = 2<br/>              structure_error   = 3<br/>              OTHERS            = 4.<br/>          IF sy-subrc = 0.<br/>            CONCATENATE g_mq_output_message<br/>                        g_mq_message<br/>                   INTO g_mq_output_message.<br/>          ELSE.<br/>            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno<br/>             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4<br/>             INTO lv_text.<br/>            l_msgstr = lv_text.<br/>            RAISE EXCEPTION TYPE cx_mapping_fault<br/>              EXPORTING<br/>                error_text = l_msgstr.<br/>          ENDIF.<br/>        ENDIF.<br/>        ls_edi_dc40 = tempstring(length).<br/>        REFRESH lt_edi_dd40.<br/>      ELSEIF tempstring(6) = ‘EDI_DC’.<br/>        lv_version = ‘OLD’.<br/>        IF ls_edi_dc IS NOT INITIAL AND lt_edi_dd40[] IS NOT INITIAL.<br/>* convert dc->dc40<br/>          MOVE-CORRESPONDING ls_edi_dc TO ls_edi_dc40.<br/>          ls_edi_dc40-sndpor = ‘SAPE1R’.<br/>          CLEAR g_mq_message.<br/>          CALL FUNCTION ‘IDX_IDOC_TO_XML'<br/>            EXPORTING<br/>              edidc40           = ls_edi_dc40<br/>*             DEF_TYP           = ‘X'<br/>*             SYNTAX_CHECK      = ‘X'<br/>              tunnel            = ‘ ‘<br/>              rfc_codepage      = 1133<br/>*             MULTI             =<br/>            IMPORTING<br/>              xml_data          = g_mq_message<br/>            TABLES<br/>              idoc_data_40      = lt_edi_dd40<br/>            EXCEPTIONS<br/>              conversion_failed = 1<br/>              system_error      = 2<br/>              structure_error   = 3<br/>              OTHERS            = 4.<br/>          IF sy-subrc = 0.<br/>            CONCATENATE g_mq_output_message<br/>                        g_mq_message<br/>                   INTO g_mq_output_message.<br/>          ELSE.<br/>            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno<br/>             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4<br/>             INTO lv_text.<br/>            l_msgstr = lv_text.<br/>            RAISE EXCEPTION TYPE cx_mapping_fault<br/>              EXPORTING<br/>                error_text = l_msgstr.<br/>          ENDIF.<br/>        ENDIF.<br/>        ls_edi_dc = tempstring(length).<br/>        REFRESH lt_edi_dd40.<br/>      ELSE.<br/>        IF lv_version = ‘NEW’.<br/>          length1 = length – 63.<br/>          IF length1 = 0.<br/>            ls_edi_dd40-mandt = lv_spaces6330(3).<br/>            ls_edi_dd40-segnam = lv_spaces630(30).<br/>            ls_edi_dd40-docnum = lv_spaces6333(16).<br/>            ls_edi_dd40-segnum = lv_spaces6349(6).<br/>            ls_edi_dd40-psgnum = lv_spaces6355(6).<br/>            ls_edi_dd40-hlevel = lv_spaces6361(2).<br/>            CLEAR ls_edi_dd40-sdata.<br/>          ELSE.<br/>            ls_edi_dd40-mandt = tempstring30(3).<br/>            ls_edi_dd40-segnam = tempstring0(30).<br/>            ls_edi_dd40-docnum = tempstring33(16).<br/>            ls_edi_dd40-segnum = tempstring49(6).<br/>            ls_edi_dd40-psgnum = tempstring55(6).<br/>            ls_edi_dd40-hlevel = tempstring61(2).<br/>            ls_edi_dd40-sdata = tempstring63(length1).<br/>          ENDIF.<br/>          APPEND ls_edi_dd40 TO lt_edi_dd40.<br/>        ELSE.<br/>          length1 = length – 55.<br/>          IF length1 = 0.<br/>            ls_edi_dd40-mandt = lv_spaces5510(3).<br/>            ls_edi_dd40-segnam = lv_spaces5535(10).<br/>            ls_edi_dd40-docnum = lv_spaces5513(16).<br/>            ls_edi_dd40-segnum = lv_spaces5529(6).<br/>            ls_edi_dd40-psgnum = lv_spaces5545(6).<br/>            ls_edi_dd40-hlevel = lv_spaces5551(2).<br/>            CLEAR ls_edi_dd40-sdata.<br/>          ELSE.<br/>            ls_edi_dd40-mandt = tempstring10(3).<br/>            ls_edi_dd40-segnam = tempstring35(10).<br/>            ls_edi_dd40-docnum = tempstring13(16).<br/>            ls_edi_dd40-segnum = tempstring29(6).<br/>            ls_edi_dd40-psgnum = tempstring45(6).<br/>            ls_edi_dd40-hlevel = tempstring51(2).<br/>            ls_edi_dd40-sdata = tempstring55(length1).<br/>          ENDIF.<br/>          APPEND ls_edi_dd40 TO lt_edi_dd40.<br/>        ENDIF.<br/>      ENDIF.<br/>    ENDLOOP.<br/>    IF lv_version = ‘NEW’.<br/>      IF ls_edi_dc40 IS NOT INITIAL AND lt_edi_dd40[] IS NOT INITIAL.<br/>        ls_edi_dc40-sndpor = ‘SAPE1R’.<br/>        CLEAR g_mq_message.<br/>        CALL FUNCTION ‘IDX_IDOC_TO_XML'<br/>          EXPORTING<br/>            edidc40           = ls_edi_dc40<br/>*           DEF_TYP           = ‘X'<br/>*           SYNTAX_CHECK      = ‘X'<br/>            tunnel            = ‘ ‘<br/>            rfc_codepage      = 1133<br/>*           MULTI             =<br/>          IMPORTING<br/>            xml_data          = g_mq_message<br/>          TABLES<br/>            idoc_data_40      = lt_edi_dd40<br/>          EXCEPTIONS<br/>            conversion_failed = 1<br/>            system_error      = 2<br/>            structure_error   = 3<br/>            OTHERS            = 4.<br/>        IF sy-subrc = 0.<br/>          CONCATENATE g_mq_output_message<br/>                      g_mq_message<br/>                 INTO g_mq_output_message.<br/>        ELSE.<br/>          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno<br/>           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4<br/>           INTO lv_text.<br/>          l_msgstr = lv_text.<br/>          RAISE EXCEPTION TYPE cx_mapping_fault<br/>            EXPORTING<br/>              error_text = l_msgstr.<br/>        ENDIF.<br/>      ENDIF.<br/>    ELSE.<br/>      IF ls_edi_dc IS NOT INITIAL AND lt_edi_dd40[] IS NOT INITIAL.<br/>* convert dc->dc40<br/>        MOVE-CORRESPONDING ls_edi_dc TO ls_edi_dc40.<br/>        ls_edi_dc40-sndpor = ‘SAPE1R’.<br/>        CLEAR g_mq_message.<br/>        CALL FUNCTION ‘IDX_IDOC_TO_XML'<br/>          EXPORTING<br/>            edidc40           = ls_edi_dc40<br/>*           DEF_TYP           = ‘X'<br/>*           SYNTAX_CHECK      = ‘X'<br/>            tunnel            = ‘ ‘<br/>            rfc_codepage      = 1133<br/>*           MULTI             =<br/>          IMPORTING<br/>            xml_data          = g_mq_message<br/>          TABLES<br/>            idoc_data_40      = lt_edi_dd40<br/>          EXCEPTIONS<br/>            conversion_failed = 1<br/>            system_error      = 2<br/>            structure_error   = 3<br/>            OTHERS            = 4.<br/>        IF sy-subrc = 0.<br/>          CONCATENATE g_mq_output_message<br/>                      g_mq_message<br/>                 INTO g_mq_output_message.<br/>        ELSE.<br/>          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno<br/>           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4<br/>           INTO lv_text.<br/>          l_msgstr = lv_text.<br/>          RAISE EXCEPTION TYPE cx_mapping_fault<br/>            EXPORTING<br/>              error_text = l_msgstr.<br/>        ENDIF.<br/>      ENDIF.<br/>    ENDIF.<br/>  ELSE.<br/>    FIND ALL OCCURRENCES OF cl_abap_char_utilities=>newline IN g_mq_input_message RESULTS result_tab.<br/>    IF sy-subrc = 0.<br/>      lv_length = strlen( g_mq_input_message ) – 1.<br/>      READ TABLE result_tab INTO result_wa<br/>       WITH KEY offset = lv_length.<br/>      IF sy-subrc <> 0.<br/>        CLEAR result_wa.<br/>        result_wa-offset = lv_length + 1.<br/>        result_wa-length = 1.<br/>        APPEND result_wa TO result_tab.<br/>      ENDIF.<br/>      idx_start = 0.<br/>      CLEAR: ls_edi_dd40, ls_edi_dd,<br/>             ls_edi_dc40, ls_edi_dc,<br/>             tempstring,<br/>             g_mq_output_message.<br/>      REFRESH: lt_edi_dd40.<br/>      LOOP AT result_tab INTO result_wa.<br/>        length = result_wa-offset – idx_start.<br/>        IF lv_version = ‘NEW’.<br/>          IF length < 63.<br/>            lv_spaces63 = ‘                                                               ‘.<br/>            MOVE g_mq_input_messageidx_start(length) TO lv_spaces63.<br/>            length = 63.<br/>          ELSE.<br/>            tempstring = g_mq_input_messageidx_start(length).<br/>          ENDIF.<br/>        ELSEIF lv_version = ‘OLD’.<br/>          IF length < 55.<br/>            lv_spaces55 = ‘                                                       ‘.<br/>            MOVE g_mq_input_messageidx_start(length) TO lv_spaces55.<br/>            length = 55.<br/>          ELSE.<br/>            tempstring = g_mq_input_messageidx_start(length).<br/>          ENDIF.<br/>        ELSE.<br/>          tempstring = g_mq_input_message+idx_start(length).<br/>        ENDIF.<br/>        idx_start = result_wa-offset + 1.<br/>        IF sy-tabix = 1.<br/>          IF tempstring(6) <> ‘EDI_DC’.<br/>* corrupt data<br/>            MESSAGE e000(message_identifier) WITH text-001 INTO lv_text.<br/>            l_msgstr = lv_text.<br/>            RAISE EXCEPTION TYPE cx_mapping_fault<br/>              EXPORTING<br/>                error_text = l_msgstr.<br/>          ENDIF.<br/>        ENDIF.<br/>        IF tempstring(8) = ‘EDI_DC40’.<br/>          lv_version = ‘NEW’.<br/>          IF ls_edi_dc40 IS NOT INITIAL AND lt_edi_dd40[] IS NOT INITIAL.<br/>            ls_edi_dc40-sndpor = ‘SAPE1R’.<br/>            CLEAR g_mq_message.<br/>            CALL FUNCTION ‘IDX_IDOC_TO_XML'<br/>              EXPORTING<br/>                edidc40           = ls_edi_dc40<br/>*               DEF_TYP           = ‘X'<br/>*               SYNTAX_CHECK      = ‘X'<br/>                tunnel            = ‘ ‘<br/>                rfc_codepage      = 1133<br/>*               MULTI             =<br/>              IMPORTING<br/>                xml_data          = g_mq_message<br/>              TABLES<br/>                idoc_data_40      = lt_edi_dd40<br/>              EXCEPTIONS<br/>                conversion_failed = 1<br/>                system_error      = 2<br/>                structure_error   = 3<br/>                OTHERS            = 4.<br/>            IF sy-subrc = 0.<br/>              CONCATENATE g_mq_output_message<br/>                          g_mq_message<br/>                     INTO g_mq_output_message.<br/>            ELSE.<br/>              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno<br/>               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4<br/>               INTO lv_text.<br/>              l_msgstr = lv_text.<br/>              RAISE EXCEPTION TYPE cx_mapping_fault<br/>                EXPORTING<br/>                  error_text = l_msgstr.<br/>            ENDIF.<br/>          ENDIF.<br/>          ls_edi_dc40 = tempstring(length).<br/>          REFRESH lt_edi_dd40.<br/>        ELSEIF tempstring(6) = ‘EDI_DC’.<br/>          lv_version = ‘OLD’.<br/>          IF ls_edi_dc IS NOT INITIAL AND lt_edi_dd40[] IS NOT INITIAL.<br/>* convert dc->dc40<br/>            MOVE-CORRESPONDING ls_edi_dc TO ls_edi_dc40.<br/>            ls_edi_dc40-sndpor = ‘SAPE1R’.<br/>            CLEAR g_mq_message.<br/>            CALL FUNCTION ‘IDX_IDOC_TO_XML'<br/>              EXPORTING<br/>                edidc40           = ls_edi_dc40<br/>*               DEF_TYP           = ‘X'<br/>*               SYNTAX_CHECK      = ‘X'<br/>                tunnel            = ‘ ‘<br/>                rfc_codepage      = 1133<br/>*               MULTI             =<br/>              IMPORTING<br/>                xml_data          = g_mq_message<br/>              TABLES<br/>                idoc_data_40      = lt_edi_dd40<br/>              EXCEPTIONS<br/>                conversion_failed = 1<br/>                system_error      = 2<br/>                structure_error   = 3<br/>                OTHERS            = 4.<br/>            IF sy-subrc = 0.<br/>              CONCATENATE g_mq_output_message<br/>                          g_mq_message<br/>                     INTO g_mq_output_message.<br/>            ELSE.<br/>              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno<br/>               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4<br/>               INTO lv_text.<br/>              l_msgstr = lv_text.<br/>              RAISE EXCEPTION TYPE cx_mapping_fault<br/>                EXPORTING<br/>                  error_text = l_msgstr.<br/>            ENDIF.<br/>          ENDIF.<br/>          ls_edi_dc = tempstring(length).<br/>          REFRESH lt_edi_dd40.<br/>        ELSE.<br/>          IF lv_version = ‘NEW’.<br/>            length1 = length – 63.<br/>            IF length1 = 0.<br/>              ls_edi_dd40-mandt = lv_spaces6330(3).<br/>              ls_edi_dd40-segnam = lv_spaces630(30).<br/>              ls_edi_dd40-docnum = lv_spaces6333(16).<br/>              ls_edi_dd40-segnum = lv_spaces6349(6).<br/>              ls_edi_dd40-psgnum = lv_spaces6355(6).<br/>              ls_edi_dd40-hlevel = lv_spaces6361(2).<br/>              CLEAR ls_edi_dd40-sdata.<br/>            ELSE.<br/>              ls_edi_dd40-mandt = tempstring30(3).<br/>              ls_edi_dd40-segnam = tempstring0(30).<br/>              ls_edi_dd40-docnum = tempstring33(16).<br/>              ls_edi_dd40-segnum = tempstring49(6).<br/>              ls_edi_dd40-psgnum = tempstring55(6).<br/>              ls_edi_dd40-hlevel = tempstring61(2).<br/>              ls_edi_dd40-sdata = tempstring63(length1).<br/>            ENDIF.<br/>            APPEND ls_edi_dd40 TO lt_edi_dd40.<br/>          ELSE.<br/>            length1 = length – 55.<br/>            IF length1 = 0.<br/>              ls_edi_dd40-mandt = lv_spaces5510(3).<br/>              ls_edi_dd40-segnam = lv_spaces5535(10).<br/>              ls_edi_dd40-docnum = lv_spaces5513(16).<br/>              ls_edi_dd40-segnum = lv_spaces5529(6).<br/>              ls_edi_dd40-psgnum = lv_spaces5545(6).<br/>              ls_edi_dd40-hlevel = lv_spaces5551(2).<br/>              CLEAR ls_edi_dd40-sdata.<br/>            ELSE.<br/>              ls_edi_dd40-mandt = tempstring10(3).<br/>              ls_edi_dd40-segnam = tempstring35(10).<br/>              ls_edi_dd40-docnum = tempstring13(16).<br/>              ls_edi_dd40-segnum = tempstring29(6).<br/>              ls_edi_dd40-psgnum = tempstring45(6).<br/>              ls_edi_dd40-hlevel = tempstring51(2).<br/>              ls_edi_dd40-sdata = tempstring55(length1).ENDMETHOD.

      (0) 
  2. Bhavesh Kantilal
    Hello,
    The option descrbed in Bill’s blog to set up JRA is for PI 7.1. Any idea how this is done on XI 3.0 / PI 7.0? Is it done on the Visual Admin?

    Regards
    Bhavesh

    (0) 
    1. Jochen Damzog Post author
      Hi Bhavesh,

      on a XI3.0 or XI7.0 it should basically work the same way only the menu structure in the NWA is a little different. For example in 7.0 you will find the place to configure the JCA resource under System Management>Configuration>Application resources.

      However in 3.0 and 7.0 the JRA application is not initially deployed. You have to follow instructions under http://help.sap.com/saphelp_nw70/helpdata/en/47/13044258bdd417e10000000a1550b0/frameset.htm to be able to use JRA.

      (0) 

Leave a Reply