‎2009 Feb 24 7:28 AM
Hi AbAp's
Can you please explain about Initialization event with below scinario.
tables: makt.
selection-screen: skip 2,begin of block ini with frame title text-000,
skip 2.
select-options s_matnr for makt-matnr default '401' TO '500'
option BT sign I.
parameters: p_spras type spras default 'EN'.
selection-screen: skip 2,end of block ini.
initialization.
s_matnr-low = 'A1000'.
s_matnr-high = 'A1004'.
s_matnr-option = 'BT'.
s_matnr-sign = 'I'.
append s_matnr.
p_spras = 'JA'.
O/P : s_matnr : 401 to 501.
p_spras : JA.
My Doubt is .
1.Value for p_spras is picking from intialization but s_matnr it setting from default value what the reason for this?
2.Check the value in internal table s_matnr first record is default record and second is appended
value which is from initialization process ,So Which event is occur first initialization or
selection-screen?
regards,
viji
‎2009 Feb 24 7:32 AM
Load of program is triggering first and i guess default value is populating from that.
‎2009 Feb 24 7:33 AM
Hi
Initialization is the first event which is triggered . Its used to modify the output before the screen is displayed to the user.
‎2009 Feb 24 7:42 AM
Hi Viquar Iqbal ,
In parameters it is modifying from initialization but select-options it is not modifying from initialization.?.
regards,
viji
‎2009 Feb 24 7:45 AM
Hi,
For parameters it is overwriting. For select options do like this (add REFRESH s_matnr.)
tables: makt.
selection-screen: skip 2,begin of block ini with frame title text-000,
skip 2.
select-options s_matnr for makt-matnr default '401' TO '500'
option BT sign I.
parameters: p_spras type spras default 'EN'.
selection-screen: skip 2,end of block ini.
initialization.
REFRESH s_matnr.
s_matnr-low = 'A1000'.
s_matnr-high = 'A1004'.
s_matnr-option = 'BT'.
s_matnr-sign = 'I'.
append s_matnr.
p_spras = 'JA'.Regards
‎2009 Feb 24 7:53 AM
I think p_spras = 'JA'. is not under initialization statement.
Try this once.
tables: makt.
selection-screen: skip 2,begin of block ini with frame title text-000,
skip 2.
select-options s_matnr for makt-matnr default '401' TO '500'
option BT sign I.
parameters: p_spras type spras default 'EN'.
selection-screen: skip 2,end of block ini.
p_spras = 'JA'.
initialization.
s_matnr-low = 'A1000'.
s_matnr-high = 'A1004'.
s_matnr-option = 'BT'.
s_matnr-sign = 'I'.
append s_matnr.
‎2009 Feb 24 8:19 AM
‎2009 Feb 24 7:40 AM
Hi Rajviji,
1.Value for p_spras is picking from intialization but s_matnr it setting from default value what the reason for this?
For P_SPRAS you are overwriting the value EN by JA (Check in debugging) for s_matnr you are just appending (Not clearing and appending).
2.Check the value in internal table s_matnr first record is default record and second is appended
value which is from initialization process ,So Which event is occur first initialization or
selection-screen?
INITIALIZATION is a event where as selection-screen is not.
Regards
‎2009 Feb 24 8:18 AM
‎2009 Feb 24 7:49 AM
Hi.
Initialization event will occur first.
when u execute the program this event is trigerred first and set the values which u have made
in initialization event.
And when u execute ur program the default values will e ignored and values set in initilalization event
will work
‎2009 Feb 24 7:54 AM
Hi Rajviji,
Try following code.
INITIALIZATION.
refresh s_matnr.----
Additional statement.
s_matnr-low = 'A1000'.
s_matnr-high = 'A1004'.
s_matnr-option = 'BT'.
s_matnr-sign = 'I'.
append s_matnr.
p_spras = 'JA'.
Regards,
Anil
‎2009 Feb 24 8:03 AM
In Report, INITIALIZATION is the first event. It will trigger before AT SELECTION-SCREEN event.
It used to give default values to the selection screen fields using SELECT-OPTIONS statement.
INITIALIZATION.
REFRESH s_matnr.
s_matnr-low = 'A1000'.
s_matnr-high = 'A1004'.
s_matnr-option = 'BT'.
s_matnr-sign = 'I'.
append s_matnr.
p_spras = 'JA'.
Regards,
Joan
.