cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Italy edocument - eInvoice with Partner solution - EDOC_ADAPTOR~SET_OUTPUT_DATA

0 Kudos
292

Hello all,

We have implemented BADI EDOC_ADAPTOR and method SET_OUTPUT_DATA and made the custom logic. Changed the values in the structure CS_OUTPUT_DATA. But after upgrading it to EHP8. We are unable to get the XML structure in the change parameter CS_OUTPUT_DATA. 

After EHP8 upgrade, XML version is 1.2.1 and AIF version is 4.

Does anyone have any idea please?

Thanks and Regards,

Sivanantham.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

I solved it by modifying the implementation logic in the BAPI. I have converted the string to required structure and made the custom changes and then later converted back to string.

Convert <String> to ABAP structure

Play with the custom logic

Convert back ABAP structure to <String>

Example:

Part1: String to ABAP structure

TRY.
    cl_proxy_xml_transform=>xml_xstring_to_abap(
      EXPORTING xml xml_string
      IMPORTING abap_data ls_invoice_outer_struc
    ).
  CATCH cx_proxy_fault cx_transformation_error INTO lx_root.
    cl_edocument=>raise_edoc_exception(
      EXPORTING iv_error_txt lx_root->get_text).
ENDTRY.

Part 2 << Custom logics based on requirements>>

 

Part3: ABAP structure to String

*   Transform request structure to xstring format
TRY.
    cl_proxy_xml_transform=>abap_to_xml_xstring(
      EXPORTING
        abap_data    ls_invoice_outer_struc
      RECEIVING
        xml          xml_string
    ).
  CATCH cx_proxy_fault cx_transformation_error INTO lx_root.
    lv_error_txt lx_root->get_text).
    cl_edocument=>raise_edoc_exception(
      EXPORTING iv_error_txt lv_error_txt ).
ENDTRY.

<xml_string> xml_string.

Thanks and Regards,

Siva.