2006 Jun 16 9:42 AM
Hello all.
I am trying to use a SIMPLE TRANSFORMATION to transforma a ABAP internal table into XML.
When i use the CALL TRANSFORMATION i am getting the exception CX_INVALID_TRANSFORMATION with the error RUNT_ILLEGAL_SWITCH.
I checked the SIMPLE TRANSFORMATION and everything seems ok.
Anyone knows why could this be happening?
Thank you
Nuno Silva
2006 Jun 16 9:45 AM
Hi nuno,
There might be some minor mistake in your code
due to which it might be giving error.
1. itab --- > xml
xml ---> itab.
2. This program will do both.
(just copy paste in new program)
3.
REPORT abc.
*----
DATA
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.
DATA: xml_out TYPE string .
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
DATA: xmlupl TYPE string .
FIRST PHASE
FIRST PHASE
FIRST PHASE
*----
Fetch Data
SELECT * FROM t001 INTO TABLE t001.
*----
XML
CALL TRANSFORMATION ('ID')
SOURCE tab = t001[]
RESULT XML xml_out.
*----
Convert to TABLE
CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
EXPORTING
i_string = xml_out
i_tabline_length = 100
TABLES
et_table = itab.
*----
Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'd:\xx.xml'
TABLES
data_tab = itab.
SECOND PHASE
SECOND PHASE
SECOND PHASE
BREAK-POINT.
REFRESH t001.
CLEAR t001.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:\XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
LOOP AT upl.
CONCATENATE xmlupl upl-f INTO xmlupl.
ENDLOOP.
*----
XML
CALL TRANSFORMATION ('ID')
SOURCE XML xmlupl
RESULT tab = t001[]
.
BREAK-POINT.
regards,
amit m.
2006 Jun 16 9:56 AM
Hello Amit.
I need to use my own transformation so i cant use ('ID').
I made a few changes and right now i am getting the same exception but i am getting a diferent message.
It now says "Type of source and target must always be different for transformation".
Do you know why is this happening? i have had this problem before and it started working without me knowing why. So now i would like to know why do i get this problem
Thank you
Nuno Silva
2006 Jun 16 10:16 AM