cancel
Showing results for 
Search instead for 
Did you mean: 

XML IDOC to Native IDOC Conversion

Former Member
0 Kudos

Hi,

We have a scenario, where we need to convert XML idoc into native idoc and write to a file. I am doing this based on

How To Convert an IDoc-XML structure to a flat file and vice versa in XI 3.0.

When I first executed the scenario, I was getting the following error

Z_ABAP_MAPPING_IDOC_TO_FLAT (type SAP-ABAP, kernel error ID UNCAUGHT_EXCEPTION) An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference.

After including the try-catch block, now i am just getting a blank file without any conversion.

Can anyone help me on this?

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi !

Please check this out:

Regards,

Matias

ps: please award points if helpful

Former Member
0 Kudos

As per the second link i set the breakpoint and tested the scenario.

i am getting the following errror

ID>APPLICATION_PROGRAM_ERROR</ID>

<P1>Z_ABAP_MAPPING_IDOC_TO_FLAT</P1>

<P2>SAP-ABAP</P2>

<P3>UNCAUGHT_EXCEPTION</P3>

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

<INFO />

<CATEGORY>Application</CATEGORY>

<AREA>MAPPING</AREA>

<RETRY>M</RETRY>

</CX_XMS_SYSTEM_ERROR>

<CX_XMS_SYSERR_MAPPING />

</cls:CX_XMS_SYSERR_MAPPING>

- <cls:CX_SY_NO_HANDLER id="o104">

- <CX_ROOT>

<TEXTID>1F09B73915F6B645E10000000A11447B</TEXTID>

<PREVIOUS href="#o103" />

<KERNEL_ERRID>UNCAUGHT_EXCEPTION</KERNEL_ERRID>

Former Member
0 Kudos

Hi,

It looks to be error in ABAP mapping

To test ABAP mapping in XI use the transaction SXI_MAPPING_TEST after creating a little scenario in the directory.

Or even you could do this with below sample code

Lets create one ABAP mapping class with the method IF_MAPPING~EXECUTE

data: obj type ref to zcl_abap_mapping_test.

data: source type xstring,

result type xstring.

data: param type ref to IF_MAPPING_PARAM,

trace type ref to IF_MAPPING_trace.

create object obj.

try.

CALL METHOD obj->IF_MAPPING~EXECUTE

EXPORTING

SOURCE = source

PARAM = param

TRACE = trace

IMPORTING

RESULT = result.

CATCH CX_MAPPING_FAULT .

ENDTRY.

This is a link very useful for ABAP Mapping :

http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm

Or may be think this exception you need to catch it in the ABAP..

This may help u- http://help.sap.com/saphelp_47x200/helpdata/en/55/bff20efe8c11d4b54a006094b9456f/content.htm

just cross verify with this guide-

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a4...

Thanks

swarup

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

It looks like mapping is not visible :(. Please check your configuration in exchange profile.

/wg

Former Member
0 Kudos

Hi !

Please check your code in case you are attempting to access a component using 'NULL' object reference (points to nothing).

Regards,

Matias.

Former Member
0 Kudos

The problem was with the control record. It was looking for field STATUS and that was not there in my input XML.