Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

FAQs

How can I define my own F4 Input help processing for a field on the selection screen?

You can use the event AT SELECTION-SCREEN ON VALUE REQUEST FOR <fieldname> for defining your own input help for selection screen fields.

PARAMETER: p_Sample TYPE c LENGTH 10.

AT SELECTION-SCREEN ON VALUE REQUEST FOR p_Sample.
BREAK-POINT. " don´t forget to remove
"Do your processing here...

back to top

How can I set the initial values for SELECT OPTIONS at the start of the program?

In the event INITIALIZATION and AT SELECTION-SCREEN OUTPUT you could set the initial values for the selection screen fields. For SELECT OPTIONS you should fill the SIGN, OPTION, LOW, HIGH fields.

Eg: Set the date field with starting day of the month to last day of the month.

SELECT-OPTIONS: s_date FOR sy-datum.

INITIALIZATION.
  s_date-sign = 'I'.
  s_date-option = 'BT'.
  date+6(2) = '01'.
  s_date-low = sy-datum.
  CALL FUNCTION 'LAST_DAY_OF_MONTHS'
    EXPORTING
      day_in            = sy-datum
    IMPORTING
      last_day_of_month = s_date-high
    EXCEPTIONS
      day_in_no_date    = 1.
  APPEND s_date.
Initial values can be given&nbsp;at: AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
&nbsp; s_date-sign = 'I'.
&nbsp; s_date-option = 'BT'.
&nbsp; date+6(2) = '01'.
&nbsp; s_date-low = sy-datum.
&nbsp; CALL FUNCTION 'LAST_DAY_OF_MONTHS'
&nbsp;&nbsp;&nbsp; EXPORTING
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; day_in&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = sy-datum
&nbsp;&nbsp;&nbsp; IMPORTING
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; last_day_of_month = s_date-high
&nbsp;&nbsp;&nbsp; EXCEPTIONS
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; day_in_no_date&nbsp;&nbsp;&nbsp; = 1.
&nbsp; APPEND s_date.

back to top

How can we change screen fields on run time?

The parameters and radio button selection at Selection screen can be changed as below...

parameters:
  p_mypar TYPE C LENGTH 15,
  rd1     TYPE flag RADIOBUTTON group g1 default 'X' MODIF ID ID1 ,
  rd2     TYPE flag RADIOBUTTON group g1 MODIF ID ID2 ,
  rd3     TYPE flag RADIOBUTTON group g1 MODIF ID ID3.


AT SELECTION-SCREEN output.
  PERFORM sub_Output.

FORM sub_Output.
  IF p_mypar = ''.
    LOOP AT SCREEN.
      IF screen-group1 = 'ID1' OR screen-group1 = 'ID2' OR screen-group1 = 'ID3' .
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDFORM.

back to top