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

syntax for validating data..

Former Member
0 Likes
593

Hi friends

I have one internal table with material no.,i want o check wheather that data is there in standard table or not..

how to check..?

and after checking if that particular material is not there i have to move the data in other internal table..

plz give me one example also..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
570

Hi,

Loop at itab1.

select single matnr into itab1-matnr

from mara

where matnr = itab1-matnr.

if sy-subrc ne 0

move itab1 to itab2.

append itab2.

endif.

endloop.

Cheers.

...Reward if useful.

4 REPLIES 4
Read only

Former Member
0 Likes
570

For material MARA is the master table.

Check the table before selecting the data.

whether the material avilable or not?

tables : mara.

selection-screen begin................

parameter p_matnr like mara-matnr.

selection-screen end of..................

if p_matnr is not initial.

at selection-screen on p_matnr.

select single * from mara into mara where matnr = p_matnr.

if sy-subrc <> 0.

Raise the message.

endif.

endif.

Hope it will help you.

Regards,

Madan.

Edited by: Madan kurapati on May 19, 2008 11:36 AM

Read only

Former Member
0 Likes
570

Hi,

Loop at itab1.

select single matnr into itab1-matnr

from mara

where matnr = itab1-matnr.

if sy-subrc <> 0

move itab1 to itab2.

append itab2.

endif.

endloop.

Cheers.

...Reward if useful.

Read only

Former Member
0 Likes
571

Hi,

Loop at itab1.

select single matnr into itab1-matnr

from mara

where matnr = itab1-matnr.

if sy-subrc ne 0

move itab1 to itab2.

append itab2.

endif.

endloop.

Cheers.

...Reward if useful.

Read only

GauthamV
Active Contributor
0 Likes
570

hi,

after u select data from mara ,give condition as ,if itab1 is initial.message e000(zmsg).create 1 more itab and move data into it.

ex:itab2-matnr = itab1-matnr.append itab2.