‎2009 Sep 30 10:15 AM
Dear all,
I have to put defaul value in selection screen,so I have calculated in initialization event.Following are the code:
INITIALIZATION.
CALL FUNCTION 'K_PERIOD_GET_FOR_DATE_KOKRS'
EXPORTING
KOKRS = '9000'
DATE = SY-DATUM
IMPORTING
PERIO = V_PERIO
GJAHR = V_GJAHR
EXCEPTIONS
KOKRS_NOT_FOUND = 1
DATE_INVALID = 2
OTHERS = 3.
and in selection screen I have written like that :
SELECT-OPTIONS SO_GJAHR FOR ZZF08_EPL-GJAHR OBLIGATORY DEFAULT V_GJAHR.
SELECT-OPTIONS SO_MONAT FOR ZZF08_EPL-MONAT OBLIGATORY DEFAULT V_PERIO.
But at the time of execution it is not showing any default value in select option.
Regards,
Amar
‎2009 Sep 30 10:25 AM
Hi,
this is just a timing isssue...
The "Default" append in your Select-Option definitions are evaluated while
the variables get created at programm loading.
Initialization is after this.
Just set the defaults after your calculation in initialization explicitly
so_gjahr-low = v_gjahr.
APPEND so_gjahr.
so_monat-low = v_perio
APPEND so_monat.
Hope that helps,
br
‎2009 Sep 30 10:25 AM
Hi,
this is just a timing isssue...
The "Default" append in your Select-Option definitions are evaluated while
the variables get created at programm loading.
Initialization is after this.
Just set the defaults after your calculation in initialization explicitly
so_gjahr-low = v_gjahr.
APPEND so_gjahr.
so_monat-low = v_perio
APPEND so_monat.
Hope that helps,
br
‎2009 Sep 30 10:43 AM
hi
try this code
SELECT-OPTIONS SO_GJAHR FOR V_GJAHR OBLIGATORY.
SELECT-OPTIONS SO_MONAT FOR MONAT OBLIGATORY .
INITIALIZATION.
CALL FUNCTION 'K_PERIOD_GET_FOR_DATE_KOKRS'
EXPORTING
KOKRS = 'IN01'
DATE = SY-DATUM
IMPORTING
PERIO = V_PERIO
GJAHR = V_GJAHR
EXCEPTIONS
KOKRS_NOT_FOUND = 1
DATE_INVALID = 2
OTHERS = 3.
so_gjahr-low = v_gjahr.
append so_gjahr.
so_monat-low = v_perio.
append so_monat.it is working fine
Regards Nilesh
‎2009 Sep 30 10:48 AM
Hi,
Try this.
SELECTION-SCREEN begin of BLOCK A.
SELECT-OPTIONS SO_GJAHR FOR ZZF08_EPL-GJAHR OBLIGATORY .
SELECT-OPTIONS SO_MONAT FOR ZZF08_EPL-MONAT OBLIGATORY .
SELECTION-SCREEN END OF BLOCK A.
INITIALIZATION.
CALL FUNCTION 'K_PERIOD_GET_FOR_DATE_KOKRS'
EXPORTING
KOKRS = '9000'
DATE = SY-DATUM
IMPORTING
PERIO = V_PERIO
GJAHR = V_GJAHR
EXCEPTIONS
KOKRS_NOT_FOUND = 1
DATE_INVALID = 2
OTHERS = 3.
SO_GJAHR-sign = 'I' .
SO_GJAHR-option = 'BT'.
SO_GJAHR-low = V_GJAHR.
SO_GJAHR-high = V_GJAHR.
append SO_GJAHR.
SO_MONAT -sign = 'I' .
SO_MONAT -option = 'BT'.
SO_MONAT -low = V_PERIO.
SO_MONAT -high = V_PERIO.
append SO_MONAT .
Regards,
Sravani.
‎2009 Sep 30 10:53 AM
TABLES : bseg,vbrk.
data: BEGIN OF itab,
monat type T009B-POPER,
END OF itab.
SELECT-OPTIONS SO_GJAHR FOR BSEG-GJAHR." OBLIGATORY DEFAULT V_GJAHR.
SELECT-OPTIONS SO_MONAT FOR itab-MONAT." OBLIGATORY DEFAULT V_PERIO.
INITIALIZATION.
CALL FUNCTION 'K_PERIOD_GET_FOR_DATE_KOKRS'
EXPORTING
KOKRS = '9000' " make sure you pass correct thing here, this is controlling area
DATE = SY-DATUM
IMPORTING
PERIO = SO_MONAT-low"V_PERIO i am directly passing the SO
GJAHR = SO_GJAHR-low"V_GJAHR here also
EXCEPTIONS
KOKRS_NOT_FOUND = 1
DATE_INVALID = 2
OTHERS = 3.
APPEND : SO_GJAHR, SO_MONAT. " and append