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: 

Get IDoc number for IDoc generated through RBDMIDOC

Former Member
0 Kudos

Hi All,

I have a requirement where in I need to send Vendor master information through CREMAS to PI system. I am using change pointer and batch job to trigger RBDMIDOC and send IDocs.

In case the IDoc fails a mail needs to be triggered to concerned person giving vendor number, Idoc number and date. Can anyone suggest any user exit/BADI where this can be done ??

Note: system is 4.7C.

3 REPLIES 3

Former Member
0 Kudos

Hi Chinmay

IDOC's are created for CREMAS using the FM MASTERIDOC_CREATE_CREMAS. There are plenty of Enhancement spots/ Customer Functions available in this FM. But none of them can provide you the IDOC number, as it will be generated only after calling the FM MASTER_IDOC_DISTRIBUTE, which is at the end. What i would suggest you is to, create a implicit enhancement spot after MASTER_IDOC_DISTRIBUTE and export the IDOC number to memory. This can be imported in the calling program and sent by mail.

Regards

Ranganath

0 Kudos

There is only 1 customer Exit FM "EXIT_SAPLKD01_001." which is called inside MASTERIDOC_CREATE_CREMAS but it is of no use.

Also as i am owrking on 4.7C there is no enhancement framework available to get the Idoc number after "MASTER_IDOC_DISTRIBUTE".

If idoc goes into error it triggeres an workflow by calling FM IDOC_ERROR_WORKFLOW_START with event EDI0. But unfortunately i have not worked in depth on this and i dont know how to trigger email through this workflow call.

0 Kudos

Hi Chinmay

I didn't knew you were in 4.7. Since you mentioned about the details of the workflow getting triggered, here are the options i can think of.

In case of error it is triggering the standard task 00007989 which you can check in PFTC. This task calls the method ERRORPROCESS from Business Object IDOCAPPL. My suggestion here would be to create a subtype of BO IDOCAPPL in SWO1 transaction and add additional logic in method ERROR_PROCESS to send the mail. The details of the IDOC number and other things are available in the task container of TS00007989. But make sure you do it specific for your message type, as this will be triggered for all message types. And then change the BO and method reference in task 00007989 to point to your new BO method.

Other options would be to delegate the BO IDOCAPPL to a new Z BO, and then modify the method IDOCAPPL. This way you don't have to change the task BO assignment, as it will implicitly use the Z BO method. May be you can get in touch with your Workflow consultant who can help you more on this.

Regards

Ranganath