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: 

RUNT_ILLEGAL_SWITCH during CALL TRANSFORMATION

Former Member
0 Kudos
384

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

3 REPLIES 3

Former Member
0 Kudos
129

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.

0 Kudos
129

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

0 Kudos
129

Can anyone please help me?

Thank you

Nuno Silva