2016 Jun 08 5:11 AM
I have a selection screen with some elements.There are some radio buttons also.According to the value of these radio buttons the selection screen is modified like some fields are visible while some are not (using AT SELECTION SCREEN OUTPUT for this). I also have some fields which are mandatory so i have used obligatory for them.
But as soon as user selects a radio button, these automatic mandatory checks trigger and if the field is empty it displays an error that the field is mandatory.But i want these checks to be performed when user presses F8(executes it).I have the option of writing my own method at AT START OF SELECTION.But i was wondering, is it possible to achieve this with automatic checks itself.
2016 Jun 08 5:47 AM
Hi Gaurav,
Don't make the field obligatory. Instead in the Event AT SELECTION-SCREEN Place a check like below.
If SY-UCOMM EQ 'ONLI' AND p_name IS INITIAL.
Message text-000 TYPE 'E'.
ENDIF.
ONLI -> Function Code for Execute Button/F8.
This serves the same purpose as of making the field mandatory/obligatory.
Thanks and Regards,
Vinay Mutt
2016 Jun 08 5:41 AM
this should help you, a little different approach that you will need to apply
2016 Jun 08 5:47 AM
Hi Gaurav,
Don't make the field obligatory. Instead in the Event AT SELECTION-SCREEN Place a check like below.
If SY-UCOMM EQ 'ONLI' AND p_name IS INITIAL.
Message text-000 TYPE 'E'.
ENDIF.
ONLI -> Function Code for Execute Button/F8.
This serves the same purpose as of making the field mandatory/obligatory.
Thanks and Regards,
Vinay Mutt
2016 Jun 08 8:45 AM
2016 Jun 08 8:51 AM
Marking this as answer as i guess this is the closest to the solution.
2016 Jun 08 9:08 AM
Regards,
Raymond
2016 Jun 08 9:22 AM
2016 Jun 08 10:07 AM
Hi Gaurav,
Suggestion from Raymond is Instead of using sy-ucomm, We have to use sscrfields-ucomm.
To use this we have to make declaration like TABLES: SSCRFIELDS.
Regards,
Vinay Mutt
2016 Jun 08 10:18 AM
Hi, I wanted to know what benefit sscrfields-ucomm serves over sy-ucomm?
2016 Jun 08 10:47 AM
The default rule written in SAP documentation is "never use sy-ucomm", always use ok_code or sscrfields-ucomm in selection-screen.
It is not recommended that the system field sy-ucomm instead of sscrfields-ucomm is evaluated, since this does not guarantee that sy-ucomm is always given the correct value in selection screen processing.
Regards,
Raymond