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: 

STOCK QUERRY

Former Member
0 Kudos

Which object should I use if I want to check the number of items in stock? I have the material number and the Cost Center as inputs and want the quantity in stock as the result

I was thinking WarehouseStock but i dont really know what it does...

ps: SAP 46C

thanks in advance

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

"Stocks" are kept in the MARD table. Or for special stock, the MSKA table. You can hit them directly or I believe that there are function modules.

Regards,

Rich Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

"Stocks" are kept in the MARD table. Or for special stock, the MSKA table. You can hit them directly or I believe that there are function modules.

Regards,

Rich Heilman

0 Kudos

How can I directly access the table? Can I do it through a BAPI? do I have to use RFC_READ_TABLE because from what I have read it is flawed...

anyway, thank you

0 Kudos

Are you trying to access this data from outside of R/3?

Regards,

Rich Heilman

0 Kudos

If you want to access this data in an ABAP program, then just do select statements against these tables.

ex.



Select LABST from mard into stockqty
              where matnr = p_matnr
                and werks = p_werks
                and lgort = p_lgort.

This will give you the current inventory stock for that material/plant/storage location.

Regards,

Rich Heilman

0 Kudos

Actually I am using an ASP page which instantiates the connector (dcom). I thought I could simply create and object which would have a function to either access the tables or retrieve the info I wanted.

0 Kudos

Ahhh....I see. Don't know if there is an RFC enabled function module or BAPI what would give you these numbers or not. Do you an ABAP developer handy that could write you a quick RFC enabled function module?

Regards,

Rich Heilman

0 Kudos

actually no... but I am going to test the WarehouseStock module if I find it useful I will use it.

thanks anyway!