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

Misc

Former Member
0 Likes
584

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
552

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

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
552

This may take a while.



data: imara type table of mara with header line.


select * into table imara from mara
             where meins = 'CS'
               and bstme = 'UN'.
loop at imara.
  write:/ imara-matnr.
endloop.




Regards,

Rich Heilman

Read only

Former Member
0 Likes
553

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

Read only

Former Member
0 Likes
552

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