2020 Sep 22 3:54 PM
Hell expert.
I have a business scenario- when the user use the following transactions - MB11, Co11n, MIGO and QA11. After clicking save it should automatically do everything till GR. So this means that we have to check PO exists or not if not then create PO and then create Replenishment outbound delivery wrt PO and then update picking and then GI and then GR.
So I found the enhancement spot in MM07MFB9_BUCHEN_AUSFUEHREN which is called by all the transactions. Here I read MSEG table and insert values to the custom table and then called my custom program from the enhancement and read data from the custom table and called corresponding BAPI's to accomplish the task.
1. PO is created - BAPI_PO_CREATE1
2. Delivery also created wrt PO - BAPI_OUTB_DELIVERY_CREATE_STO but delivery qty is 0 because the material is locked by me and so i couldn't proceed further.
I am also using COMMIT after BAPI'S.
These locks are obtained at the enhancement spot itself. it is not wise to use dequeue all. Please provide me your input on how can I achieve this.
I am kind of stuck and can not think of the solution. I have no idea how can I achieve this?
looking forward for your inputs and thanks in advance.
Regards
Reshu
Hell expert.
I have a business scenario- when the user use the following transactions - MB11, Co11n, MIGO and QA11. After clicking save it should automatically do everything till GR. So this means that we have to check PO exists or not if not then create PO and then create Replenishment outbound delivery wrt PO and then update picking and then GI and then GR.
So I found the enhancement spot in MM07MFB9_BUCHEN_AUSFUEHREN which is called by all the transactions. Here I read MSEG table and insert values to the custom table and then called my custom program from the enhancement and read data from the custom table and called corresponding BAPI's to accomplish the task.
1. PO is created - BAPI_PO_CREATE1
2. Delivery also created wrt PO - BAPI_OUTB_DELIVERY_CREATE_STO but delivery qty is 0 because the material is locked by me and so i couldn't proceed further.
I am also using COMMIT after BAPI'S.
These locks are obtained at the enhancement spot itself. it is not wise to use dequeue all. Please provide me your input on how can I achieve this.
I am kind of stuck and can not think of the solution. I have no idea how can I achieve this?
looking forward for your inputs and thanks in advance.
Regards
Reshu
2020 Sep 22 4:12 PM
2020 Sep 22 5:10 PM
NB: "call it in background" means CALL FUNCTION ... IN BACKGROUND TASK ... (or run it via bgRFC cl_bgrfc_destination_outbound=>create + create_trfc_unit + CALL FUNCTION ... IN BACKGROUND UNIT ...)
(tRFC/bgRFC is triggered after update tasks/after the locks have been released)
2020 Sep 23 7:51 AM
Thank you expert for guiding me .. i could see - FM has Remote enabled option. So do i have to create a FM passing my program name and call it at enhancement spot but then it will execute it directly .. i am so sorry that i have limited knowledge and i am not able to catch your point .. is to possible to explain me in little more detail please.. ..I read 'call function in background' still it is not clear to me. https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_function_background_task.htm
2020 Sep 23 9:26 AM
Call function in background task will be executed after commit and execution of high-priority update function modules. Look at Abap documentation of COMMIT WORK.
2020 Sep 23 11:46 AM
Thanks for the explanation.
So i have created FM with Remote enabled option. and called this FM from the enhancement spot in MM07MFB9_BUCHEN_AUSFUEHREN .
CALL FUNCTION 'ZZZ' in BACKGROUND TASK.
I am calling a custom program using SUBMIT ZPROG and Return in the FM 'ZZZ'. I have tRFC enable the debugging setting and also I am seeing entry at T.code SM58 and from there it is jumping to FM 'ZZZ' also but not to custom program. How should I call custom program from this FM?
When I am changed FM as Update Mode with start delay and called at enhancement as CALL FUNCTION 'ZZZ' in Update TASK, it is jumping to custom program.
Please provide your input.
Thanks in advance.