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: 

co01 user exit after save and database commit.

Former Member
0 Kudos

I have came across a requirement:

While saving production order (CO01) transaction, saved is performed after release.

Out of four operations from production order first two should get automatically confirmed.

Say i have four oprations:

The first two operation PRESS 2 & AGEING MACHINE should get confimed while saving prod order.

The problem is i am using Smod Enhancement PPCO0001.

FM->EXIT_SAPLCOBT_001

  INCLUDE ZXCO1U01.

here i am calling a BAPI ('BAPI_PRODORDCONF_CREATE_TT')

to automatic posting of confirmation of first two operations.

While passing production order no to this bapi(aufnr),

Error message are returned in return parameter of this bapi.

Order no ** is not found.

This is becoz, order no is generated by transaction but not has been

committed in database.

And also i cant use COMMIT WORK AND WAIT in USEr exit.

Suggest something which helps.

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor
0 Kudos

Hi Abhishek

You can not do this here as order is not generated plus even if it is genearated it will be locked. Tell me one thing when you create production order check in SWEL does any event gets raised? (dont forget to switch on the trace in SWELS before creating the order). If some CREATED event is getting raised you can then attach you function module as receiving one in SWETYPV and create confirmations

Nabheet

43 REPLIES 43

0 Kudos

FREBUS2012  is also visible in my system.


but QCYBUS2012 is not visible.

this buisness object is displayed in logs in SWEL after po is created.


What exactly is this? and from where it can be viewed.

0 Kudos

Sometimes the events can also be raised via SWEC. Where you can maintain the business objects which are still not created.

Nabhete

0 Kudos

another series of questions evolved into my mind. when i opened transaction SWEC.

Leave it for tomorrow Q & A.

0 Kudos

HI nabheet,

i was wondering once again this requirement.

i have created wrapper FM ( 2nd function module) to confirm some operations in prod order.

But something weird is happening.

For debugging, i am not calling 2nd FM in background task.

In 2nd FM whenever this select statement is executed , session closes(not all 6 sessions, but the 1 which i am debugging.).

the problem i feel may be: select commands can not be executed in update debugging.

But how i'll be able to write perfect code for confirmations with out debugging.

There may be some way out for debugging.??