cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic parameters for CALL TRANSFORMATION ID

Former Member
0 Kudos

How can I provide CALL TRANSFORMATION parameters dynamically as internal table when the appropriate elements are object references?

Example:

I want to transform several ABAP objects to XML. Calling CALL TRANSFORMATION for each object itself does work - using

CALL TRANSFORMATION ID

SOURCE OBJECT_REF = my_object

RESULT XML result.

But by using this method I get the XML wrapper information (<asx:abap version = "1.0" ....) for each object. To avoid the unnecessary redundacy of the wrapper information I try to use the CALL TRANSFORMATION statement only once and to provide the list of objects in an internal table which obviously has to be of type ABAP_TRANS_SRCBIND_TAB.

But using this type definition I can't assign my_object to the value field of the internal table because the type

of ABAP_TRANS_SRCBIND-value isn't convertable to an object reference?

Any ideas, how I can manage this?

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_bresch
Employee
Employee
0 Kudos

Hi Michaela,

you have to pass a (data) reference pointing to your object reference using GET REFERENCE OF ... INTO ..., e.g.

DATA: SRCBIND TYPE ABAP_TRANS_SRCBIND.

DATA: SRCBIND_TAB TYPE ABAP_TRANS_SRCBIND_TAB.

SRCBIND-NAME = 'OBJECT_REF'.

GET REFERENCE OF MY_OBJECT INTO SRCBIND-VALUE.

APPEND SRCBIND TO SRCBIND_TAB.

CALL TRANSFORMATION ID

SOURCE (SRCBIND_TAB)

RESULT XML RESULT.

Regards

Stefan

athavanraja
Active Contributor
0 Kudos

Hi,

You can do the following to achive what you are looking for.

CALL TRANSFORMATION ID

SOURCE OBJECT_REF1 = my_object1

OBJECT_REF2 = my_object2

OBJECT_REF3 = my_object3

OBJECT_REF4 = my_object4

OBJECT_REF5 = my_object5

RESULT XML result.

Regards

Raja

Former Member
0 Kudos

Thanks for your answer. But as I have to read hundreds of objects from the database which I want to transform I need to provide the information dynamically. Something like

CALL TRANSFORMATION ID

SOURCE (itabsrc)

RESULT XML result.

where itabsrc is an internal table which contains the binding names and object references.

I wonder if the optional addition OBJECTS could do the job. But I am not sure whether this is supported by the predefined transformation ID...