on 2017 Aug 23 10:34 PM
Hello,
I am working on a program to call maintenance plans manually to generate an order using FM MPLAN_MANUAL_CALL. Using FM MPLAN_READ to fetch ZAEHL to pass to the manual call. MPLAN_READ is giving wrong results when executed in loop and in SE37. Below is the structure of the logic.
Loop at mplans.
CALL FUNCTION 'MPLAN_READ'
EXPORTING mplan = warpl
no_buffer = 'X'
TABLES return = lt_return
strategy_cycles = lt_strat_cycles.
READ TABLE lt_strat_cycles INTO ls_strat_cycles INDEX 1.
lv_zaehl = ls_strat_cycles-zaehl.
CALL FUNCTION 'MPLAN_MANUAL_CALL'
EXPORTING warpl = warpl
manda = sy-datum
zaehl = lv_zaehl
IMPORTING return = lt_return.
REFRESH : lt_strat_cycles
Endloop.
Above logic is working fine and generating orders except few times.
Eg error: When looping on 3 mplans, for mplan3 the FM MPLAN_READ gave 2 strategy cycles in lt_strat_cycles. When i run FM MPLAN_READ with mplan3 in SE37 or if this mplan3 is the first in the loop then FM MPLAN_READ is returning only 1 strategy cycle.
Due to this issue of using wrong ZAEHL, order is not getting generated. I have also tried below FM before each MPLAN_READ but still no use.
FM 'MPLAN_BUFFER_CLEAR'
EXPORTING plan = warpl
with_items = 'X'.
Need help to fix the issue why MPLAN_READ in SE37 gives only one strategy cycle where as in the loop it gives 2. If this mplan is first in the loop, then it gives only one strategy cycle.
Or else, is there any other way to get the ZAEHL for the mplan?
Thanks,
Ram
Useful info: https://archive.sap.com/discussions/thread/3239802
PeteA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
115 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.