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: 

dynamically checking of parameter

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Bhupender,

I didn't understand ur question...Plz post it again mentioning what the problem is ?

13 REPLIES 13

former_member223537
Active Contributor
0 Kudos

START-of-selection.

if sy-ucomm = 'ONLI'.

if p_field is initial.

message 'Please enter value for field XXX !' type 'I'.

endif.

endif.

0 Kudos

my field name is sanct so what i have to write.

0 Kudos

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

0 Kudos

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..

0 Kudos

SO IS I HAVE TO REDEFINE THAT PARAMETER IN THE AT SELECTION- SCREEN

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Hi Bhupender,

I didn't understand ur question...Plz post it again mentioning what the problem is ?

0 Kudos

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

0 Kudos

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..

Former Member
0 Kudos

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..

Former Member
0 Kudos

CAN I DYNAMICALLY MAKE A FIELD OBLIGATORY

0 Kudos

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..