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: 

How to work with transformation?

Former Member
0 Kudos

Hi all,

I have this code and I need to write too transformations to deserialize XML data into ABAP variable and structure


DATA request TYPE string .
DATA w_kunnr LIKE kna1-kunnr.
DATA : BEGIN OF w_struct ,
       appli TYPE string,
       kunnr LIKE kna1-kunnr,
       END OF w_struct.
CONCATENATE
  '<services>'
  '<service>'
  '<APPLICATION>APPLI01</APPLICATION>'
    '<TOSAP>'
  '<EMPLOYEE>00000036</EMPLOYEE>'
  '</TOSAP>'
  '</service>'
  '</services>'
INTO request.

* get the KUNNR number
* kunnr = services/service/tosap/employee
CALL TRANSFORMATION zgetkunnr
SOURCE XML request
RESULT kunnr = w_kunnr.

* get all structure
* w_struct-appli = services/service/application
* w_struct-kunnr = services/service/tosap/employee
CALL TRANSFORMATION zgetstruct
SOURCE XML request
RESULT struct = w_struct.

Can any one help please?

thanks

2 REPLIES 2

Former Member
0 Kudos

Hi,

Double click on the TRANSFORMATION statement in the program. This will take you to transformation creation screen. You have to choose if you need simple transformation or XSLT. If the requirement is simple transformation. But if the data is not correct this will lead to dumps.

How to write a transformation there are tutorials which help you do it.

Thanks,

Preetham S

0 Kudos

Actually, I already read some titorials, but they don't explaine how to use the XSLT transformation for a single variable or a structure!