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

XML Simple Transformation Program: How to pass info inside a structure ?

Former Member
0 Likes
458

Hi everyone,

BEGIN OF ty_qty
  zstatut_stock TYPE zstatut_stock,
  menge         TYPE menge_d,
END OF ty_qty,

BEGIN OF ty_article,
  matnr  TYPE matnr,
  ean11  TYPE ean11,
  lifnr  TYPE lifnr,
  st_qty TYPE ty_qqty,
END OF ty_article,

As you can see, I have a structure (st_qty TYPE ty_qty) inside the structure of ty_article (article=material)

I want to have my ST program to feed the two fields inside the structure [ST_QTY] but what I have tried does not work.

For some reasons, it does not like the following syntax:

<STATUS_STK> <tt:value ref="$art.st_qty-zstatut_stock"/> </STATUS_STK>

How can I do this ?

Here is more line of my ST program.

<tt:loop name="art" ref="$pdv.it_article">
<ARTICLE>
    <REF_ART_SFR> <tt:value ref="$art.matnr"/>   </REF_ART_SFR>
    <COD_EAN>        <tt:value ref="$art.ean11"/>   </COD_EAN>
    <COD_GRO>       <tt:value ref="$art.lifnr"/>        </COD_GRO>
    <QTY>
         <STATUS_STK> <tt:value ref="$art.st_qty-zstatut_stock"/>  </STATUS_STK>  
         <QTY_STK>        <tt:value ref="$art.st_qty-menge"/>              </QTE_STK>
    </QTY>
</ARTICLE>
</tt:loop>

1 ACCEPTED SOLUTION
Read only

gabriel_pill-kahan
Active Participant
0 Likes
430

Hi,

Try using dot instead of dash to separate the components. For example "$art.st_qty.zstatut_stock".

Search SAP help for topic "Addressing Subnodes". They give examples there like <tt:value ref="ROOT.STRUC2.COL2" />

Hopefully this will solve your issue.

Hi everyone,

BEGIN OF ty_qty
  zstatut_stock TYPE zstatut_stock,
  menge         TYPE menge_d,
END OF ty_qty,

BEGIN OF ty_article,
  matnr  TYPE matnr,
  ean11  TYPE ean11,
  lifnr  TYPE lifnr,
  st_qty TYPE ty_qqty,
END OF ty_article,

As you can see, I have a structure (st_qty TYPE ty_qty) inside the structure of ty_article (article=material)

I want to have my ST program to feed the two fields inside the structure [ST_QTY] but what I have tried does not work.

For some reasons, it does not like the following syntax:

<STATUS_STK> <tt:value ref="$art.st_qty-zstatut_stock"/> </STATUS_STK>

How can I do this ?

Here is more line of my ST program.

<tt:loop name="art" ref="$pdv.it_article">
<ARTICLE>
    <REF_ART_SFR> <tt:value ref="$art.matnr"/>   </REF_ART_SFR>
    <COD_EAN>        <tt:value ref="$art.ean11"/>   </COD_EAN>
    <COD_GRO>       <tt:value ref="$art.lifnr"/>        </COD_GRO>
    <QTY>
         <STATUS_STK> <tt:value ref="$art.st_qty-zstatut_stock"/>  </STATUS_STK>  
         <QTY_STK>        <tt:value ref="$art.st_qty-menge"/>              </QTE_STK>
    </QTY>
</ARTICLE>
</tt:loop>

2 REPLIES 2
Read only

gabriel_pill-kahan
Active Participant
0 Likes
431

Hi,

Try using dot instead of dash to separate the components. For example "$art.st_qty.zstatut_stock".

Search SAP help for topic "Addressing Subnodes". They give examples there like <tt:value ref="ROOT.STRUC2.COL2" />

Hopefully this will solve your issue.

Read only

0 Likes
430

Thanks Gabriel... works perfectly... 10 points !!

José