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

convert IDOC data to XML format.

pankajs_dwivedi
Participant
0 Likes
13,364

Hi All,

I have to convert the IDOC data generated in SAP for ORDER05 to XML format. If any one has worked on it please send the details. Also if this FM IDOCS_OUTPUT_IN_XML_FORMAT is to be used then please give the details of it as how it works and what paramters are required for it.

1 ACCEPTED SOLUTION
Read only

ashok_kumar24
Contributor
0 Likes
5,254

Hi Pankaj S Dwivedi ,

Follow the procedure

IDOC to XML Convertion using ALE Interface

-


1) Send an outbound IDOC data(MATMAS) to a flat file(XML) on client1(SENDER).

- Create File Port (WE21) of XML Type for outbound file.

- Specify the Physical directory and file under the Outbound File tab

- Maintain Distribution Model (BD64) for sender ->receiver system.

- Create Partner Profile (WE20) for logical system.

- You can use this program RBDSEMAT (t/code BD10) to generate IDoc MATMAS file(s).

_ Then you can FTP the file(s) to receiver system.

2) Upload the flat file as an IDOC on the inbound sytem

which is Client2(RECIEVER).

- Create File Port (WE21) for inbound file.

- Maintain Distribution Model (BD64) for receiver -> sender system.

- Create Partner Profile (WE20) for logical system.

- You can use this program RSEINB00 to upload IDoc MATMAS file(s).

A sample scenario for idoc generation

-


Sending System(Outbound ALE Process)

Tcode SALE ? for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 ? Create Model View

Tcode BD82 ? Generate partner Profiles & Create Ports

Tcode BD64 ? Distribute the Model view

Message Type MATMAS

Tcode BD10 ? Send Material Data

Tcode WE05 ? Idoc List for watching any Errors

Receiving System(Inbound ALE )

Tcode SALE ? for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 ? Check for Model view whether it has distributed or not

Tcode BD82 -- Generate partner Profiles & Create Ports

Tcode BD11 Getting Material Data

Tcode WE05 ? Idoc List for inbound status codes

ALE IDOC Steps

Sending System(Outbound ALE Process)

Tcode SALE ?3 for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 !V Create Model View

Tcode BD82 !V Generate partner Profiles & Create Ports

Tcode BD64 !V Distribute the Model view

This is Receiving system Settings

Receiving System(Inbound ALE )

Tcode SALE ?3 for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 !V Check for Model view whether it has distributed or not

Tcode BD82 -- Generate partner Profiles & Create Ports

Tcode BD11 Getting Material Data

Tcode WE05 !V Idoc List for inbound status codes

Message Type MATMAS

Tcode BD10 !V Send Material Data

Tcode WE05 !V Idoc List for watching any Errors

-


STEP 1)a Goto Tcode SALE

Click on Sending & Receiving Systems-->Select Logical Systems

Here Define Logical Systems---> Click on Execute Button

go for new entries

-System Name : ERP000

-Description : Sending System

-System Name : ERP800

-Description : Receiving System

press Enter & Save

it will ask Request

if you want new request create new Request orpress continue for transfering the objects

B) goto Tcode SALE

Select Assign Client to Logical Systems-->Execute

000--> Double click on this

Give the following Information

-Client : ERP 000

-City :

-Logical System

-Currency

-Client role

Save this Data

Step 2) For RFC Creation

Goto Tcode SM59-->Select R/3 Connects

Click on Create Button

RFC Destination Name should be same as partner's logical system name and case sensitive

to create the ports automatically while generating the partner profiles

give the information for required fields

RFC Destination : ERP800

Connection type: 3

Description

Target Host : ERP000

System No:000

lan : EN

Client : 800

User : Login User Name

Password:

save this & Test it & RemortLogin

STEP 3) Goto Tcode BD64 -- click on Change mode button

click on create moduleview

short text : xxxxxxxxxxxxxx

Technical Neme : MODEL_ALV

save this & Press ok

select your just created modelview Name :'MODEL_ALV'.

goto add message type

Model Name : MODEL_ALV

sender : ERP000

Receiver : ERP800

Message type :MATMAS

save & Press Enter

STEP 4) Goto Tcode BD82

Give Model View : MODEL_ALV

Partner system : ERP800

execute this by press F8 Button

it will gives you sending system port No :A000000015(Like)

STEP 5) Goto Tcode BD64

select the modelview

goto >edit>modelview-->distribute

press ok & Press enter

STEP 6) goto Tcode : BD10 for Material sending

Material : mat_001

Message Type : MATMAS

Logical System : ERP800

and Execute

STEP 7)goto Tcode : BD11 for Material Receiving

Material : 100-300

Message Type : MATMAS

and Execute --> 1 request idoc created for message type Matmas

press enter

Here Master Idoc set for Messge type MATMAS-->press Enter

1 Communication Idoc generated for Message Type

Now go to the physical directory and check your idoc converted as an XML File.

Good Luck ...Reward me for the same !!!

Thanks

Ashok.N

9 REPLIES 9
Read only

Former Member
0 Likes
5,254

Hi Pankaj,

chk this also 'IDOC_XML_TRANSFORM'

Read only

Former Member
0 Likes
5,254

Hi,

IDX_IDOC_TO_XML

Regards

vijay

Read only

Former Member
0 Likes
5,254

hi

Just pass the IDoc Document no in the FM - IDOC_XML_TRANSFORM.

it will transform the IDoc in XML format

Regards,

Richa

Read only

Former Member
0 Likes
5,254

Hi Pankaj,

You can setup file port (t/code <b>WE21</b>) for XML.

Please ensure your partner profile pointed to this new XML port. In this case, the output will be in XML format automactically without doing any format conversion when you generate and output the sales order IDoc.

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

Read only

ashok_kumar24
Contributor
0 Likes
5,255

Hi Pankaj S Dwivedi ,

Follow the procedure

IDOC to XML Convertion using ALE Interface

-


1) Send an outbound IDOC data(MATMAS) to a flat file(XML) on client1(SENDER).

- Create File Port (WE21) of XML Type for outbound file.

- Specify the Physical directory and file under the Outbound File tab

- Maintain Distribution Model (BD64) for sender ->receiver system.

- Create Partner Profile (WE20) for logical system.

- You can use this program RBDSEMAT (t/code BD10) to generate IDoc MATMAS file(s).

_ Then you can FTP the file(s) to receiver system.

2) Upload the flat file as an IDOC on the inbound sytem

which is Client2(RECIEVER).

- Create File Port (WE21) for inbound file.

- Maintain Distribution Model (BD64) for receiver -> sender system.

- Create Partner Profile (WE20) for logical system.

- You can use this program RSEINB00 to upload IDoc MATMAS file(s).

A sample scenario for idoc generation

-


Sending System(Outbound ALE Process)

Tcode SALE ? for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 ? Create Model View

Tcode BD82 ? Generate partner Profiles & Create Ports

Tcode BD64 ? Distribute the Model view

Message Type MATMAS

Tcode BD10 ? Send Material Data

Tcode WE05 ? Idoc List for watching any Errors

Receiving System(Inbound ALE )

Tcode SALE ? for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 ? Check for Model view whether it has distributed or not

Tcode BD82 -- Generate partner Profiles & Create Ports

Tcode BD11 Getting Material Data

Tcode WE05 ? Idoc List for inbound status codes

ALE IDOC Steps

Sending System(Outbound ALE Process)

Tcode SALE ?3 for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 !V Create Model View

Tcode BD82 !V Generate partner Profiles & Create Ports

Tcode BD64 !V Distribute the Model view

This is Receiving system Settings

Receiving System(Inbound ALE )

Tcode SALE ?3 for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 !V Check for Model view whether it has distributed or not

Tcode BD82 -- Generate partner Profiles & Create Ports

Tcode BD11 Getting Material Data

Tcode WE05 !V Idoc List for inbound status codes

Message Type MATMAS

Tcode BD10 !V Send Material Data

Tcode WE05 !V Idoc List for watching any Errors

-


STEP 1)a Goto Tcode SALE

Click on Sending & Receiving Systems-->Select Logical Systems

Here Define Logical Systems---> Click on Execute Button

go for new entries

-System Name : ERP000

-Description : Sending System

-System Name : ERP800

-Description : Receiving System

press Enter & Save

it will ask Request

if you want new request create new Request orpress continue for transfering the objects

B) goto Tcode SALE

Select Assign Client to Logical Systems-->Execute

000--> Double click on this

Give the following Information

-Client : ERP 000

-City :

-Logical System

-Currency

-Client role

Save this Data

Step 2) For RFC Creation

Goto Tcode SM59-->Select R/3 Connects

Click on Create Button

RFC Destination Name should be same as partner's logical system name and case sensitive

to create the ports automatically while generating the partner profiles

give the information for required fields

RFC Destination : ERP800

Connection type: 3

Description

Target Host : ERP000

System No:000

lan : EN

Client : 800

User : Login User Name

Password:

save this & Test it & RemortLogin

STEP 3) Goto Tcode BD64 -- click on Change mode button

click on create moduleview

short text : xxxxxxxxxxxxxx

Technical Neme : MODEL_ALV

save this & Press ok

select your just created modelview Name :'MODEL_ALV'.

goto add message type

Model Name : MODEL_ALV

sender : ERP000

Receiver : ERP800

Message type :MATMAS

save & Press Enter

STEP 4) Goto Tcode BD82

Give Model View : MODEL_ALV

Partner system : ERP800

execute this by press F8 Button

it will gives you sending system port No :A000000015(Like)

STEP 5) Goto Tcode BD64

select the modelview

goto >edit>modelview-->distribute

press ok & Press enter

STEP 6) goto Tcode : BD10 for Material sending

Material : mat_001

Message Type : MATMAS

Logical System : ERP800

and Execute

STEP 7)goto Tcode : BD11 for Material Receiving

Material : 100-300

Message Type : MATMAS

and Execute --> 1 request idoc created for message type Matmas

press enter

Here Master Idoc set for Messge type MATMAS-->press Enter

1 Communication Idoc generated for Message Type

Now go to the physical directory and check your idoc converted as an XML File.

Good Luck ...Reward me for the same !!!

Thanks

Ashok.N

Read only

Former Member
0 Likes
5,254

Hi,

Check the following FM:-

IDOCS_OUTPUT_IN_XML_FORMAT

IDX_IDOC_TO_XML

IDOC_XML_DISPLAY

IDOC_XML_TRANSFORM

TABLEFRAME_IDOC_XML1

TABLEPROC_IDOC_XML1

Sameena

Message was edited by: sameena attarwala

Read only

Former Member
0 Likes
5,254

HI,

I have the similar kind of requirement, and I have created the XML port and assigned that port in the partner profiles.

The XML file is getting generated on the application server on the given path in port, however, the file contents are not complete.

It only contains the IDOC header information. Like, IDOC number, Clinet, IDOC basic type, Message type, Sender system, creation time, creation date.

However the data present in the segments of IDOCs is not getting displayed in the XML file generated.

Can you please guide me, if there is anything extra setting needs to be done for this case.

Thanks in advance for the replies.

Regards

Anuja.

Read only

0 Likes
5,254

Hi Anuja,

Can you please let me know, how to attach PORT to Partner Profile...

Thanks in advance...

Read only

Former Member
0 Likes
5,254

Hello,

Try this part of code :

   

DATA : lo_idoc TYPE REF TO cl_idoc_xml1.

* Create Idoc Object
    CREATE OBJECT lo_idoc
      EXPORTING
        docnum             = iv_docnum
      EXCEPTIONS
        error_loading_idoc = 1
        error_building_xml = 2
        OTHERS             = 3.

    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                 RAISING no_idoc_xml_loaded.
    ENDIF.

* Convert to XML
    CALL METHOD lo_idoc->get_xmldata_as_string
      IMPORTING
        data_string = ev_xml_code.

Kind regards,

Pascal