2024 Feb 26 12:50 PM
Why some values in program are automaticly increment after starting 'At selection screen output' section.
I've got an programm, which is used in few transactions.
In one of it values are changing after starting an 'At selection screen output' section, and at second values are not changing.
There is no some additional inizialization, the code before 'At selection screen output is the same.
i try to find authorization object at su24, and one t-code has it, but there are no values that are aoutomaticly increments
in it.
what it can be if it not an authorization object, or mb values can initialize somwhere else( not in su24 ) ?
2024 Feb 26 1:55 PM
I don't understand the question, please give real data: which values, which program, what relationship with authorization object? Thanks.
2024 Feb 26 5:41 PM
It's an Z programm and Z authorization object.
I intersted how it can automaticly increment if it doesn't happening inside program.
what are the ways can this be done in sap?
2024 Feb 26 5:49 PM
sry for mislead, it not increment, it automaticly reinitializes.
and some select-options are automaticly initialize at once 'At selection screen output' block starts.
2024 Feb 26 6:58 PM
What code then?
I don't know your code. For instance, if you are changing the value of screen parameters during START-OF-SELECTION, what you are describing is normal.
Now please clarify what your code is.
2024 Feb 27 5:46 AM - edited 2024 Feb 27 5:48 AM
INITIALIZATION.
SET TITLEBAR '100'.
SELECT SINGLE * FROM t159b WHERE repid = syst-repid.
IF sy-subrc IS INITIAL.
IF xcycl IS INITIAL.
gidat = t159b-gidat.
xlabst = t159b-xlabst.
ximat = t159b-ximat.
xicha = t159b-xicha.
xinsme = t159b-xinsme.
xspeme = t159b-xspeme.
ELSE.
xlabst = x.
ximat = space.
xicha = space.
xinsme = space.
ENDIF.
sperr = t159b-sperr.
* #jko
batin = t159b-batin.
IF sy-tcode = 'MI31'.
IF c_use_function_modul IS INITIAL.
batin = t159b-batin.
* clear call_fb.
ELSE.
* call_fb = t159b-batin.
CLEAR batin.
ENDIF.
ENDIF.
mappe = t159b-mappe.
xprot = t159b-xprot.
maxpo = t159b-maxpo.
ELSE.
xlabst = x.
xprot = x.
ENDIF.
* begin of note 494237
IF sy-repid = 'RM07SVOR' OR sy-repid = 'RM07ICN1'.
IF maxpo IS INITIAL.
maxpo = 20.
ELSEIF maxpo > 333.
maxpo = 333.
MESSAGE i717(m7).
ENDIF.
ELSE.
IF maxpo IS INITIAL.
maxpo = 20.
ELSEIF maxpo > 300.
maxpo = 300.
MESSAGE i717(m7).
ENDIF.
ENDIF.
* end of note 494237
IF mappe IS INITIAL.
mappe = sy-repid.
ENDIF.
IF gidat IS INITIAL.
* &001 begin: Anpassung auf Zeitzonen
* GIDAT = SY-DATUM.
gidat = sy-datlo.
* &001 end
ENDIF.
CLEAR g_variant.
MOVE sy-repid TO g_variant-report.
gx_variant = g_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = a
CHANGING
cs_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
pa_vari = gx_variant-variant.
ENDIF.
IF r_werks-low IS INITIAL.
GET PARAMETER ID 'WRK' FIELD r_werks-low.
ENDIF.
IF r_lgort-low IS INITIAL.
GET PARAMETER ID 'LAG' FIELD r_lgort-low.
ENDIF.
* set titlebar '100'.
SELECT SINGLE * FROM t159b WHERE repid = syst-repid. "n364559
IF sy-subrc IS INITIAL.
gidat = t159b-gidat.
maxpo = t159b-maxpo.
ENDIF.
IF maxpo IS INITIAL.
maxpo = 20.
ELSEIF maxpo > 333.
maxpo = 333.
MESSAGE i717(m7).
ENDIF.
IF gidat IS INITIAL.
gidat = sy-datlo.
ENDIF.
* if no parameter is marked, open stock selection "HW614297
IF xlabst IS INITIAL AND xinsme IS INITIAL AND "HW614297
xspeme IS INITIAL AND xwart IS INITIAL. "HW614297
zw_zustand_sto = 'S'. "HW614297
ENDIF. "HW614297
* check parameters for function : one must be marked
* take the value from default table T159L
CLEAR cnt_lines.
IF NOT xtest IS INITIAL.
ADD 1 TO cnt_lines.
ENDIF.
IF NOT batin IS INITIAL.
ADD 1 TO cnt_lines.
ENDIF.
IF NOT call_fb IS INITIAL.
ADD 1 TO cnt_lines.
ENDIF.
CASE cnt_lines.
WHEN 0.
MOVE x TO xtest.
WHEN 1.
* ok
WHEN OTHERS.
* read parameter table for inventory reports
SELECT SINGLE * FROM t159b WHERE repid = syst-repid.
IF sy-subrc IS INITIAL AND
t159b-batin = x.
CLEAR : xtest, call_fb.
MOVE t159b-batin TO batin.
ELSE.
MOVE x TO xtest.
CLEAR : batin, call_fb.
ENDIF.
ENDCASE.
* clear parameters who are not active in all reports RM07I*31
CASE sy-repid.
WHEN 'RM07IM31'.
* special stock M does not allow stock in Quality inspection and
* blocked stock
CLEAR : xinsme, xspeme.
WHEN 'RM07IO31' OR 'RM07IV31' OR 'RM07IW31'.
* special stocks O, V, and W do not allow block stock
CLEAR : xspeme.
WHEN OTHERS.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
I don't know why but parametrs : 'r_mtart' and 'LBTCH' is changing at once 'At selection screen output' block is starts.
it's changing in one t-code and doesn't in another. It goes throw the code absolutely same in both cases
PARAMETERS: lbtch LIKE am07m-xonul MODIF ID btc DEFAULT 'X'. SELECT-OPTIONS r_mtart FOR mara-mtart MEMORY ID mta.
2024 Feb 27 6:25 AM
It was solved.
It was happenning because of the variants.
It was protected at Goto-> Variants, so i cannot choose it GetVariant button on Selection-screen