a week ago - last edited a week ago
SUBMIT riaufk20
USING SELECTION-SET p_varnam
EXPORTING LIST TO MEMORY AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING
r_data = DATA(lo_data)
).
IF lo_data IS NOT BOUND.
MESSAGE 'No data was captured from the ALV runtime.' TYPE 'E'.
RETURN.
ELSE.
ASSIGN lo_data->* TO FIELD-SYMBOL(<lfs_datatab>).
I am using above code to call IW38 report, which gives a list of orders to be confirmed, user clicks the order from the list and goes to below screen to confirm the order
In case of multiple orders IW38 provides a list of orders and I can call the BAPI to confirm the orders inside a loop.
But in case of 1 record, the transaction IW38 itself goes to the above screen instead of providing a list.
But my code fails and opens a new window for the gui transaction, is there anyway I can get list of 1 record instead of above screen?
Request clarification before answering.
Looks like this should be possible by exporting 'X' to memory ID 'G_VARIANT_SAVE' before submitting the report.
Form DISPLAY_LIST_F14 checks if global variable g_variant_save is 'X' - if it is it behaves as if there's more than one hit.
Form VARIANT_INIT_F14 tries to get g_variant_save from memory ID 'G_VARIANT_SAVE' and otherwise sets it to 'U'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@KjetilKilhavnI can see that based on number of rows, different subroutines are getting called.
In case of multiple records, it calls PERFORM call_listviewer_f14.
but with single record, it calls PERFORM fcodes_with_mark_f16.
Is there any way I can call the SUBMIT PROGRAM in some way that sets SY-BATCH = 0?
my Z program is supposed to run as a background job, but it seems SUBMIT RIAUFK20 statement doesn't set SY-BATCH = X.
SY-BATCH = X only when my Z Program is running.
That's too bad. Either that means VARIANT_INIT_F14 isn't called when you submit the report, or a different value is assigned to variable g_variant_save before DISPLAY_LIST_F14 is called.
Debug to find out. I don't have any other tips.
Perhaps you need to start looking for some other solution than submitting RIAUFK20?
@KjetilKilhavn eventually SPOOL was used and list was collected with string manipulation from spool output.
Thank you for your suggestion!
SUBMIT riaufk20 TO SAP-SPOOL
SPOOL PARAMETERS ls_params
WITHOUT SPOOL DYNPRO
USING SELECTION-SET p_varnam
VIA JOB lv_jobname NUMBER lv_jobcount
AND RETURN.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.