2007 Sep 05 2:07 PM
Hi Pals,
i have to make a report in which i have to check for available stock ststus.
so my question is how can i check it .
table structure is like this:
zkap_stk - master table for medecine stock
zkap_med - table for requested amount of med.
A code example will help to understand.
Thanks in advance
Kapil Malik
2007 Sep 05 2:14 PM
Inner join is a better option.
Select aabc bdef into table itab from zkap_stk as a inner join zkap_med as b on zkap_stk-xx = zkap_med-xx.
In the above statement abc is a field in table zkap_med
In the above statement def is a field in table zkap_med
In the above statement xx is a common field in both tables
2007 Sep 05 2:13 PM
HI,
FORM stock_get.
select * from mard where matnr eq wa_jitma2-matnr
and lgort eq '1000'
and werks eq dwerks.
move: mard-labst to it_ausgabe-bestand_f.
endselect.
ENDFORM.
regards
Nicole
2007 Sep 05 2:14 PM
Inner join is a better option.
Select aabc bdef into table itab from zkap_stk as a inner join zkap_med as b on zkap_stk-xx = zkap_med-xx.
In the above statement abc is a field in table zkap_med
In the above statement def is a field in table zkap_med
In the above statement xx is a common field in both tables
2007 Sep 05 2:25 PM
loop at zkap_med.
select stock into itab from zkap_stk where matnr = zkap_med-matnr.
if itab = 0.
write 'The Stock is Zero'.
else
write 'the stock is ' itab.
clear itab.
endloop.