cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching a transaction's output in the report

Former Member
0 Kudos

Hi,

I have to calculate stock on a particular date my report.

Transaction MB5B calculates stock on a particular date.

How can i pass the mandatory parameters to MB5B and fetch its output in the report itself?

Message was edited by: Nishant Gupta

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi !

SUBMIT the report RM07MLBD (that's the MB5B)

and pass the paramters as following example:

SUBMIT RM07MLBD with MATNR in p_matnr

... and so on

To get the output back to your report use the extension

exporting list to memory

from wich (the momeory) you can import the list to your report with the FM 'LIST_FROM_MEMORY'.

(See online help for the SUBMIT-Command).

Regards

Rainer

Some points would be nice if that helped a bit.

Former Member
0 Kudos

HI Rainer,

That was a really helpful answers. Could you provide a pseudo code for SUBMIT command and importing the list.

regards

Nishant

Former Member
0 Kudos

Hi !

There's a little more help.

These:

SELECTION-SCREEN BEGIN OF BLOCK Database-selection

WITH FRAME TITLE TEXT-001.

  • Text-001: Datenbankabgrenzungen

SELECT-OPTIONS: MATNR FOR MARD-MATNR MEMORY ID MAT

MATCHCODE OBJECT MAT1,

*{ INSERT PA9K013121 1

MFRPN FOR MARA-MFRPN MEMORY ID MPN

MATCHCODE OBJECT HTN,

*} INSERT

BUKRS FOR T001-BUKRS MEMORY ID BUK,

WERKS FOR T001W-WERKS MEMORY ID WRK,

LGORT FOR T001L-LGORT,

CHARG FOR MCHB-CHARG,

BWTAR FOR MBEW-BWTAR,

BWART FOR MSEG-BWART.

PARAMETERS SOBKZ LIKE MSEG-SOBKZ.

SELECTION-SCREEN SKIP.

SELECT-OPTIONS: DATUM FOR MKPF-BUDAT NO-EXTENSION.

  • Datumsintervall für Selektion

SELECTION-SCREEN END OF BLOCK Database-selection.

is the selection screen of the RM07MLBD.

All these parameters (i.e .MATNR, CHARG, BWART) can be passed with the submit command.

For example (where the p_... Parameters are parametes of YOUR report !).

SUBMIT RM07MLBD

with matnr in p_matnr

with bwart in p_bwart

with charg in p_cahrg

and return

exporting list to memory.

The import if the list is a bit more dificult.

It's basically like this:

DATA LISTTAB LIKE LISTOBJECT

OCCURS 1.

CALL FUNCTION 'LIST_FROM_MEMORY' TABLES LISTOBJECT = LISTTAB.

Then the list will be in the table LISOBJECT.

For more info see the docu of 'LIST_FROM_MEMORY'

Regards

Rainer

Former Member
0 Kudos

Thanks a lot Rainer.

PS: points will be awarded to helpful answers.

Answers (4)

Answers (4)

Former Member
0 Kudos

HI

GOOD

CAN YOU GIVE ME SOME DETAILS ABOUT YOUR REQUIREMENT,AND FOR WHICH FIELD YOU WANT THE MANDATORY PARAMETERS.

THANKS

MRUTYUN

Former Member
0 Kudos

Hi Nishant,

Basically MB5B is a standard report , so you can use SUBMIT rep WITH SELECTION-TABLE seltab. and can get the output.

<i>Hope This Info Helps YOU.</i>

Regards,

Raghav

hymavathi_oruganti
Active Contributor
0 Kudos

by using SET PARAMETER ID , u can pass the mandatory values

and use CALL TRANSACTION AND SKIP FIRST SCREEN.

to find out parametr id, press f1 on the field and go to technical settings, ther u can find out. or else, in the dataelement of the field u can find out paramter id

former_member181962
Active Contributor
0 Kudos

Call the transaction mb1b in you r program after setting the mandatory parameters on the selection screen of mb5b.

set parameter <parameter> <parameter id> value <value>.

call tyransaction 'MB5B' and skip first screen.

Regards,

Ravi