Application Development and Automation 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: 
Read only

How to find opening quantity and value while debugging MB5B tcode

Former Member
0 Likes
992

Hi,

I want to find opening quantity and value for a material with given date while debugging MB5B tcode.Can anyone tell me.

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
831

Hi Ganesh,

1.Copy mb5b program (RM07MLBD) to z program .

2.Submit to this copied Z program from your Z program by passing parameters.

3.Export  g_t_totals_flat it table from copied Z program to memory id..

4 import it table from memory id after your submit statement in your z program.

5 Fields ANFMENGE and ENDMENGE of g_t_totals_flat will give you the OPENING and CLOSING quantities repectively.

   Rest of the material movement quantities can be calculated and segregated By fetching data from MSEG and processing them using different Movement  types.

you will get all the columns which is displayed in mb5b program.

Check these links it will help to you..

http://scn.sap.com/docs/DOC-33774

in above link they have made enhancement for mb5b. if you copied to z program as i told in above steps no need to enhance standard program.

Reward points if it is helpful.

let me know if you have any query

Thanks & Regards

Santosh

Read only

0 Likes
831

Hi Santosh,

Actually i have developed report on Price Stock Ledger with selection screen fields are Region,Date,Site,Material Number.Now  calculated all quantities(Intransit,urchase,Sales) and Values.If i will give Date as 01.07.2013 to 31.07.2013,period is 3.So we fetch the data from MBEWH table.But in my Values some difference is coming for materials comparing MBEWH table value.I don't know where i went wrong.Please help me.If needed i will post my entire program.

Thanks

Read only

0 Likes
831

Hi Ganesh,

My above solution is to get opening and closing stock values of materials as MB5B output.

But as per your reply it is fully customized report..by debugging only we can found solution.