2015 Jun 29 12:15 PM
Hi experts,
I am trying to deserialize XML from attachment using Simple Transformation and I've got many questions about it.
1. How should I handle the header:
<?xml version="1.0" encoding="utf-8"?>
<Documents xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Invoice.xsd">
<Document Version="1.0" Name="XML Invoice" Type="Invoice" DocumentReference="" ImageReference="" CertificateReference="">
It should be inserted just like that in ST (Simple Transformation) or should it be parsed to some structure?
2. What to do with fields having attributes instead of elements:
<Field Name="Waluta" Type="invoicecurrency">EUR</Field>
3. Should I create structures for all levels or can I skip header and "System" and "ProcessLog" from the end of file?
I'd be very grateful for every answer.
Hi experts,
I am trying to deserialize XML from attachment using Simple Transformation and I've got many questions about it.
1. How should I handle the header:
<?xml version="1.0" encoding="utf-8"?>
<Documents xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Invoice.xsd">
<Document Version="1.0" Name="XML Invoice" Type="Invoice" DocumentReference="" ImageReference="" CertificateReference="">
It should be inserted just like that in ST (Simple Transformation) or should it be parsed to some structure?
2. What to do with fields having attributes instead of elements:
<Field Name="Waluta" Type="invoicecurrency">EUR</Field>
3. Should I create structures for all levels or can I skip header and "System" and "ProcessLog" from the end of file?
I'd be very grateful for every answer.
2015 Jun 29 7:56 PM
Your structure should for which you are gonna create the Simple transformation should be at the "documents" level.
so it should be something:
ZDOCS (structure)
... ZDOC (structure)
... ... ZINVOICE (structure)
... ... ... ZSUPPLIER (structure) - with all fields
... ... ... ZBUYER (structure)
... ... ... ZFIELDS (table type)
... ... ... ... ZFIELD (structure) - with FLD_NAME and FLD_VALUE fields
... ... ... ZTABLES (table Type)
...
To map the field name and the value of the FIELDS, you need to refer to the attributes of the ZFIELD in the transformation. Something similar to this:
<Fields>
<tt:loop ref="FIELDS">
<Field>
<tt:attribute name="Name" value-ref="FLD_NAME" />
<tt:value ref="FLD_VALUE" />
</Field>
</tt:loop>
</Fields>
Regards,
Naimesh Patel
2015 Jun 30 3:42 AM
Hi Bartlomiej,
Your structure can be like below.. You can handle the array table and variable fields separately.
See the screenshot below for table and individual fields. If this is similar to your requirement you can check the link below for more details.
Let’s Web Dynpro. Part ZZ | SAP Yard
Regards,
Raju
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |