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

validation for incoming data from the structure

Former Member
0 Likes
758

Hi.

i have to do the validation for the incoming data from the structure based on a key field.

say from example,if no material found for that key field,give the error.

in this case,what could be the select and sy-subrc statement.

thanks in adv.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
706

Hi,

If you want stop the execution then go for the error i.e E.

Or if you want to proceed with the execution without stopping then go for the warning message.

If sy-subrc not equal to 0.

<your option>

Endif.

Aswarth

Edited by: Aswarthanarayana Mylavaram on Jun 2, 2009 9:47 AM

Edited by: Aswarthanarayana Mylavaram on Jun 2, 2009 9:48 AM

Edited by: Aswarthanarayana Mylavaram on Jun 2, 2009 9:48 AM

Hi.

i have to do the validation for the incoming data from the structure based on a key field.

say from example,if no material found for that key field,give the error.

in this case,what could be the select and sy-subrc statement.

thanks in adv.

3 REPLIES 3
Read only

Former Member
0 Likes
706

Hi,

At run time, let's say MARA structure MATNR field got populated with the material number and you want to validate it.

Then write a select command like,

SELECT SINGLE MATNR

FROM MARA

INTO V_MATNR

WHERE MATNR = MARA-MATNR.

IF SY-SUBRC not equal to 0.

MESSAGE E000 WITH 'No suitable material found for the selection'.

ENDIF.

But do remember that, validation for the particular field will be done on it's check table only if it is available.

Regards,

Santhosh

Read only

Former Member
0 Likes
706

write select single command and then

if sy-subrc = 0.

then pass e000 message (error messgae)

Read only

Former Member
0 Likes
707

Hi,

If you want stop the execution then go for the error i.e E.

Or if you want to proceed with the execution without stopping then go for the warning message.

If sy-subrc not equal to 0.

<your option>

Endif.

Aswarth

Edited by: Aswarthanarayana Mylavaram on Jun 2, 2009 9:47 AM

Edited by: Aswarthanarayana Mylavaram on Jun 2, 2009 9:48 AM

Edited by: Aswarthanarayana Mylavaram on Jun 2, 2009 9:48 AM