cancel
Showing results for 
Search instead for 
Did you mean: 

Abap mapping problem

Former Member
0 Kudos

Hi friends,

I am trying Abap mapping in my scenario.

I am using DOM parsers

By default the first line of the output xml document generated is

<b><?xml version="1.0" ?></b>

But I want to add encoding to it. i.e it should be

<b><?xml version="1.0" encoding="UTF-8"?></b>

I have written the code to change this , but it is not working. my code is

data: temp1 type string.

temp1 = 'UTF-8'.

data : encode type ref to IF_IXML_ENCODING.

encode->set_character_set( CHARSET = 'UTF-8' ).

data: odocument type ref to if_ixml_document.

odocument = ixmlfactory->create_document( ).

odocument->SET_ENCODING( encode ).

This code is giving exception

- <u><CX_XMS_SYSTEM_ERROR>

<ID>APPLICATION_PROGRAM_ERROR</ID>

<P1>Z_COSTCENTER_ABAP_MAPPING</P1>

<P2>SAP-ABAP</P2>

<P3>UNCAUGHT_EXCEPTION</P3>

<P4>Program Z_COSTCENTER_ABAP_MAPPING=====CP Include Z_COSTCENTER_ABAP_MAPPING=====CM001 Line 1</P4>

<INFO />

<CATEGORY />

<AREA />

<RETRY />

</CX_XMS_SYSTEM_ERROR>

<CX_XMS_SYSERR_MAPPING />

</cls:CX_XMS_SYSERR_MAPPING>

- <cls:CX_SY_NO_HANDLER id="o215">

- <CX_ROOT>

<TEXTID>1F09B73915F6B645E10000000A11447B</TEXTID>

<PREVIOUS href="#o216" />

<KERNEL_ERRID>UNCAUGHT_EXCEPTION</KERNEL_ERRID>

- <INTERNAL_SOURCE_POS>

<PROGID>196</PROGID>

<CONTID>47</CONTID>

</INTERNAL_SOURCE_POS>

</CX_ROOT>

<CX_NO_CHECK />

- <CX_SY_NO_HANDLER>

<CLASSNAME><b>CX_SY_REF_IS_INITIAL</b></CLASSNAME>

</CX_SY_NO_HANDLER></u>

Can anyone please tell me how to add the encoding parameter in the Output XML document which we are building through ABAP MAPPING.

Thanks,

Yomesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Did you solve the problem?

Ernesto

Former Member
0 Kudos

Hi Yomesh,

Did you solve this problem. If yes could you please tell. I am also facing the same problem.

Regards,

Dinakar

STALANKI
Active Contributor
0 Kudos

Have you gone through abap mapping guiide in SDN?>