‎2009 Sep 10 3:20 AM
Hi all,
Please give me the solutions to the following in selection screen:
1. In selection-screen there is one select-options and one parameter.
Now,if the select-opotions range is given 30 to 40 then, the parameter should be populated with 'A'.
If the select -options is given the value 50, then the value should be 'P'.
If the select-optons is given the value 65,then the value should be 'X'.
if the select-options is given the value 87, then the value should be 'N'.
2) In the selection - screeen there is one check box and select-options.
By default the check-box will be deselected and select-options will be defaulted with system date.
Now, when the checkbox is selected the select-options should be empty.
And again, when the checkbox is deselected then again the select-optons should be populated with system date.
Please let me know solutions to the above asap.
All points will be awarded.
Thanking you in advance.
Regards,
A.Srinivas
‎2009 Sep 10 4:09 AM
Hi Srinu,
Try below code. I have used matnr in select-options. Change it according to your data element.
TABLES: mara.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
PARAMETERS: p_c TYPE c.
PARAMETERS: p_chk AS CHECKBOX USER-COMMAND chk.
SELECT-OPTIONS: s_date FOR sy-datum DEFAULT sy-datum.
AT SELECTION-SCREEN.
IF p_chk = 'X'.
CLEAR s_date[].
ELSE.
s_date-low = sy-datum.
APPEND s_date.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF s_date[] IS NOT INITIAL.
p_chk = ''.
ENDIF.
LOOP AT s_matnr.
IF s_matnr-low = '000000000000000030' AND s_matnr-high = '000000000000000040'.
p_c = 'A'.
exit.
ENDIF.
CASE s_matnr-low.
WHEN '000000000000000050'.
p_c = 'P'.
WHEN '000000000000000065'.
p_c = 'X'.
WHEN '000000000000000087'.
p_c = 'N'.
ENDCASE.
ENDLOOP.
‎2009 Sep 10 4:09 AM
Hi Srinu,
Try below code. I have used matnr in select-options. Change it according to your data element.
TABLES: mara.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
PARAMETERS: p_c TYPE c.
PARAMETERS: p_chk AS CHECKBOX USER-COMMAND chk.
SELECT-OPTIONS: s_date FOR sy-datum DEFAULT sy-datum.
AT SELECTION-SCREEN.
IF p_chk = 'X'.
CLEAR s_date[].
ELSE.
s_date-low = sy-datum.
APPEND s_date.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF s_date[] IS NOT INITIAL.
p_chk = ''.
ENDIF.
LOOP AT s_matnr.
IF s_matnr-low = '000000000000000030' AND s_matnr-high = '000000000000000040'.
p_c = 'A'.
exit.
ENDIF.
CASE s_matnr-low.
WHEN '000000000000000050'.
p_c = 'P'.
WHEN '000000000000000065'.
p_c = 'X'.
WHEN '000000000000000087'.
p_c = 'N'.
ENDCASE.
ENDLOOP.
‎2009 Sep 10 4:15 AM
Hey dear,
small correction to your code.
Thanks
Venkat.OREPORT ZTEST_PROGRAM.
TABLES: MARA.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
PARAMETERS: P_C TYPE C.
PARAMETERS: P_CHK AS CHECKBOX USER-COMMAND CHK.
SELECT-OPTIONS: S_DATE FOR SY-DATUM DEFAULT SY-DATUM.
AT SELECTION-SCREEN.
IF P_CHK = 'X'.
CLEAR S_DATE[].
ELSE.
CLEAR S_DATE[]."Clearing selection table.
S_DATE-LOW = SY-DATUM.
APPEND S_DATE.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF S_DATE[] IS NOT INITIAL.
P_CHK = ''.
ENDIF.
LOOP AT S_MATNR.
IF S_MATNR-LOW = '000000000000000030' AND S_MATNR-HIGH = '000000000000000040'.
P_C = 'A'.
EXIT.
ENDIF.
CASE S_MATNR-LOW.
WHEN '000000000000000050'.
P_C = 'P'.
WHEN '000000000000000065'.
P_C = 'X'.
WHEN '000000000000000087'.
P_C = 'N'.
ENDCASE.
ENDLOOP.
‎2009 Sep 10 4:40 AM
Hi Srinu ,
You can achive the same by using events of report.
Search in google or sdn for details.
You can also use F1 help on at selection-screen , initialization etc.
‎2009 Sep 10 5:27 AM
hi,
Try this
TABLES: vbak.
SELECT-OPTIONS: so_vbeln FOR vbak-vbeln.
PARAMETER: p_value TYPE c.
SELECT-OPTIONS: so_date FOR sy-datum DEFAULT sy-datum.
PARAMETER: p_chk AS CHECKBOX.
AT SELECTION-SCREEN OUTPUT.
LOOP AT so_vbeln.
IF so_vbeln-low = '0000000030'.
p_value = 'A'.
ENDIF.
IF so_vbeln-low = '0000000050'.
p_value = 'P'.
ENDIF.
IF so_vbeln-low = '0000000065'.
p_value = 'X'.
ENDIF.
IF so_vbeln-low = '0000000087'.
p_value = 'N'.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
IF p_chk = 'X'.
REFRESH so_date.
ENDIF.
IF p_chk <> 'X'.
so_date-low = sy-datum.
APPEND so_date.
ENDIF. Edited by: Jk on Sep 10, 2009 6:27 AM