09-12-2008 12:58 AM
Hi.
I have a problem, i need know if a delivery was posted. I'm implementing some badis,
for example, LE_SHP_DELIVERY_PROC, MB_DOCUMENT_BADI, but that don't tell me
that delivery was posted correctly.
I need know this information for update a client table. In case the delivery not posted, client
table is not updated.
Thank 4 ur reply.
PD. Sorry for my English!
09-12-2008 3:09 AM
Hi
you can make your table updates in FM. Then you can call this FM from your BADI in UPDATE TASK. SAP will create a separate process for this FM and it will execute FM on command COMMIT WORK. So in case that SAP transaction fails, it will not be executed. Check ABAP documentation for more information about calling FM in update task.
Cheers
09-12-2008 4:38 AM
Hi Martin.. Thanks 4 ur answer.
However, really i need know if delivery was posted(VL01N, VL02N). Because i can have a material document (MKPF) before standard do a "commit". So i can´t take this material doc if not yet posted.
Best regards.
09-12-2008 5:47 AM
Hi,
if you call FM in UPDATE TASK, the FM is executed after the first call of the command COMMIT WORK. So you will call your FM in UPDATE TASK after all validations in your BADI (it depends on BADI but usually there is a method like BEFORE_SAVE). So in this moment, you are sure that you want to create a delivery. When SAP creates or updates all delivery data it calls COMMIT WORK. After this call your FM will be executed and you are sure that delivery already exists. If something happened, SAP will not call COMMIT WORK but it will call ROLLBACK. In this case the execution of your FM will be canceled.
Another way how to solve this problem is to use workflow. But it requires more setting and of course workflow skills.
Cheers