Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Optional XML Tag - Simple Transformation Abap

Lopezs
Explorer
0 Likes
2,473

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>
1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor

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>
2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
Read only

0 Likes
1,052

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