Application Development 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: 

Simple Transformations : Table parameters

Former Member
0 Kudos

Hi experts,

I'm working on a Simple Transformations and I can't figure out how to access a table parameter from it.

The Help section on the PARAMETERS addition for the instruction CALL TRANSFORMATION says :

You can use this addition to bind ABAP data objects e1 e2 ... 
to the parameters p1 p2 ... of an XSL transformation or a
Simple Transformation. All elementary data objects and object
references are permitted.

And then :

Instead of using a static parameter list, you can specify the parameters
 dynamically as value pairs in the columns of the internal table ptab that has
 one of the following types from the type group ABAP

That is what I am trying to use.

Here is an example I'm trying to make work :

ABAP :


  DATA : partab TYPE abap_trans_parmbind_tab,
              s_par TYPE abap_trans_parmbind,
              lv_xstring TYPE xstring

  CLEAR s_par.
  MOVE 'PAR1' TO s_par-name.
  MOVE 'HELLO' TO s_par-value.
  APPEND s_par TO partab.

  CLEAR s_par.
  MOVE 'PAR2' TO s_par-name.
  MOVE 'WORLD' TO s_par-value.
  APPEND s_par TO partab.

  CALL TRANSFORMATION ztrans_test
      SOURCE 
           root = 'IT WORKS !!'
      PARAMETERS
        partab = partab
  RESULT XML lv_xstring.

Transformation :


 <tt:root name="ROOT" type="?"/>
 <tt:parameter name="PARTAB"/>
 <tt:template>
<VALUES>

<VALUE_SOURCE>
        <tt:value ref="ROOT"/>
</VALUE_SOURCE>

<VALUE_PARAM>
<tt:value ref="PAR1"/><tt:value ref="PAR2"/>
</VALUE_PARAM>

</VALUES>

I tried several instructions in the transformations but I never access the values in the table.

I want to use this fonctionality instead of an exhaustive list of parameters.

Can somebody please tell me how to do that ?

Thanks in advance !

Regards,

--Yohann.

Edited by: Yohann Camp on Feb 10, 2012 8:21 AM

2 REPLIES 2

Former Member
0 Kudos

Hi,

try like this,i think it may help you.

ABAP:

CALL TRANSFORMATION ztrans_test
      SOURCE 
           root = partab
     RESULT XML lv_xstring.

Trnsformation:

<tt:root name="ROOT" type="?"/>
 <tt:template>
<VALUES> 
<VALUE_SOURCE>
        <tt:value ref=".ROOT"/>
</VALUE_SOURCE> 
<VALUE_PARAM>
<tt:value ref="NAME"/>
<tt:value ref="VALUE"/>
</VALUE_PARAM>
 
</VALUES>

Thanks,

Rajesh.

0 Kudos

Hi Rajesh,

Sorry but this doesnt work...