Skip to Content
0
Aug 04, 2023 at 10:21 AM

Error in Simple Transformation code with embedded ABAP structure

154 Views Last edit Aug 04, 2023 at 11:18 AM 2 rev

Hi Folks,

another question regarding the code within a simple transformation, where I am transforming a deep ABAP structure into a JSON string.

The parent ABAP structure contains, as well as some string fields, an embedded flat structure:

ACCESS_TOKEN		Types	ZDE_ACCESS_TOKEN	STRING
USER_GSTIN		Types	ZDE_USER_GSTIN		STRING
DATA_SOURCE		Types	ZDE_DATA_SOURCE		STRING
TRANSACTION_DETAILS	Types	ZSTY_TRANS_DETAILS
The embedded "transaction_details" structure contains string fields:
SUPPLY_TYPE		Types	ZDE_SUPPLY_TYPE		STRING
CHARGE_TYPE		Types	ZDE_CHARGE_TYPE		STRING
This is what the critical part of my transformation code (in XSLT) looks like:
      <str name="data_source">
        <tt:value ref="einvoice_request.data_source"/>
      </str>
      <transaction_details>
        <object>
          <str name="supply_type">
            <tt:value ref="einvoice_request.transaction_details.supply_type"/>
          </str>
When debugging, as soon as the transformation hits the "transaction_details" element, it fails. Obviously the code is incorrect, but I don't know how to declare the "transaction_details" element as an embedded flat structure.
Could anyone give me a pointer on this? I can't find any JSON demo code that embeds a structure, only tables with the 'array' tag.

Thanks for reading,

JM

At the risk of sounding patronising (which I don't mean to be), I hope @sandra.rossi reads this.