Skip to Content
0
Jul 06, 2018 at 06:10 AM

Dynamic element specification in call transformation

563 Views

Hello, I'm using call transformation to convert xml to abap structure.

call transformation demo_id_upper_lower "id 
parameters mode = 'UP' 
source xml asxml_str 
result paymentrequest = abap_out. 

This works as expected and the data is mapped to abap structure successfully. 'paymentrequest' being the root tag here. Is there a way to specify a variable containing the tag name instead of the tag directly in the result.

Eg. data(my_var) = 'paymentrequest'. 
call transformation demo_id_upper_lower "id 
parameters mode = 'UP' 
source xml asxml_str 
result my_var = abap_out. 

In this case there's no exception as such but then there's no conversion(I think it tries to find 'my_var'). I'm trying to encapsulate the conversion in a method/fm, hence the requirement.

Note: I have also tried assigning the element name to a field symbol. But that too didn't work.