‎2007 Aug 15 6:57 PM
Hi Guys,
I have a requirement where I need to go to mara table and collect matnr where mara-meins = 'CS' and mara-bstme= 'UN'
Can you help me to write the syntax for the above condition.
Thanks
Rajeev Gupta
‎2007 Aug 15 7:07 PM
Hi Rajeev,
Report Z1234567.
Tables: MARA.
*Internal table for mara
data: begin of i_mara OCCURS 0,
matnr like mara-matnr,
end of i_mara.
*Start of Selection Event
Start-of-Selection.
select matnr into table i_mara from mara
where meins = 'CS'
and bstme = 'UN'.
Loop at i_mara.
write:/ i_mara-matnr.
Endloop.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa
‎2007 Aug 15 7:00 PM
‎2007 Aug 15 7:07 PM
Hi Rajeev,
Report Z1234567.
Tables: MARA.
*Internal table for mara
data: begin of i_mara OCCURS 0,
matnr like mara-matnr,
end of i_mara.
*Start of Selection Event
Start-of-Selection.
select matnr into table i_mara from mara
where meins = 'CS'
and bstme = 'UN'.
Loop at i_mara.
write:/ i_mara-matnr.
Endloop.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa
‎2007 Aug 15 7:36 PM
Hi Rajeev,
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MARA-MATNR,
END OF TY_MARA.
DATA IT_MARA TYPE STANDARD TABLE OF TY_MARA WITH HEADER LINE.
SELECT MATNR
FROM MARA
INTO TABLE IT_MARA
WHERE MEINS = 'CS' AND BSTME = 'UN'.
IF IT_MARA[] IS NOT INITIAL.
WRITE:/ IT_MARA-MATNR.
ENDIF.
Thanks,
Vinay