2016 Aug 23 8:54 PM
We are trying to submit RLINV050 (transaction LX26) via a custom Z program in a background job via Submit Exporting List to Memory and Return. All works great unless RLINV050 doesn't have any results. In that case rather than displaying an empty ALV report, it outputs a message L4-S136 and performs "LEAVE TO TRANSACTION SY-TCODE" which ends the processing of the calling Z program.
Anyone have an ideas on how to have the Z program keep control of the process. We are calling RLINV050 multiple times in a loop and consolidating the results, but can't do this properly when it hits the LEAVE statement.
2016 Aug 23 10:45 PM
I don't think we have anything on SUBMIT statement to avoid this situation.
From help on LEAVE TO TRANSACTION, :
When using LEAVE TO TRANSACTION, the current call sequence is exited completely. Upon completion of the called transaction, the runtime environment returns to the position where the first program in the call sequence was called. The current SAP LUW is thereby ended.
Probably you can write an implicit enhancement at the end of subroutine AUSGABE to set the variable FLG_OUT = CON_TRUE when program is called in SUBMIT.
Thanks,
Naimesh Patel
We are trying to submit RLINV050 (transaction LX26) via a custom Z program in a background job via Submit Exporting List to Memory and Return. All works great unless RLINV050 doesn't have any results. In that case rather than displaying an empty ALV report, it outputs a message L4-S136 and performs "LEAVE TO TRANSACTION SY-TCODE" which ends the processing of the calling Z program.
Anyone have an ideas on how to have the Z program keep control of the process. We are calling RLINV050 multiple times in a loop and consolidating the results, but can't do this properly when it hits the LEAVE statement.
2016 Aug 23 10:45 PM
I don't think we have anything on SUBMIT statement to avoid this situation.
From help on LEAVE TO TRANSACTION, :
When using LEAVE TO TRANSACTION, the current call sequence is exited completely. Upon completion of the called transaction, the runtime environment returns to the position where the first program in the call sequence was called. The current SAP LUW is thereby ended.
Probably you can write an implicit enhancement at the end of subroutine AUSGABE to set the variable FLG_OUT = CON_TRUE when program is called in SUBMIT.
Thanks,
Naimesh Patel
2016 Aug 25 2:40 PM
Thanks Naimesh. I came to the same conclusion, no way to control this from our Z program without doing an enhancement. What we ended up doing was to create 3 Z programs to do what I was hoping could be done in 1. I didn't want to mess around with enhancement points in RLINV050 as it uses the old GET Logical Database stuff that I'm not very familiar with and the approach below is now working for us.
1st Z program
delete all data from custom Z table
Loop through LX26 Variants
submit 2nd Z program via Job Open/Job Close for each unique LX26 Variant
endloop
2nd Z Program
Submit RLINV050 exporting list to memory and return
(when no results this won't return because of LEAVE TO TRANSACTION,
but that is OK because it is just for this one variant so nothing to add to Z table anyway)
Get List
Update Z table with consolidated data from LX26
3rd Program
Report against Z table to show outstanding Cycle Count data across the entire company
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |