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

Inbound IDOC using XML

Former Member
0 Likes
3,451

Hi,

I need to create an Inbound IDOC using Function modules using an XML file as Input.

I am using mySAP ERP 2004(WAS 6.4).

IDOC type : HRMD_A05

Message Type : HRMD.

I am using the FM's in an ABAP report for testing, reading the data from the XML File using the FM GUI_UPLOAD .

I tried using the FM <b>IDOC_INBOUND_XML_VIA_HTTP</b>,with import parameters XML_STREAM, CONTENT_LENGTH, CONTENT_TYPE, REMOTE_ADDR.(ALL Type Strings)

This FM creates the IDOC successfully but i do not get the status record for the IDOC as there are no export parameters or tables where i can get the value.

I am trying using the FM <b>IDOC_INBOUND_XML_SOAP_HTTP</b>,with import Parameters as <b>XML_STREAM type XSTRING</b>,and there is the export parameter ASSIGN ,type IDOC_ASSIGN_TAB and i was wondering if this could return the status.

I used the same XML and used the FM "SCMS_STRING_TO_XSTRING", to convert the file input string into XSTRING.

On executing this i get the exception,"NO DATA RECEIVED" .

Can anybody Please Tell me

1)How to get the status of an IDOC if i use the FM IDOC_INBOUND_XML_VIA_HTTP ?

2)How to use the FM IDOC_INBOUND_XML_SOAP_HTTP ?

3)Is there any other way to create an IDOC with XML input?

Thanks,

regards,

Siddhartha Jain

1 ACCEPTED SOLUTION
Read only

sid-desh
Product and Topic Expert
Product and Topic Expert
0 Likes
2,003

Hi Siddhartha,

I feel if you can just copy the FM to a Z FM and then return the value of idoc number from the FM, that i feel will solve your problem because then you can select from EDIDC and get the status.

Regards

Sidharth

6 REPLIES 6
Read only

sid-desh
Product and Topic Expert
Product and Topic Expert
0 Likes
2,004

Hi Siddhartha,

I feel if you can just copy the FM to a Z FM and then return the value of idoc number from the FM, that i feel will solve your problem because then you can select from EDIDC and get the status.

Regards

Sidharth

Read only

Former Member
0 Likes
2,003

HI Sidharth,

Thanks for replying.

Using The FM IDOC_INBOUND_XML_VIA_HTTP,i can post the IDOC via XML string,but i do not get the document number of the generated IDOC.I thought of explicitly checking the status from the EDIDC table,but due to unavailabilty of DOCUMENT number,the primary key ,the option left to get the DOCNUMBER and STATUS would be using the create date and create time along with other parameters.

What i did was,

1)Read XML using GUI_UPLOAD.

2)Create IDOC using

IDOC_INBOUND_XML_VIA_HTTP

3)Read status as:

SELECT * FROM EDIDC INTO TABLE Idoc_cntrl_rec_40

WHERE

CRETIM = SY-UZEIT AND

DIRECT = '2' AND

MESTYP = 'HRMD_A' AND

SNDPOR = 'ERPPORT ' AND

SNDPRT = 'LS' AND

SNDPRN = 'IDSCLNT800' AND

RCVPRT = 'LS' AND

RCVPRN = 'HNECLNT400' AND

CREDAT = sy-datum.

But this might give a problem as this FM would be called from an application,accessed by many users simultaneously and it might create more than one IDOC at the same time.I mean can we be sure that we get the Correct/Relevant IDOC Number and Status using this method ?

Please correct me if i'm wrong.

So,i was thinking of using the FM IDOC_INBOUND_XML_SOAP_HTTP ,which has an Export parameter,which might give the status.

Any IDeas?

Thanks,

Regards,

Siddhartha

Read only

Former Member
0 Likes
2,003
Read only

0 Likes
2,003

HI Nagarajan,

I had checked the first link mentioned by you and activated the required service from Transacttion SICF,but still it didn't help.

The second link points to the IDOC Adaptor for XI,guess it won't help as i'm not using XI.

I want to pass XML data read from file and call a FM which creates and posts and IDOC into R/3 and returns the IDOC Number and Status.

For this i found the FM's IDOC_INBOUND_XML_SOAP_HTTP and IDOC_INBOUND_XML_VIA_HTTP.

The FM IDOC_INBOUND_XML_VIA_HTTP accepts xml as string and posts IDOC succesully,but i do not get the status and IDOC Number.

The IDOC_INBOUND_XML_SOAP_HTTP accepts xml as xstring,so i used the FM SCMS_STRING_TO_XSTRING to convert the same xml string to xstring and pass it to the FM.But it gives an error 'NO DATA RECEIVED'.

If i make few changes to the XML doc,to include SOAP envelope ,like

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

to

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body><IDOC BEGIN="1">.......</IDOC></soap-env:Body></soap-env:Envelope>

I get the error,the tag <IDOC BEGIN="1"> not found ,the IDOC XML should be of format <IDOC BEGIN="1"> <IDOC>.

Can anybody please help on what to do/how to proceed.

Thanks,

Regards,

Siddhartha

Read only

0 Likes
2,003

Siddhartha,

Did you ever get this working. I want to post IDOC as a xml from WebLogic (BEA Web/App Server). Did you ever get this working? I got the BAPI through WebService from BEA Web/App Server. I want to do the same with IDOC. If I can do the same with WebService and you have any pointer that would be helpful too.

Thanks,

Sanjay Amin

Read only

0 Likes
2,003

Nagarajan,

Did you ever get this working. I want to post IDOC as a xml from WebLogic (BEA Web/App Server). Did you ever get this working? I got the BAPI through WebService from BEA Web/App Server. I want to do the same with IDOC. If I can do the same with WebService and you have any pointer that would be helpful too.

Thanks,

Sanjay Amin