2021 Aug 29 4:32 AM
Hi Experts. I need a hand. I am really new in this Abap World, I am working with Simple Transformation, I need to get a XML from from internal tables.. some tables has no information (records), so I am trying to make a condition in the Simple transformation, what I need to do is TO HIDE User Tag and its internal tag and atributtes IF THERE ARE NO RECORDS IN TABLES and SHOW IT WHEN THERE ARE RECORDS, but i cant do it....
I’m hoping someone will just see what I’m doing wrong and point out how dumb I am… This is the code what I have tried with:
<tt:cond check="not-initial(ref('.DEPARTAMENT.DOCUMENTINFO.USER.'))">
<User tt:value-ref=".DEPARTAMENT.DOCUMENTINFO.USER."/>
<User>
<tt:attribute name="UserName" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.USERNAME"/>
<tt:attribute name="RFCUser" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.RFCUSER"/>
<tt:attribute name="Residence" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.RESIDENCE"/>
<Address>
<tt:attribute name="Street" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.ADDRESS.STREET"/>
<tt:attribute name="Num" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.ADDRESS.NUM"/>
[....]
</Address>
</User>
</tt:cond>
2021 Aug 30 10:42 AM
Answered in the same question there: https://stackoverflow.com/questions/68969764/optional-xml-tag-in-simple-transformation
Hi Experts. I need a hand. I am really new in this Abap World, I am working with Simple Transformation, I need to get a XML from from internal tables.. some tables has no information (records), so I am trying to make a condition in the Simple transformation, what I need to do is TO HIDE User Tag and its internal tag and atributtes IF THERE ARE NO RECORDS IN TABLES and SHOW IT WHEN THERE ARE RECORDS, but i cant do it....
I’m hoping someone will just see what I’m doing wrong and point out how dumb I am… This is the code what I have tried with:
<tt:cond check="not-initial(ref('.DEPARTAMENT.DOCUMENTINFO.USER.'))">
<User tt:value-ref=".DEPARTAMENT.DOCUMENTINFO.USER."/>
<User>
<tt:attribute name="UserName" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.USERNAME"/>
<tt:attribute name="RFCUser" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.RFCUSER"/>
<tt:attribute name="Residence" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.RESIDENCE"/>
<Address>
<tt:attribute name="Street" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.ADDRESS.STREET"/>
<tt:attribute name="Num" value-ref=".DEPARTAMENT.DOCUMENTINFO.USER.ADDRESS.NUM"/>
[....]
</Address>
</User>
</tt:cond>
2021 Aug 30 10:42 AM
Answered in the same question there: https://stackoverflow.com/questions/68969764/optional-xml-tag-in-simple-transformation
2025 Aug 11 11:26 AM
No it’s the same… if you have a XML and you need to fill an ABAP structure how can you do when xml come with some tags sometimes yes sometimes no .. optional tag? Because when there’s some one missing ABAP raise an exception
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |