Skip to Content
author's profile photo
Former Member

Dynamic parameters for CALL TRANSFORMATION ID

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Posted on Apr 06, 2004 at 05:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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...

  • Posted on Apr 20, 2004 at 09:10 AM

    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

    Add comment
    10|10000 characters needed characters exceeded