Application Development 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: 

Generating and transferring purchase requisition IDoc

kartefact
Participant
0 Kudos

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.

The alternative was to use ALE_REQUISITION_CREATE and ALE_REQUISITION_DELETE.

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.

KR
3 REPLIES 3

Former Member
0 Kudos

Hi,

Im using the non-enjoy BAPI and BAdI for PR and for deletion the outbound IDoc gets send out all the way but for create outbound IDoc it gets stuck in status 30. I did try the FM that you suggested but doesnt have any effect.

FMs that is being used inside my BAdI:

ALE_REQUISITION_CREATE

ALE_REQUISITION_DELETE

Thanks,

Arash

0 Kudos

Once the IDoc is generated, it will be in status 30. Have you used the RSEOUT00 standard ABAP program to send the generated IDoc to the port? Once this is done, the status should change to successful.

KR

Former Member
0 Kudos

Hi Karthikeyan,

Could you please post some sample code which uses the FM ALE_PR_CREATE to generate PR IDOCS?

Thank a lot in advance!