cancel
Showing results for 
Search instead for 
Did you mean: 

Design Input: Checking IDOC creation

Former Member
0 Kudos

Hi All,

I am having a requirement where i am picking a XML file from FTP server and then using a standard idoc sending the message to SAP system and if the idoc creation is successful then i have to send the same source XML file to web service. I am planning to achieve this requirement using BPM.

After reading blogs/articles on SDN i am able to develop a BPM, but i am having a doubt while checking the creation of idoc in SAP system (it might be possible that idoc may failed due to application errors, in such cases i don't want to send the message to Web service).

So please tell me how i can check in my BPM if the idoc has been created in SAP without any application errors and then proceed for the next send step of BPM (i.e send message to web service)??

Regards,

Vasant

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

you can also do that without a BPM

1. send an XML to IDOC and file folder "TARGET"

2. once the idoc gets posted ok you can start a WF which will send a message (can you do that in many ways:

a) custom WF

b) rfc call in a user exit

c) proxy in a user exit

3. the message which you will send will place a "flag" file in the "TARGET" folder

4. your second scenario will be - file to WS - and file will look for the "flag" file and will only pull the original XML file once the flag is there (this can be achived using the standard file adapter)

this way you don't need a BPM and your flows will work very nicely too

BTW

how to work with flag files:

Q4 on this wiki:

http://wiki.sdn.sap.com/wiki/display/XI/Sender+File+Adapter+Frequently+Asked+Questions

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

I like your solution but i have a doubt related to point 2, i am using standard cremas Idoc to send the message to SAP system so all the 3 options which you have mentioned will work in my case also?

I dont have any ABAP knowledge, so wanted to ask which option i can use and how the custom program can be triggered just after the idoc creation means where the exact linking will happen?

Thanks!!

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>so all the 3 options which you have mentioned will work in my case also?

check out this doc:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3022e404-377d-2910-3d99-d7d80305f...

section: Confirmation Message / Custom IDoc type

custom report - REPORT ZRBDSTATE

is included

and yes with this the whole scenario will work perfectly,

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

Thanks for the reply!!

I will check this and get back to you.

Thanks!!

Former Member
0 Kudos

Hi Michal,

One more question: i will be receiving multiple XML files during a short frame of time.

So suppose i will be getting 10 xml files, after that i will create 10 CREMAS idocs in SAP system and parallely will move those files to some folder on PI system . After that i will generate a idoc ack for each inbound message and create a ACK*.xml (flag) file on the same folder where i have dumped the original XML files.

So how i will maintain the correlation and make sure that the original xml will be picked for its corresponding flag XML file? Please confirm.

Thanks!!

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

both the flag and the original need to have the same name

and this way once the flag filenane.flag file will reach the folder the correct XML will be picked up

you can name the file (dynamic configuration) with business partner number

so you don't have to store it in any special way - just get it also in the acknowledgment message

this is the easiest way but you can do it more complex too

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

I am able to achieve half of my scenario using yours approach (steps 1,3 and 4) and my ABAP developer  is trying to create a report which will trigger a ZALEAUD Idoc (having LIFNR number from cremas Idoc) to PI but still i want to try this requirement using BPM also and this is what i have done so far (scenario is File -> IDOC -> Receiving Aleaud):

1) Created a BPM using using  these steps: "Receiving Cremas Idoc - > Sending Cremas IDOC to SAP  -> Receiving ALEAUD Idoc"

2) Now for maintaining the correlation i am using the links which Greg has posted above. So for testing I have created a standalone RFC lookup and able to get my PI Idoc

Number from table "IDXRCVPOR" using the (existing) message id and luckily it is working fine also.

But the problem is message id wont be accessible in BPM, so i have to use the code for fetching message id and RFC lookup at the Interface determination step, So my problem is exactly in which two steps i have to use the mapping at Interface determination level??

Note: I am using PI Idoc number correlation between Send Cremas Idoc step and Receive Aleaud Step.

Regards!!

Answers (1)

Answers (1)

former_member184681
Active Contributor
0 Kudos

Hi Vasant,

All you need to meet your requirement is acknowledgements. If you only want to verify IDoc creation and delivery to the receiver (as in the topic of the question), use PI's transport acknowledgements, as described in this blog:

If you want application acknowledgement, so want to check if the IDoc was not only created, but also processed successfully at the receiver, use the ALEAUD IDoc acknowledgements. Many aspects of it are covered in this thread:


Regards,

Greg