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: 

Process Orders, send idoc (LOIPRO) while creation/modification(COR1+BADI)

Former Member
0 Kudos

Hi all,

I'm just trying to send standard LOIPRO idoc when a process order is saved on COR1 / COR2 transactions. First of all I've decided to do it via user-exit but I've seen that the order number (AUFNR) is not determinated yet, so finally I'm doing it with the BADI WORKORDER_UPDATE (method BEFORE_SAVE) where there is all the data ok.

Until this point all goes fine. To send the standard idoc there is the program RCCLORD but as the order is not saved on the system tables I cannot do a submit, so I'm doing a call to the function where the idoc is send of the program ( CLOI_MASTERIDOC_CREATE_LOIPRO ). All seems to be ok, but finally it goes allways to a short dump because at the end of the function there is a commit instruction ( and it seems it is not possible into a BADI ).

There is a easy way to do it or am I on the correct way?

I'm trying a lot of possibilities ( and it doesn't work for distinct causes ) but allways the start point is the avobe process.

Many thanks in advance.

Legoles_

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this program which is a modification of the SAP Standard Program.

https://wiki.sdn.sap.com/wiki/display/Snippets/ProductionOrderIdoc+Program

cheers

Aveek

8 REPLIES 8

Former Member
0 Kudos

Bump This Thread Up!

I have the same requirement!

I want to immediately trigger the outbound LOIPRO IDOC when someone creates/changes a PP Order in the CORn transactions.

Any one know how to do this without resorting to batchjobs?

Thanks!!!

Former Member
0 Kudos

Ok, I believe I have this solved...

CORn

--> Create or change a PP order, release and save

BADI WORKORDER_UPDATE~BEFORE_UPDATE

--> Do your checks and call a custom function module (ZZ_SEND_IDOC) sending the aufnr, matnr, and werks. Cal this FM starting new task destination 'none'.

ZZ_SEND_IDOC (RFC-enabled)

--> wait up to 60 seconds (so update finishes)

--> add code to see if the record is no longer locked

--> Fill parameter table rsparams with aufnr, matnr, werks, logical system, and mess type

--> submit RCCLORD and return

parallel processing rules say you should not use a submit in the FM but it is working for me.

With this I can avoid using batch jobs to send these out. Yay.

0 Kudos

Hello, i have done the same thing( Submit program RCCLORD with parameters) but it does not work.

Could you please help?Do you think it has anything to do with  authorization on the program RCCLORD?

0 Kudos

Problem solved!

Had to add "FREE MEMORY ID 'LOIAUFNRTAB' " before doing the submit.

Former Member
0 Kudos

Hi,

Check this program which is a modification of the SAP Standard Program.

https://wiki.sdn.sap.com/wiki/display/Snippets/ProductionOrderIdoc+Program

cheers

Aveek

0 Kudos

I all.

Thanks for your answers, this is an old problem finally resolved as it says on the last one, we had created a Z FM which process the idoc outbound. This is because the submit to the RCLORD program was not a good way because our client wants an inmmediatly information between R3 and PI without the wait of 60 seconds nor the possible wait to a blocking status...

Thanks a lot, I will close de thread but for future readers say that we still don't know if it is really possible to do what we want without the standard code modification.

Kind regards,

0 Kudos

Hi I have exactly the same requirement and I am strill not able to find the solution, Can you please let me know, How you did it?

Former Member
0 Kudos

Hello,

Do you remember how you solve this problem? We are facing the same problem and I can't find an answer.

Thanks,

Sara