Skip to Content
Jan 25, 2011 at 02:28 PM

Generating and transferring purchase requisition IDoc


In ECC 6.0 there exists ALE_PR_CREATE which gave us all the required fields for generating the IDoc that we needed to transfer to our JCo program. Once the IDoc was generated using this program, it's status was set to '30' automatically.

The next step in order to send this generated IDoc to the designated port was to make use of the standard program RSEOUT00 passing the message type so that it sends all IDocs, of that particular message type (PREQCR and PREQDL in our case) and having a status of 30, to the port, changing the status to 12 once this operation is completed.

Since it was a standard program , I used the same logic in 4.6C. Unfortunately, the function module ALE_PR_CREATE does not exist in 4.6C.


Why 2 Function modules? Here's why...

The first function module gave us all the required fields except one - the deletion indicator.

Keep in mind that this field was also provided by ALE_PR_CREATE in ECC 6.0 system thus eliminating the need to look elsewhere.

So, to satisfy our requirement of getting the deletion indicator for deleted items of a particular Purchase requisition, we found the second mentioned function module - ALE_REQUISITION_DELETE.

This threw another problem in front of us...

This function module gave us only the purchase requisition number, item number and deletion indicator. All the other data fields that we required for our java app to process the IDoc were missing.

In order to solve this issue, we have designed our program to generate 2 IDocs one after the other. First using ALE_REQUISTION_CREATE and next using ALE_REQUISITION_DELETE in sequence.

This gives us all the fields.

The next problem was that the generated IDocs were having the status 03 (Data passed to port. OK.) but the Java application never seemed to receive the generated IDocs.

A search on SDN led me to check the IDoc queue in SMQ1, a case of stuck IDocs in SM58 and also changing IDoc status in BD75 all in vain.

Finally, on debugging the RSEOUT00 program, found out that it is checking for the status '30' (IDoc ready to be sent to port) which is hard coded in the program.

On doing further research on SDN, find some resources that suggested various function modules.

Tried out all of them one after the other.

By trial and error, finally stumbled upon the Function Module 'DEQUEUE_ES_EDIDOCS' that acted as a replacement to using the RSEOUT00 program.

After the IDoc is generated, just passing the IDoc number to this Function module sends it to the port and this was successfully received by our Java app.

Posting this on SDN for the general benefit.

Has anyone faced any similar issues? Let us know.