Skip to Content
-2

Dependent parameter in selection screen

Hello guys,

I'm facing the problem to fill a parameter dependent on another parameter in the selection screen. Of course the filling of the parameter is not the problem because I can do that whenever it gets changed in event AT SELECTION SCREEN OUTPUT.

But my problem is how can I differentiate when user wants to change the parameter manually. Let me explain.

I have parameter date A which is at start 31.03.2018 and date B which is set like date A to 31.03.2018. Now when user changes date A to 31.05.2018, date B should also change to that. But, now here is the point, when user wants to change date B manually it should not get overwritten by date A. How can I use that? I thought at USER-COMMAND but I canot assign that to date field. And event enter also does not work because I only need the overwriting when user changes field A.

Regards

Michael

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 13 at 01:15 PM

    Have you thought of using an extra variable which also contains the value for date A.

    In the AT SELECTION SCREEN compare it to the value of date A and if there is no change do nothing?

    Add comment
    10|10000 characters needed characters exceeded

    • I use Initilization just to set the initial value. The AT SELECTION_SCREEN ON part does the rest. Also I didn't put in AT SELECTION_SCREEN OUTPUT because like you said that that is the PBO and I only want to action perform on the action on the date parameter and not every time which would happen if I placed it there.

  • Jun 14 at 06:23 AM

    Check the following code

    PARAMETERS lv_a TYPE sy-datum.
    PARAMETERS lv_b TYPE sy-datum.
    AT SELECTION-SCREEN ON lv_a.
      lv_b = lv_a.

    Here the two parameters are dates and when you press enter the date is changed. but only if data is entered in lv_a

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Sooraj,

      I thought like that but unfortunately thats not correct. Event gets triggered when pressing enter no matter which date is changed. I debugged it and get into it whenever pressing enter.

      Regards

      Michael