cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Determine the result of MB5B using a program

oliver_ried
Explorer
0 Likes
4,858

Hi,

is there a way to get the data from the MB5B through a program?

Is there a function module for this? I did not find any.

I need the non-hierarchical representation from the MB5B:

Material, date, initial stock, total receipt quantities, total issue quantities, final stock,

initial value, total access values, total exit values, end value

I would like to have this data collected regularly for the past week or the previous month via a program.

Is this possible without having to reprogram the MB5B?

Accepted Solutions (0)

Answers (3)

Answers (3)

Dominik_Tylczynski
SAP Champion
SAP Champion

Hi, depending on your exact requirements you have couple options:

  1. If you care only about stock at the end of a month, you can write a FM by yourself and get the data from MARCH, MARDH, MBEWH tables
  2. If you need exactly the same data as MB5B produces you have two options:
  • Build a FM wrapper around MB5B: call MB5B in background with SUBMIT ... EXPORTING LIST TO MEMORY AND RETURN; use FM LIST_FROM_MEMORY to read the MB5B output; parse the list and return in to your FM
  • Change MB5B slightly and grab the output data just before REUSE_ALV_LIST_DISPLAY is called.

Also take a look at:

https://answers.sap.com/questions/51163/abap-background-job-submit-with-exporting-list-to.html

https://blogs.sap.com/2013/07/16/background-processing-for-alv-reports/

HTH

Dominik Tylczyński

oliver_ried
Explorer

@Dominik: Thank you for the answer. I have used the FM wrapper with SUBMIT and LIST_FROM_MEMORY. It works like a charm! Thank you very much!

0 Likes

Hi Oliver,

Could you please help me with the screenshot of the code that you are using. I tried exporting the data from MB5B program but I am not getting complete set. Perhaps I am exporting incorrect internal table.

Babu_Mysore
Explorer
0 Likes
Could you please share the Codes , we need to implement the same our abaper is unable to get this working.. Thanks in advance
holakac
Explorer
0 Likes

Hello,

for FMs check https://archive.sap.com/discussions/thread/1502357.

About your request - just schedule a job and collect it's results.