cancel
Showing results for 
Search instead for 
Did you mean: 

BLS to extract IDOC and save it in database

kiranks_1978
Explorer
0 Kudos

Hi anyone help me how to extract IDOC received in SAP MII and save it in our local database. Any sample BLS example available? please share.

Accepted Solutions (1)

Accepted Solutions (1)

HariCS23
Contributor
0 Kudos

Kiran, Attach a transaction in message processing rules your message listener/message name .

Transaction logic :

In your BLS,create input transaction parameter of xml type and link ReceivedMessageXML to that property in message processing rule .

once you get message in to your transaction, you process ( save ) that message.

Hope this helps.

Thanks

Hari

kiranks_1978
Explorer
0 Kudos

Hi Hari,

I have linked input transaction parameter to ReceivedMessageXML in processing rule. I have executed the tcode POIT from SAP and the IDOC is received in SAP MII(Message Monitor). In BLS transaction I have assigned the transaction XML to my local XML and tried to process that, but I am not getting any value in that XML when I displayed that in Tracer. can you please let me know what will be the issue?

saumya_govil
Active Contributor
0 Kudos

Hi Kiran,

Hope you have already linked the transaction in the message processing rule you created. And also the IDOC XML as the input parameter is linked to your transaction parameter.

I suggest that in your transaction, try to directly save the input XML (IDOC file) to a web folder location using XMLSaver action and do the following steps:

1. Trigger the IDOC SAP

2. Check if it is received in the message monitor

3. Check if the message was processed in the monitor and marked with status 'Success'.

4. Check the web folder location for your IDOC XML file.

Hope this helps!

Regards,

Saumya Govil

HariCS23
Contributor
0 Kudos

Kiran , You can not see it in tracer since your transaction would trigger at run time as soon as message come in based on processing rule . And there is no run time debugging available with MII to monitor that message in workbench in real time. You need include logic in BLS to store that XML some where ( web folder ) or DB to see that data.

Thanks

Hari

kiranks_1978
Explorer
0 Kudos

Hi Soumya,

Thanks for your valuable inputs. Can you please give the how to set path for web application folder? I have given D:\MyFolder\ks.xml and the IDOC trigger is failing. please let me know how to define the web folder path.

saumya_govil
Active Contributor
0 Kudos

Hi Kiran,

The web folder is the 'Web' tab in your MII workbench. You can use your existing project and create a folder in the project folder to save the IDOC files. For e.g. if your project name is 'DemoTest' you can create a folder in it like 'IDOCFiles' and use the path:

web://DemoTest/IDOCFiles to save the IDOC file into the location.

You can then navigate to the web folder and after refreshing the folder content you should be able to see the IDOC file saved as XML.

Hope this helps!

Regards,

Saumya Govil

kiranks_1978
Explorer
0 Kudos

Hi Saumya,

The xml file is saved under web folder but the file is empty. In message monitor the IDOC is triggering successfully and when i display the same and save the file in my system then the xml file (IDOC) is coming correctly. My question is why it is not saved in web folder as a xml content?

Regards,

Kiran

kiranks_1978
Explorer
0 Kudos

Hi Saumya,

Sorry for my previous comment.... now I am able to save the file in web folder and i am able to see the IDOC file. thanks for the help....

Regards,

Kiran

Answers (1)

Answers (1)

former_member202228
Active Participant
0 Kudos

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02bc706-15f2-2c10-1aab-a1927ada1...

Here Michael Appleby put together a very nice document on how to send an IDOC from SAP to MII.

If your issue is how to save the data in DB, I'd suggest you to browse the manufacturing examples since most of them are using SQL or flat file interactions.