Application Development 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: 

How to call a module pool program and get its output

Anindya
Explorer
0 Kudos
7,132

Hi All,

SUBMIT <prog name> ...

EXPORTING LIST TO MEMORY

AND RETURN.

Using the above SUBMIT in conjunction with FM - LIST_FROM_MEMORY and LIST_TO_ASCI, I can read the output of a report program. Now is there a way to do the same in case of a module pool program i.e I need to call a module pool program from my program and get its output.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,379

Hi,

Which transaction are you trying to call. Suppose you want  PO information from ME23N , you will get the information by calling BAPI 'BAPI_PO_GETDETAIL1'. Similarly for other transactions, you will have BAPI's to display the details. Check BAPI's ending with 'GET_DETAILS' .

Regards,

DPM

11 REPLIES 11

arivazhagan_sivasamy
Active Contributor
0 Kudos
1,379

Hi,

You can call using

set parameter id <id name> field <Value>.

CALL Transaction <TCode> and skip initial screen.

For Eg,

Set parameter id 'MAT' field 'Material1'.

CALL TRANSACTION MM03 AND SKIP INITIAL SCREEN.

Arivazhagan S

Former Member
0 Kudos
1,380

Hi,

Which transaction are you trying to call. Suppose you want  PO information from ME23N , you will get the information by calling BAPI 'BAPI_PO_GETDETAIL1'. Similarly for other transactions, you will have BAPI's to display the details. Check BAPI's ending with 'GET_DETAILS' .

Regards,

DPM

karun_prabhu
Active Contributor
0 Kudos
1,379

Hello.

A module pool program cannot be executed without a tcode.

So in order to invoke a module pool program, you have to use CALL TRANSACTION.

In order to get output from it, you might export the data from Module pool program and import it in calling program.

Regards.

nabheetscn
Active Contributor
0 Kudos
1,379

Hi Anindya

Is it a custom module pool or standard one..?Please provide the details

Nabheet

0 Kudos
1,379

Hi Nabheet,

It is a standard module pool for tcode PRRW.

0 Kudos
1,379

Hi Anindya

What data you want to extarct out of it..? Using call transaction it wont work.. It will be better if you can check in standard how it is determining and code it

Nabheet

Former Member
0 Kudos
1,379

Hi Anindya,

                         As per information provided by you regarding your problem is less, but as pe your information ..i think you want to call module pool form your report.

you have to use the following statements

in report:-

set parameter id <id name> field <Value>.

CALL Transaction <TCode> and skip initial screen.

in modulel pool pbo part:

get parameter id <id name> field <Value>.

hope it helps.

regards,

vikas

Former Member
0 Kudos
1,379

Hi,

All module pool program can be initiated by a transaction code that has to be created in se 93 and then can use call transaction or if you just need to show the output in  a screen , you can give call screen 9000 in your report program then double click on the screen and then design your screen accordingly.

Warm Regards

Suneesh

Former Member
0 Kudos
1,379

Hi Anindhya,

Like Arun told we have to use call transaction, but to get the data you should export it to a memory id. But if you trying to call some standard module pool transactions, only some of them exports the results to memory id. So you better look for a BAPI for your purpose

Regards,

Ashish Kumar

Former Member
0 Kudos
1,379

You can record bdc for that module and put in background mode,

as per output is concern you can use memory concept to

get output data.

import export memory

set get parameter id.

etc...as per your requirement.

Former Member
0 Kudos
1,379

Hi, look at abap program for tcode PRRW

and form in it

FORM fill_runtab.

and select from db is

SELECT pevst~type
         pevst~runid
         pevst~name
         pevst~simu
         pevsh~status
         pevsh~creator
         pevsh~creadate
         pevsh~creatime
  INTO   CORRESPONDING FIELDS OF TABLE result_table
  FROM   pevst JOIN pevsh
  ON     pevsh~type   = pevst~type
  AND    pevsh~runid  = pevst~runid
  WHERE  pevst~type   = 'TR'
  AND    pevsh~actual = 'X'
  AND    pevsh~status IN
         ('00','10','11','21','22','31','32','35','41','50','90','91')
* end WBGK034117;
* end WBGK024621;
* Begin YEKL9CK037501
  AND   pevsh~creator  IN crea_so
  AND   pevsh~creadate IN crdat_so
  AND   pevst~runid    IN runid_so.

I recomend to use this select directly in your program