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: 

Related to database

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.