Application Development and Automation 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: 
Read only

report

Former Member
0 Likes
505

hi frens,

In my selection screen i have three fields and i have to validate..i tried using at selection screen can u pls suggest how to do that..by giving an example...the main problem is i shld check with iniial and if the entry does not exists it has to dispaly message like no data maintained ....i tried but its not working.

its very urgent.

thanks in advance,

malathi

5 REPLIES 5
Read only

Former Member
0 Likes
474

you can do the checking in at selection-screen output

at selection-screen output.

if not <field1 is initial.

*Do your validation here

if sy-subrc ne 0.

*throw error message

endif.

endif.

Read only

Former Member
0 Likes
474

Hi,

E.g. if your field is say pa_vbeln & if it is initial you have to display error, then code as follows,

AT SELECTION-SCREEN ON pa_vbeln.

IF pa_vbeln IS INITIAL.

MESSAGE E000.

ENDIF.

similarly for the remaining fields .

Regards,

Raghavendra

Read only

Former Member
0 Likes
474

Hi,

Post u'r code.

You can do validtion in the event At selection-screen or AT SLELECTION-SCREEN ON FIELDNAME.

if field is initial.

issue message.

else.

check the existence of data in database tables.

if sy-subrc <> 0.

issue error message.

endif.

enidf.

Regards,

Arun

Read only

Former Member
0 Likes
474

hi malathi,

AT SELECTION-SCREEN.

IF NOT S_MATNR IS INITIAL.

SELECT SINGLE MATNR FROM MARA

INTO V_MATNR

WHERE MATNR IN S_MATNR.

IF SY-SUBRC <> 0.

MESSAGE E001(ZZ2).

ENDIF.

ELSE.

MESSAGE E000(ZZ2).

ENDIF.

hope this helps,

do reward if it helps,

priya.

Read only

Former Member
0 Likes
474

hi mani,

AT SELECTION-SCREEN ON p_vbeln.

IF not p_vbeln IS INITIAL.

"write the validation code here

ELSE.

MESSAGE E000.

ENDIF

AT SELECTION-SCREEN ON p_vbelp.

IF not p_vbelp IS INITIAL.

"write the validation code here

else.

MESSAGE E000.

ENDIF

Regards,

Richa.