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

Problem regarding calling a program from another program

Former Member
0 Likes
548

Hi,

I have a requirement that i need to call a program from another program and in that case the called program should be executed with a value in the selection screen coming from the first program..i.e.

a standard report to view the user Notes for annual leave is RPTARQDBVIEW. Can we create a report to display all the users under a manager as a hyperlink and run the report(RPTARQDBVIEW), with the pernr of the employee selected

Regards,

saumik

3 REPLIES 3
Read only

Former Member
0 Likes
480

1. Calling a SAP standard report

In this example is used transaction FB03 for the standard report that should becalled.

Go into the standard report

Place the cursor in the selection fields one by one and press F1

Select Technical info for the field

The parameter-ID is the name of the parameter you can use

FB03 has the parameters BLN, BUK and GJR. Call the transaction from your report using the following syntax ( We don't use the åparameter GJR 😞

set parameter id 'BLN' field prttab-belnr.

set parameter id 'BUK' field prttab-bukrs.

call transaction 'FB03' and skip first screen.

prttab is a filed from an internal table in your own report.

2. Calling one of your own reports

You call one of your own reports the same way as you call a SAP standard report, but you will have to define parameter IDs for the fields on the selection screen.

To do this you must edit the selection screen in the Object Browser. Select the screen and add a parameterId in the attributes screen for each field.

Importent: If you later change your report and save it, the paramter ID's will be lost, and you will have to define them again.

Regards,

Prabhudas

Read only

Former Member
0 Likes
480

Hi

U can the call other program in u t program using Submit command.

Submit <Calling Program name> vai selection-screen with < selection values to be pass>.

Read only

Former Member
0 Likes
480

Submitting a report using ranges for select-options

* Define range for ltak-tanum
RANGES: r_tanum FOR ltak-tanum.                                                                                
* Read values from database tabel into the range
* These values are later used for select-options in the report

SELECT * FROM ltak                                                    
  WHERE lgnum =  w_lgnum AND           "Warehouse number/complex     
        vbeln = w_screen1000-io_vbeln.  	"Transfer order number

  MOVE ltak-tanum TO r_tanum-low.                                     
  MOVE 'I' TO r_tanum-sign.                                           

  MOVE 'EQ' TO r_tanum-option.                                        
  APPEND r_tanum.                                                     
ENDSELECT.                                                                                
* Submit report with range                   
SUBMIT zmm00100 WITH p_tanum IN r_tanum.    

or


Submitting a report from ABAP with selection criterias


  TYPES: tt_selection TYPE STANDARD TABLE OF rsparams.

  DATA: l_iblnr        TYPE st_iblnr,
*     Define internal table and work area for select-options
        l_selection    TYPE rsparams,
        li_selection   TYPE tt_selection.

* Create selectIon table
  LOOP AT gi_iblnr INTO l_iblnr.
    CLEAR l_selection.
    l_selection-selname  = 'IM_IBLNR'.    "Option name
    l_selection-kind     = 'S'.           "S= select options P=Parameters
    l_selection-sign     = 'I'.           "Sign
    l_selection-option   = 'EQ'.          "Option 
    l_selection-low      = l_iblnr-iblnr. "Value

    APPEND l_selection TO li_selection.
  ENDLOOP.

* Submit report
  SUBMIT rm07idif WITH SELECTION-TABLE li_selection AND RETURN.

Regards,

Prabhudas