‎2006 Sep 05 8:03 PM
Hello friends,
In my selection screen,
I want to populate a default value based on the field SY-SYSID.
select-options : s_kunnr FOR vbak-kunnr,
s_erdat FOR vbrk-erdat.
Parameter : ID like N.
In the selection screen i want to populate a default value for the parameter - ID, based on SY-SYSID,
ANy help on this will be appericiated,
Shejal Shetty.
‎2006 Sep 05 8:10 PM
In initialization section.
initialization.
if sy-sysid = <val>.
id = val1.
else.
id = val2.
endif.
‎2006 Sep 05 8:06 PM
Hi ,
Check for the condition of SY-SYSID and store it another variable say p_sysid.
‎2006 Sep 05 8:10 PM
In initialization section.
initialization.
if sy-sysid = <val>.
id = val1.
else.
id = val2.
endif.
‎2006 Sep 05 8:14 PM
Thanks for the reply,
However i want this value to be populated in the selection screen when i excute the program by default.
I dont understand how the INITIALIZATION action will be performed before the selection screen is displayed.
Shejal Shetty.
‎2006 Sep 05 8:16 PM
The initialization block processes before the selection screen is displayed.
‎2006 Sep 05 8:19 PM
This works:
initialization.
concatenate '/usr/sap/xfr/' sy-sysid '/.....' into p_file.
Rob
‎2006 Sep 05 8:28 PM
Hello,
I have tried this piece of code but comes with an error message.
DATA : id1(8) type n.
Parameter : ID like n default id1.
INITIALIZATION.
if sy-sysid = 'PRD'.
id1 = '00034665'.
else.
id1 = '00034678'.
endif.
Is this piece of code is right,
Thanks for all the help,
Shejal Shetty.
‎2006 Sep 05 8:30 PM
Change
Parameter : ID like n default id1.
to
Parameter : ID1(8) type n.
‎2006 Sep 05 8:31 PM
wrong:
try this way:
DATA : id1(8) type n.
Parameter : ID(8) type n.
INITIALIZATION.
if sy-sysid = 'PRD'.
id = '00034665'.
else.
id = '00034678'.
endif.
‎2006 Sep 05 8:34 PM
DATA : id1(8) type n.
Parameter : ID like id1 default id1.
INITIALIZATION.
if sy-sysid = 'PRD'.
ID = '00034665'. Change ID1 to ID(Parameter)
else.
ID = '00034678'.
endif.
‎2006 Sep 05 8:34 PM
Hi Shejal,
This is the correct way:
Parameter : ID1(8).
INITIALIZATION.
if sy-sysid = 'PRD'.
id1 = '00034665'.
else.
id1 = '00034678'.
endif.
Regards,
Vivek
‎2006 Sep 05 8:39 PM
Do you mean:
DATA : id1(8) TYPE n.
PARAMETER : id LIKE id1.
INITIALIZATION.
IF sy-sysid = 'FIS'.
id = '00034665'.
ELSE.
id = '00034678'.
ENDIF.
Rob
‎2006 Sep 05 8:40 PM
Thanks Vivek,
Got it in the method you specified.
Thanks all again for all the help.
Shejal Shetty.
‎2006 Sep 05 8:18 PM
Hi Shejal,
Please try this.
PARAMETER: P_ID LIKE SY-SYSID DEFAULT SY-SYSID.Regards,
Ferry Lianto
‎2006 Sep 05 8:23 PM
Hi ,
you can assign default value either at
initialization event or at selection-screen output.
first initialization-selection-screen output->
at selection-screen event s fired.
initialization.
id = sy-sysid.
or
at selection-screen output
id = sy-sysid.
Regards
Amole
‎2006 Sep 05 8:36 PM
Hi,
Please try this.
PARAMETER : P_ID TYPE NUM08.
INITIALIZATION.
IF SY-SYSID = 'PRD'.
P_ID = '00034665'.
ELSE.
P_ID = '00034678'.
ENDIF.