Problem regarding calling a program from another program

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

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

Similar Messages

  • CALL TRANSACTION 'ME33K  from another program

    Hi,
    I ma trying to CALL TRANSACTION 'ME33K  from another program, but it is not working.  The transactions is opening, but it is not opening with the contract number (ls_ekpo-ebeln) i am passing.
    ls_ekpo-ebeln does have a valued when CALL TRANSACTION 'ME33K  is called.
    In debug, I noticed the "value" is blank when step into CALL TRANSACTION 'ME33K .
       WHEN 'EBELN'.  "Contract
          l_field = 'EVRTN'.
         IF ls_ekpo-ebeln <> ''.
            GET PARAMETER ID 'VRT' FIELD l_field.  "EVRTN.
           SET PARAMETER ID 'VRT' FIELD ls_ekpo-ebeln.
           CALL TRANSACTION 'ME33K AND SKIP FIRST SCREEN.
            SET PARAMETER ID 'VRT' FIELD ls_ekpo-ebeln.
          ENDIF.
    Any help or suggestions would be great.
    Thanks,
    Naing

    Dear Naing,
    I execute the same code
    IF ls_ekpo IS INITIAL.
    GET PARAMETER ID 'VRT' FIELD LS_EKPO.
    SET PARAMETER ID 'VRT' FIELD ls_ekpo.
    CALL TRANSACTION 'ME33K' AND SKIP FIRST SCREEN.
    SET PARAMETER ID 'VRT' FIELD ls_ekpo.
    ENDIF.
    And it is working.
    Try to do de simple sintax.
    A program with one pararmeter to introduce the contract number.
    The set parameter for this parameter and the call transaction.
    I´m waiting your comments.
    Regards.
    Antonio.

  • How to call one program from another program

    Hai,
      How to call one program through another program.
    Example.
       I have two programs 1.ZPROG1 2. ZPROG2.
    When i execute ZPROG1 at that time it should call ZPROG2.

    Hi ,
    u can use submit statement to call a program .
    DATA: text       TYPE c LENGTH 10,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    regards,
    Santosh thorat

  • Regarding calling 1 report from another

    Hello Friends,
       Can u plz tell me how to call one report from another report.
    Regards,
    Drashana

    hi,
    Use SUBMIT program statement
    SUBMIT ZFIR001
    chk this.
    *Code used to populate 'select-options' & execute report 
    DATA: seltab type table of rsparams,
          seltab_wa like line of seltab.
      seltab_wa-selname = 'PNPPERNR'.
      seltab_wa-sign    = 'I'.
      seltab_wa-option  = 'EQ'.
    load each personnel number accessed from the structure into
    parameters to be used in the report
      loop at pnppernr.
        seltab_wa-low = pnppernr-low.
        append seltab_wa to seltab.
      endloop.
      SUBMIT zreport with selection-table seltab
                                    via selection-screen.
    *Code used to populate 'parameters' & execute report 
    SUBMIT zreport with p_param1 = 'value'
                    with p_param2 = 'value'.
    Other additions for SUBMIT
    *Submit report and return to current program afterwards
    SUBMIT zreport AND RETURN.
    *Submit report via its own selection screen
    SUBMIT zreport VIA SELECTION-SCREEN.
    *Submit report using selection screen variant
    SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
    *Submit report but export resultant list to memory, rather than
    *it being displayed on screen
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    Once report has finished and control has returned to calling
    program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
    DISPLAY_LIST to retrieve and display report.
    \[removed by moderator\]
    rEGARDS
    Edited by: Jan Stallkamp on Jul 29, 2008 5:25 PM

  • Set the parameter in the selection screen of a program from another program

    Hi ALL,
    I need to call the program RHALESMD from another program and the program RHALESMD takes from date as one of the input parameter.how do i set the from date from the calling program and call RHALESMD
    Thanks
    Bala Duvvuri

    i got the answer
    Program accessed
    REPORT report1.
    DATA text TYPE c LENGTH 10.
    SELECTION-SCREEN BEGIN OF SCREEN 1100.
      SELECT-OPTIONS: selcrit1 FOR text,
                      selcrit2 FOR text.
    SELECTION-SCREEN END OF SCREEN 1100.
    Calling program
    REPORT report2.
    DATA: text       TYPE c LENGTH 10,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    Thanks
    Bala Duvvuri

  • Call Program from another Program using varient

    Hi...
    How to call program from program with varient....?
    i have used submit but how to pass varient dynamically.
    Regards,
    Chintan

    Hi,
    Use the FM SUBMIT_REPORT
    OR
    SUBMIT <Program Name> VIA SELECTION-SCREEN
                                      USING SELECTION-SET <VARIANT>
                                      AND RETURN.

  • Call transaction MMBE from another program and press Back button

    Hello,
    I have program that is used as a 'launch pad' for some of our heavily used transactions. When I call the main 'launch pad' program, the user will select a button and a Call Transaction MMBE is initiated (USING the first screen). The user selects a material for display and presses the execute button (F8). The material overview is displayed correctly.  When the user presses the Back button (F12), transaction returns all the way back to the first called program and not to the first screen for transaction MMBE as expected.
    Does anyone know how I can change the screen flow and go back to the fist screen of MMBE and not the screen of the first called program?
    Regards,
    RC

    Rod,
    In your case i think it is not possible as it is standard functionality by SAP.
    Try work around, may be modification to the program will work.
    Regards,
    Amey

  • Calling a report from another program

    Hi friends,
    I want to run an existing  report from one function module and I need the output in an internal table for further processing.But I don't want to change the called program for any export to memory.How can we do it ?
    Thanks in advance,
    Joby

    Hi,
    U can do by using
    SUBMIT PROGRAM VIA SELECTION-SCREEN .
    Bye

  • Call Program from another Program using varient via Selection Screen

    I am calling a standard report from my Z Program via Selection screen.
    Is there any way to hide the Execute button that is seen when we see the called program selection screen?

    Hi Shyam,
                      Thanks for the quick reply.
    But my requirement is to show the selection screen of called program as i need to make some values changes in the selection Screen.
    However, the user can accidently click the execute button which i dont want thats why i need to hide the execute button.
    My aim is to change values of selection screen but nto execute it.
    Is it possible?

  • Calling one program from another program

    Hi,
    I need to call RVKUSTA1 program into Function module & that FM to used in BDT. So I think I shouldn't use Select-options. So any of u could u please send me the sample code.
    Thanks ,
    Rani

    You can use
    SUBMIT <Program> ... WITH SELECTION-TABLE seltab
    <b>Effect</b>
    seltab is an internal table with the structure RSPARAMS.
    This variant allows you to set the names and contents of the parameters and selection options dynamically at runtime.
    You can use the function module <b>RS_REFRESH_FROM_SELECTOPTIONS</b> to read the contents of the parameters and selection options of the current program into an internal table seltab with the structure <b>RSPARAMS</b>. By using <b>SUBMIT ... WITH SELECTION-TABLE seltab</b>, you can then pass these values on directly.
    Regds
    Manohar

  • Regardding Extended syntax check of one program from another program

    Hi,
    I have one issue related to Extended syntax check.
    I am working on one report [<b>REPORT2</b>] from that i am doing extended syntax check of another Report [<b>REPORT1</b>] which is already developed.
    For that i have use <b>F.M</b> <b>EXTENDED_PROGRAM_CHECK</b> it returns no of errors of <b>REPORT1</b> now my issue over here is i want to output all the errors of <b>REPORT1</b> into REPORT2 output with <b>Line No & Error Message</b>.
    How can i solve this issue!
    Thanks in advance.
    Thanks,
    Deep.

    Hi ,
      You can use the FM <b>EXTENDED_PROGRAM_CHECK_SHOW</b> , to get the details of the check.
    Regards
    Arun

  • Error when calling  a form from another program

    Hi all,
    I'm using the following code in EXIT_SAPLV50Q_001:
    PERFORM STATIC_CREDIT_CHECK(SAPLVKMP)  
    USING '' LIKP-KKBER LIKP-KNKLI '' 'X'
    CHANGING RC_CHECK_A RC_CHECK_F RC_WARNING RC_ERROR RC_STATUS_SET CMPSA
    I'm getting the following error:
    GETWA_NOT_ASSIGNED - Field symbol has not yet been assigned in line LOCAL: XVBKD-PRSDT which is in FORM MESSAGE_EXCEEDED_VALUE.
    I have assigned a value for field XVBKD-PRSDT so it won't be initial, but this was not helpful.
    Any ideas would be appreciated.
    Hagit

    Hi guest,
    the data definition is:
    DATA: XVBKD LIKE VBKDVB OCCURS 0 WITH HEADER LINE.
    the assignment:
    XVBKD-PRSDT = likp-erdat.
    Thanks,
    Hagit

  • Running a Swing program from another program

    I'm having what is most likely newbie problems since I'm relatively new to Swing programming. Basically my situation is this: I've got a program that looks at its command line parameters and either runs through a series of actions or presents a Swing GUI to allow the user to step through the actions one by one.
    My problem is that I bascially don't know how to call (instantiate, declare, etc.) the GUI from my Java code. I tried implementing the GUI class with a runnable interface, but evertime I try to invoke the start on the interface I'm getting an error. I have a feeling I'm just missing something. The Swing GUI works fine if I call it on its own so it's the code the invokes it from the small command line processor that I'm goofing up somehow.
    So to recap, I have a small Java app that I'm trying to call a GUI that I've built and can't seem to get the code right.
    Any pointers to examples or explanation on how to accomplish the above are welcome.
    Thanks,
    Ed

    That the "2" is printed out immediately is as expected, but I don't understand why the JVM exits. The following is, AFAIK, a trimmed down version of what you are doing, and if you run it you'll see that the frame remains until you close it manually:
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class ShowFrame {
        public static void main(String[] args) {
            AppFrame gui = new AppFrame();
            gui.run();
        private static class AppFrame extends JFrame implements Runnable {
            public AppFrame() {
                setDefaultCloseOperation(EXIT_ON_CLOSE);
                JButton btn = new JButton("Close");
                btn.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        AppFrame.this.dispose();
                getContentPane().add(btn);
                pack();
                setLocationRelativeTo(null);
            public void run() {
                System.out.println("1");
                this.setVisible(true);
                System.out.println("2");
    }Maybe someone else can shed some light over your problem...

  • Can we call a bdc program from report program

    hi
    can we call a bdc program from report program

    Yes you can any program from another program using
    SUBMIT <repname>   statement
    SUBMIT <repname> USING SELECTION-SCREEN dynnr.
    or
    SUBMIT <repname> VIA SELECTION-SCREEN USING SELECTION-SET variant
    SUBMIT <repname> VIA SELECTION-SCREEN WITH SELECTION-TABLE rspar
    etc.
    Regards
    Prax

  • CallerPrincipal when calling one sessionbean from another

    Hi all,
    I have a little problem when calling one sessionbean from another sessionbean. The problem is, that in the method, which is called, is used SessionContext's getCallerPrincipal().getName(). This works great from client, but from other sessionbeans getCallerPrincipal() retuns an "ANONYMOUS" principal. How can I set the correct principal (the principal from the first sessionbean)?
    Thank you
    My env: Glassfish 2.1.1, Netbeans 6.8, Eclipselink 2.0.0, Java 1.6.0.18
    My code:
    @Stateless
    public class ABean implements ASessionRemote{
    @Resource
    SessionContext ctx;
    @Override
    public void aMethod(){
    String name = ctx.getCallerPrincipal().getName(); // the name is ANONYMOUS, when the call is done from other sessionbean
    @Stateless
    public class BBean implements BSessionRemote{
    @Resource
    SessionContext ctx;
    @EJB
    private ASessionRemote aSessionBean;
    @Override
    public void bMethod(){
    aSessionBean.aMethod();
    }

    "This works great from client"
    What do you mean by this, i.e what sort of client are you using (stand alone app, servlet) ?
    what shows up if you printout the caller principal in the calling bean ?
    are the two ejbs in the same ear ?
    what security meta-information are you using in ejb-jar.xml and sun-ejb-jar.xml, if any ?

Maybe you are looking for