Search code examples
abapsap-guidynpro

How to select multiple ranges for a parameter WITHOUT first filling all other required parameters?


The picture

I'd want to be able to have multiple range selections for "Sales order no."

Problem is: when i press the button marked with green, i get the error "Fill in all required entry fields".

I put my main processing block at the START-OF-SELECTION event.

What to do to not have this happen? It seems to me that i should be able to add multiple selections without all the hassle of first filling every other mandatory field.


Solution

  • With parameters/select-options set to OBLIGATORY, this won't work. I had the very same problem some time ago, and had no chance to fill the OBLIGATORY input parameters with useful values by default, so I did the following:

    • Remove the OBLIGATORY option from all select-options and parameters
    • Handle the check for obligatory input yourself in cases no F4,help, F1 help or the button next to any select option is pressed:

    Code:

    AT SELECTION-SCREEN ON s_reswk.
    
    IF sy-ucomm(1) <> '%' AND      " sel screen action request
       sy-ucomm(1) <> '_' AND      " scope option
       s_reswk IS INITIAL.         " Obligatory input missing
       MESSAGE text-e01 TYPE 'E'.  " Error message
    ENDIF.