06-13-2007 6:42 AM
i have one text field (parameter) i want when i execute the report that field cannot be left empty using obligatory will not serve purpose as i want to check only when i execute the report. is there any way please help
06-13-2007 6:46 AM
Hi Bhupender,
I didn't understand ur question...Plz post it again mentioning what the problem is ?
06-13-2007 6:44 AM
START-of-selection.
if sy-ucomm = 'ONLI'.
if p_field is initial.
message 'Please enter value for field XXX !' type 'I'.
endif.
endif.
06-13-2007 6:45 AM
06-13-2007 6:50 AM
Hi
try this
start-of-selection.
if sanct is initial.
message i000(oo) with 'Please enter value in the field sanct'.
LEAVE LIST-PROCESSING.
endif
06-13-2007 6:52 AM
Hi Bhupinder,
Using the validation is start of slelection and writing a text message would leave you with the message in another screen from which you'll have to go back to come to program. So donot use it.
The best way is to validate in the AT selection-screen itself and this would help you stay in the selection screen and ensures that the user enters the value for the obligatory or the mandatory field.
Hope this solves your query.
Reward Points if useful.
Thanks,
Tej..
06-13-2007 7:04 AM
SO IS I HAVE TO REDEFINE THAT PARAMETER IN THE AT SELECTION- SCREEN
06-13-2007 6:44 AM
Hi
Write the validation of rthat field in start-of-selection
declare that field as
paramters: p_bukrs like t001-bukrs.
start-of-selection.
if p_bukrs is initial.
message e000 with 'Enter company code field'.
endif.
Reward points for useful Answers
Regards
Anji
Message was edited by:
Anji Reddy Vangala
06-13-2007 6:51 AM
i want the after that control will be again come back at my selection screen when i apply ur code the whole screen got blank
06-13-2007 6:46 AM
Hi Bhupender,
I didn't understand ur question...Plz post it again mentioning what the problem is ?
06-13-2007 6:56 AM
i have one parmeter sanctioned_amount whose value user have to write and it can not left empty when i make this field obligatory other field not behave as required so what i want on exection if that field is left blank a message in shown and then the control will come back on same selection screen
06-13-2007 7:03 AM
Hi,
----
AT SELECTION-SCREEN *
----
AT SELECTION-SCREEN.
*-----If no value has been entered.
IF p_vbeln IS INITIAL.
MESSAGE text-002 TYPE 'E'.
ENDIF.
Bhupinder, this should solve your query.
This is the solution to your query.
Reward Points.
Thanks,
Tej..
06-13-2007 6:48 AM
Hi Bhupinder,
AT SELECTION-SCREEN.
In this event the key field obligatory gets checked before the program gets executed so use obligatory inside the AT SELECTION-SCREEN event and this should solve your query.
Reward Points if useful.
Thanks,
Tej..
06-13-2007 7:06 AM
06-13-2007 7:32 AM
Hi,
Look at this piece of code..
----
SELECTION-SCREEN *
----
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_vbeln LIKE vbrk-vbeln.
SELECTION-SCREEN: END OF BLOCK b1.
----
AT SELECTION-SCREEN *
----
AT SELECTION-SCREEN.
*-----If no value has been entered.
IF p_vbeln IS INITIAL.
MESSAGE text-002 TYPE c_error.
ENDIF.
Thanks,
Tej..