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