2023 Aug 16 1:30 PM
Hello,
I am facing an issue to pass variables using submit, below is my code.
THE gv_value1 and gv_value2 is always blank.
I also tried using cl_salv_bs_runtime_info, But it did not work.
My variables are always blank.
Any solution to pass gv_value1 as 'X' and gv_value2 as X ?
Thank You.
IF gv_rep EQ abap_true
AND gv_fun EQ abap_true.
SUBMIT z_rep
WITH gv_value1 = abap_true
WITH gv_value2 = abap_true
WITH p_bill = zhdr-zzmonth
WITH p_fund = gs_reports-geber
AND RETURN.
ENDIF.
2023 Aug 16 1:36 PM
2023 Aug 16 1:41 PM
2023 Aug 16 1:41 PM
We don't know Z_REP so it's impossible to help, you don't give enough information.
Also we don't know whether GV_VALUE1 and GV_VALUE2 are PARAMETERS or not. WITH works only with selection screen fields, not global variables.
2023 Aug 16 1:42 PM
You can use VIA SELECTION-SCREEN addition to the SUBMIT statement. This way the selection screen with the values passed is displayed before the report is executed. That makes it easy to verify the value passed to the report.
2023 Aug 16 1:45 PM
i have declared the values of gv_value1 and gv _value2 in my zrep.
gv_value1 and gv_value2 are not any parameters.
2023 Aug 16 1:46 PM
ok 3a9e4ce873a94034b33dc62b0ce600ee i will try it via selection screen
2023 Aug 16 1:54 PM
Are your parameters really called gv_value1 or gv_value2?
This sounds more like global values to me which can't be changed via SUBMIT.
You can only pass parameters or select options...
2023 Aug 16 1:55 PM
You wrote
'i have declared the values of gv_value1 and gv _value2 in my zrep.
gv_value1 and gv_value2 are not any parameters.'
So don't expect to pass those values with the WITH option of SUBMIT statement.
(Try to define those fields as NO-DISPLAY parameters or pass those walues with some EXPORT/IMPORT or SET/GET parameters)
2023 Aug 16 1:56 PM
If GV_VALUE1 and GV_VALUE2 are global variable in Z_REP, you can't pass them on via SUBMIT.
You first need to add parameters for them (they can also be hidden).
REPORT z_rep.
...
PARAMETERS:
p_value1 TYPE char01 NO-DISPLAY,
p_value2 TYPE char01 NO-DISPLAY.
...
START-OF-SELECTION.
* Set global variables
gv_value1 = p_value1.
gv_value2 = p_value1.
...
Then you can pass the values from the calling program:
DATA(lt_sel_par) = VALUE rsparams_tt( kind = 'P' sign = 'I' option = 'EQ'
( selname = 'P_VALUE1' low = 'X' )
( selname = 'P_VALUE2' low = 'X' )
( selname = 'P_BILL' low = zhdr-zzmonth )
( selname = 'P_FUND' low = gs_reports-geber ) ).
SUBMIT z_rep WITH SELECTION-TABLE lt_seltab.
Second option (although not the preferred one):
Use EXPORT TO MEMORY in calling program (e.g. EXPORT abap_true TO MEMORY ID 'Z_REP_VALUE1') and IMPORT FROM MEMORY in Z_REP (IMPORT gv_value1 FROM MEMORY ID 'Z_REP_VALUE1').
2023 Aug 16 2:50 PM
2023 Aug 16 2:04 PM
2023 Aug 16 2:51 PM