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: 

Validation

Former Member
0 Kudos

Hi Guys,

I have a condition where I need to check each of record in my it_item table with field "ID No." against the material no. in MARA, and if I found any entry in mara with same Id no. then I have to execute an write statement" Material" otherwise I have to execute a write statement" Not a material"

Thanks

Rajeev Gupta

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rajeev,

LOOP AT it_item.

SELECT single matnr from mara where matnr = it_itam-id_no .

IF sy-subrc = 0.

WRITE 'Material'.

ELSE.

WRITE 'Not a material'.

ENDIF.

ENDLOOP.

Regards,

Atish

1 REPLY 1

Former Member
0 Kudos

Hi Rajeev,

LOOP AT it_item.

SELECT single matnr from mara where matnr = it_itam-id_no .

IF sy-subrc = 0.

WRITE 'Material'.

ELSE.

WRITE 'Not a material'.

ENDIF.

ENDLOOP.

Regards,

Atish