Skip to Content
0
Former Member
Mar 06, 2009 at 05:33 AM

calculation of dead stock

407 Views

Hi,

I have to calculate dead stock for the particular matetrial.Program what i did is showing current

stock of the material.I need to calculate dead stock.(tcode-MC50).

TABLES: S031, MBEW, MARA,marc.

types : begin of ty_mara,

matnr type mara-matnr,

mtart type mara-mtart,

werks type marc-werks,

maktx type makt-maktx,

BWKEY TYPE MBEW-BWKEY,

LBKUM TYPE MBEW-LBKUM,

SALK3 TYPE MBEW-SALK3,

SPMON TYPE S031-SPMON,

LGORT TYPE S031-LGORT,

BASME TYPE S031-BASME,

MGVBR TYPE S031-MGVBR,

MZUBB TYPE S031-MZUBB,

MAGBB TYPE S031-MAGBB,

end of ty_mara.

data : it_mara type table of ty_mara with header line.

select-options : s_mtart for mara-mtart,

s_werks for marc-werks,

S_SPMON FOR S031-SPMON.

start-of-selection.

SELECT * FROM Mara AS A INNER JOIN Marc AS B ON AMatnr EQ BMatnr

inner join makt as C on Amatnr eq cmatnr inner join mbew as d

on Amatnr eq Dmatnr and Bwerks eq dbwkey inner join s031 as e

on Amatnr eq ematnr and bwerks eq ewerks

INTO CORRESPONDING FIELDS OF TABLE IT_mara

WHERE A~Mtart in s_mtart

AND b~werks in s_werks

and e~spmon in s_spmon.

loop at it_mara.

write : / it_mara-matnr,it_mara-werks,it_mara-lbkum,it_mara-mzubb,it_mara-magbb.

endloop.

Here LBKUM is showing current stock of the material.How to calculate dead stock value.

Regards,

Bathri..