Application Development and Automation 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: 
Read only

IDOC to XML convert

Former Member
0 Likes
14,136

Hi ALL,

Is there any FM that takes Idoc message as input and gives xml format?

Thanks

Bala Duvvuri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,958

You can convert the IDOC (idoc number) to XML using the function module "IDX_IDOC_TO_XML".

Regards

Vinod

Hi ALL,

Is there any FM that takes Idoc message as input and gives xml format?

Thanks

Bala Duvvuri

5 REPLIES 5
Read only

Former Member
0 Likes
4,958

You can specify an XML Port on a partner profile. I suspect this calls a Function Module. That is how I would find out.

Read only

Former Member
0 Likes
4,959

You can convert the IDOC (idoc number) to XML using the function module "IDX_IDOC_TO_XML".

Regards

Vinod

Read only

0 Likes
4,958

Vinod,

I just have idoc message HRMD_A.HRMD_A07.how would i get the xml format.what parameters do i need to pass to the fm which u mentioned

Thanks

Bala Duvvuri

Read only

0 Likes
4,958

Hi Bala,

The parameters you need to fill in IDX_IDOC_TO_XML are :-

CALL FUNCTION 'IDX_IDOC_TO_XML' "

EXPORTING

edidc40 = " edi_dc40 Control Record (IDoc)

def_typ = 'X' " char1 (X or SPACE)

syntax_check = 'X' " char1 (X or SPACE) for Syntax Check

tunnel = ' ' " char1 (X or SPACE)

rfc_codepage = " cpcodepage SAP character set identification

  • multi = 'X' (X or SPACE) " char1 Single-Character Flag

IMPORTING

xml_data = " string

TABLES

idoc_data_40 = " edi_dd40 IDoc Data Record for Interface to External System

EXCEPTIONS

CONVERSION_FAILED = 1 "

SYSTEM_ERROR = 2 " Internal Error

STRUCTURE_ERROR = 3 "

. " IDX_IDOC_TO_XML

You can also check FM IDOC_XML_TRANSFORM or IDOC_XML_DISPLAY . You need to pass the IDOC to this FM and get the output in xml format.

Hope it might be helpful.

Thanks,

Daya.

Edited by: daya mishra on Apr 29, 2010 11:14 AM

Read only

4,958

This function module will give XML structure only if the input parameter is idoc number.

You can use transaction code WE60 to generate the XML structure of IDOC type.

WE60 -> Enter Basic Type -> Select Menu Option "Documentation" -> XML Schema.

Regards

Vinod