2021 Apr 14 12:46 PM
Hello experts,
Context :
I have to update MKPF-BKTXT for the goods movement generated by the following function modules :
For BAPI_GOODSMVT_CREATE -> no problem because there is a "GOODSMVT_HEADER" structure with my BKTXT field.
This is another story for the others because header for MKPF is not available. Each of them creates a some point a goods movement so I tried the badis MB_BAPI_GOODSMVT_CREATE & WORKORDER_GOODSMVT but there is no method with the data i need to update MKPF-BKTXT, or it's not even called by the FMs above.
I tried "break point at statement" : "CALL BADI" and also "CALL CUSTOMER-FUNCTION" but nothing seems to do the job i want.
My last hope is to find when MKPF and MSEG are updated. Of course when i start my debugger, those tables are not reachable so i can't set a breakpoint on them, but, at one point, they have to be updated, but i don't know when.
I ve checked and It seems there is a way using Script in debbuging mode, but i don't understand how it's working :

How can i set the break point on MKPF here?
Or if you know any other way to do that then I'll take it.
Thanks a lot for your time.
Best regards,
Alexandre
2021 Apr 14 2:36 PM
You can use RSTPDA_SCRIPT_BP_CHANGE_TAB script or create your own:

The tables to debug are listed in the range table range_it, which is filled in init() method
METHOD init.
DATA l_cancel TYPE flag.
CALL FUNCTION 'TPDA_SCRIPT_CALL_SEL_SCREEN'
EXPORTING
p_screen = if_tpda_sel_screens=>c_scr_table
IMPORTING
p_range_it = range_it
p_cancel = l_cancel.
IF l_cancel = abap_true.
MESSAGE s144(tpda) .
RAISE EXCEPTION TYPE cx_tpda_stop_scripting_request.
ELSEIF range_it IS INITIAL.
MESSAGE s144(tpda) .
RAISE EXCEPTION TYPE cx_tpda_stop_scripting_request.
ENDIF.
ENDMETHOD. "init
in your own script tables can be added directly, without a popup window:
range_it = VALUE #( ( low = 'MKPF' option = 'EQ' sign = 'I' )
( low = 'MSEG' option = 'EQ' sign = 'I' ) ).
2021 Apr 14 1:08 PM
The transaction ST05 can be used to find out, where database tables are updated.
2021 Apr 14 1:37 PM
Hi touzik_itc
Yes thanks, i've used SAT tcode and i found the place too work for one of my MF. ST05 should do the same yes.
But still i'm curious to know if it's possible to set this kind of break point directly in the debugger.
Thanks again.
2021 Apr 14 2:36 PM
You can use RSTPDA_SCRIPT_BP_CHANGE_TAB script or create your own:

The tables to debug are listed in the range table range_it, which is filled in init() method
METHOD init.
DATA l_cancel TYPE flag.
CALL FUNCTION 'TPDA_SCRIPT_CALL_SEL_SCREEN'
EXPORTING
p_screen = if_tpda_sel_screens=>c_scr_table
IMPORTING
p_range_it = range_it
p_cancel = l_cancel.
IF l_cancel = abap_true.
MESSAGE s144(tpda) .
RAISE EXCEPTION TYPE cx_tpda_stop_scripting_request.
ELSEIF range_it IS INITIAL.
MESSAGE s144(tpda) .
RAISE EXCEPTION TYPE cx_tpda_stop_scripting_request.
ENDIF.
ENDMETHOD. "init
in your own script tables can be added directly, without a popup window:
range_it = VALUE #( ( low = 'MKPF' option = 'EQ' sign = 'I' )
( low = 'MSEG' option = 'EQ' sign = 'I' ) ).
2021 Apr 14 5:26 PM
Thanks touzik_itc and sandra.rossi
With both your answer, i have used my first debbuging script ever (even after 10 years of ABAP) ^^
We learn every day!
Have a great day.
Regards,
Alexandre
2021 Apr 14 4:16 PM
Note that if the tables are updated in the update task (as often), you must first activate the update debug, then start the script in the update task.
Note that the standard script RSTPDA_SCRIPT_BP_CHANGE_TAB asks for the table names (RANGE_IT) when the script is started, and its method SCRIPT is triggered at each INSERT/MODIFY/UPDATE/DELETE statement (if you look at the script "properties").