07-19-2013 10:52 AM
Hello,
would need to know if there is any function that returns the stock of a material on a specific date such as stock material to 16/03/2013
Otherwise, how could calculate the stock of a material to a specific date?
thanks in advance
07-21-2013 3:57 PM
Hello Juan,
this is a classic problem which i have faced in many implementation projects. Now i have found a solution for this. You may be knowing the standard MB5B transaction for doing this and it gives the correct stock with various selection parameters. What i have done is that i have encapsulated this transaction with the selection parameters i want into a function module. For example steps.
Create a Function module with the parameters you want ( as you are saying the date). keep that as an importing parameters . say IM_DATE as importing parameter
inside the sourcecode write
types : begin of ty_list,
text(256) type c,
end of ty_list.
data : IS_RSPAR type RSPARAMS,
IT_RSPAR type table of RSPARAMS,
IT_LIST type standard table of ABAPLIST,
IT_LIST1 type standard table of ty_list.
clear : IS_RSPAR
IS_RSPAR-SELNAME = 'DATUM'.
IS_RSPAR-KIND = 'S'.
IS_RSPAR-LOW = IM_DATE.
IS_RSPAR-HIGH = IM_DATE.
IS_RSPAR-SIGN = 'I'.
IS_RSPAR-OPTION = 'BT'.
append IS_RSPAR to IT_RSPAR.
submit RM07MLBD with selection-table IT_RSPAR exporting list to memory and return.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_list
EXCEPTIONS
not_found = 1
others = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = it_list1
listobject = it_list.
debug now and see the contents of IT_LIST1
you will find the stock values in one row of the above internal table. Now you can start reading the IT_LIST1 and play with the string according to your need and get the required string in the output parameter of the function module.
Regards
Animesh Sundriyal
07-22-2013 2:41 PM
Hello Animesh,
to restrict the selection should put more as input parameter the article, society, central and date.
How I can pass these parameters through RSPARAMS?
thanks
,
04-09-2014 9:00 AM
07-22-2013 2:37 PM
Hello Animesh,
to restrict the selection should put more as input parameter the article, society, central and date
How I can pass these parameters through RSPARAMS?
thanks,
07-22-2013 9:55 PM
Hello Juan,
yes you can surely restrict the selection using more input parameters. in my case i have done the same can you give me the technical names of the fields so that i can write the code.
Regards
Animesh Sundriyal
07-23-2013 10:52 AM
Hello Animesh,
I have already solved, thank you very much you have been very helpful.
Regards
07-23-2013 10:52 AM
Hello Animesh,
I have already solved, thank you very much you have been very helpful.
Regards
07-23-2013 3:42 PM
07-22-2013 2:54 PM
Dear Juan
There is a table - MARDH
This table stores the stock as on Period
Material + Plant + Storage Location + Year + Period
Suppose you want to take stock as on today, then
1. From the above table take the balance of 2013 and Period 6.
2. From MSEG table calculate the Receipts and Issues based on movement type
3. Arrive the closing balance
Regards,
Venkat
07-22-2013 3:43 PM
07-23-2013 7:49 AM