Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with AT SELECTION-SCREEN ON event

former_member305388
Active Contributor
0 Kudos

Hi Experts!!

In the below code, p_jan, p_feb are showing as blank though they are filled in. Is this how this event works?


PARAMETERS: p_categ TYPE zpycateg,
                         p_jan TYPE sy-datum,
                         p_feb TYPE sy-datum.

AT SELECTION-SCREEN ON p_categ.
IF NOT p_jan IS INITIAL.
***
ENDIF.

Please help me out.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

That event works for P_CATEG, here other parameters of the screen can't been seen.

If you want to do a validation has to check several parameters of a selection-screen you should use the event AT SELECTION-SCREEN.

Anyway if you think it's better the event AT SELECTION-SCREEN ON <screen field>, the values of other fields can be picked up bu fm DYNP_VALUES_READ

AT SELECTION-SCREEN ON P_CATEG.

  DATA: T_FIELDS TYPE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.

  T_FIELDS-FIELDNAME = 'P_JAN'. APPEND T_FIELDS.
  T_FIELDS-FIELDNAME = 'P_FEB'. APPEND T_FIELDS.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME     = SY-REPID
      DYNUMB     = SY-DYNNR
    TABLES
      DYNPFIELDS = T_FIELDS.


  READ TABLE T_FIELDS WITH KEY FIELDNAME = 'P_JAN'.
  IF NOT T_FIELDS-FIELDVALUE IS INITIAL.
***
  ENDIF.

Max

2 REPLIES 2

Former Member
0 Kudos

Hi

That event works for P_CATEG, here other parameters of the screen can't been seen.

If you want to do a validation has to check several parameters of a selection-screen you should use the event AT SELECTION-SCREEN.

Anyway if you think it's better the event AT SELECTION-SCREEN ON <screen field>, the values of other fields can be picked up bu fm DYNP_VALUES_READ

AT SELECTION-SCREEN ON P_CATEG.

  DATA: T_FIELDS TYPE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.

  T_FIELDS-FIELDNAME = 'P_JAN'. APPEND T_FIELDS.
  T_FIELDS-FIELDNAME = 'P_FEB'. APPEND T_FIELDS.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME     = SY-REPID
      DYNUMB     = SY-DYNNR
    TABLES
      DYNPFIELDS = T_FIELDS.


  READ TABLE T_FIELDS WITH KEY FIELDNAME = 'P_JAN'.
  IF NOT T_FIELDS-FIELDVALUE IS INITIAL.
***
  ENDIF.

Max

Former Member
0 Kudos

Hi Srinivas,

To check all the parameters on the selection screen, you can use the event AT SELECTION-SCREEN ON BLOCK.

This will serve your purpose.

Regards,

Sindhu.