Calling a report from a executable program

Hi All,
i want to call a report which is generated by tcode CO88 from a executable program. I want to pass the values of order from the exe program only. But my requirement is such that i want co88 to process only open orders, so please suggest how can i do that.
thanks in advance.
Pankaj Sharma

hi,
chk this sample.
*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.
rgds
anver
if hlped pls mark points

Similar Messages

  • Calling a report from module pool program

    Hi all,
            I had a requirement where I need to call a report from the module pool program where in when we click REPORT button, it should display the report output in the another screen.
    Can we do by calling screen after pushing REPORT button. If so, where we should write that code ( In pbo or pai). Please give me an idea.
    Thanking you,
    Regards,
    Murali Krishna T

    Use submit syntax.
    Press F1 on submit, Donot use return statement with it.
    If so, where we should write that code ( In pbo or pai).
    Please understand about these two events before doing the requirement.

  • Calling custom report from seeded spawned program

    Hi,
    I dont know how to call a custom report(ie.,My own report) when Dunning letter generate is kicked off rather than calling the original programs(ie., Dunning letter print from dunning letter generate etc).
    thanks in advance.

    Hello vishwam,
    as I remember, there is an option to keep the dunning conc request assigned but change to executable to your own.
    Keep in mind that this way is not fully supported, but it should work.
    Regards
    Volker

  • CALL a report from WDA using SUBMIT to sap-spool

    Hi,
    I need to call a report from one of the methods of a WDA application.
    The out of this report is a sapscript. I want show it in WDA (PDF).
    The report is called when a user clicks EXECUTE button.
    The piece of the code is:
      call function 'GET_PRINT_PARAMETERS'
        exporting
          immediately            = 'X'
          new_list_id            = 'X'
          no_dialog              = 'X'
          receiver               = sy-uname
          release                = 'X'
          sap_cover_page         = 'X'
        importing
          out_archive_parameters = t_arcpar
          out_parameters         = t_pripar
          valid                  = i_valid
        exceptions
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          others                 = 4.
          submit hbrcced0
                          with pnppernr-low eq i_pernr
                          with pnpbukrs-low eq t_p0001-bukrs
                          with pnpbegda     eq i_begda
                          with pnpendda     eq i_endda
                          with p_expot      eq ''
                          with ano          eq v_gjahr
                          with respcc       eq v_sachn
                         to sap-spool
                         spool   parameters t_pripar
                         archive parameters t_arcpar
                         without spool dynpro
                         and return.
        if sy-calld eq ''.
          message 'err' type 'E'.
        else.
    If i execute this code in WDA, the sy-calld never is equal 'X'.
    But if i execute it in program (SE38) the sy-calld is 'X'.
    How i can call the program 'hbrcced0' in WDA ?
    Cheers,
    Silvio Galery

    Hi Silvio,
    a submit REPORT to spool does work from WDA.
    ONLY when "and return" is used.
    You have that, so it should work.
    Note you had print immediate on, so it will be output on printer,
    and not available to read after the call.
    (which option was the keep after print?, I would have to check docu)
    The sy-calld will be set to X  inside the REPORT when it is running.
    After the submit has run back inside WDA it is of course reset to space again.
    Cheers
    Phil.

  • 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

  • How to call a report from a menu ?

    I am converting 6i client/server forms to 9i.
    I have a menu that has an option on it to run a report for each menu item selected using RUN_PRODUCT.
    9i is making this obsolete, so how can I call a report from a menu (not a form) now then ?
    In a form it is fine cos I just use the Report Object - a menu does not have this facility.
    Thanks in advance.

    Hi,
    so here is how this should be done:
    1. Create a Reports node in the Forms module that uses the menu (you don't have to create one Reports Object for each report that you want to run)
    2. From the menu, before calling Run_Report_Object() use Set_Report_Object_Property() to set the phsical file name of the Reports that should be executed. This is kind of best practice and does not have a performance hit.
    There is a bug filed against Forms to extend the menu files with a reports Object node. This could require a change to teh file structure which is why we looking for Forms 10i to implement this. (If it turns out that we can have it without recompiling the menu modules then it may go into a patch set - however this seems unlikely from my point of view)
    Fran

  • Calling a Report from Bapi

    Dear  all,
    I am trying to create a customer from external system through bapi. For this is i have to follow these steps.
    1)  I am trying to call a report from external system through bapi.
    2)  I want to pass data from bapi to a bdc program and run it to create a customer.
    3) After creating a customer I need to send the  ceated customer no again to the bapi from where i passed the data to bdc.
    is it possible .
    Give me a good idea on this how to work with it.
    Regards,
    Madhu.

    Hi Madhu,
    SAP has already given standard BAPI to create customer creation "BAPI_CUSTOMER_CREATEFROMDATA". So there is no need for you to create any thing new. Jut test this BAPI first whether this suit your requirement or not. If it satisfy your requirement then call it directly from external system. On how to call this BAPI or other BAPis searc google or SDn you will definetaly find something.
    second approach is if nothing works for you( No BAPI satisfy your requirement) then only go for BDC aapproach. To do that, create a RFC function module( BAPi and RFC FM are diff thing, they looks same  but they are not ). Inside your RFC FM directly write the BDC code to create customer.
    Regards
    Anurag

  • Calling a report from function module

    Hi Friends,
    I have requirement for Function Module i.e. we will add the button to the standard T-code and ( Function added in config ) then
    Function to be called from Customizing
    Program A called from customizing function
    CalculationPDFFunction  is called from program A.
    So can any one help me the logic for "calling a report from function module  ".
    Thanks in Advance.
    Regards,
    OSReddy.
    Edited by: OSReddy on Sep 23, 2011 7:31 AM

    Hi Jaya,
    Yes. It is possible to call ur custom program using SUBMIT statement.
    1. If u have data to pass then build table type RSPARAMS and use below statement.
    data:
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
    SUBMIT report1 WITH SELECTION-TABLE rspar_tab
                   AND RETURN.
    1. If u want to create variant to the program and use that. use the below statement .
    SUBMIT report1 USING SELECTION-SET 'VAR1' "variant
                   AND RETURN.
    Regards,
    Venkat.O

  • Calling a report from Module Pool

    While calling a report from the module pool I'm not able to display th alv. The skeleton of the ALV is coming. But the data and headings are also not displayed.
    But where as calling the same program from a report it is coming properly. can somebody please guide me where did I go wrong?

    MODULE user_command_1001 INPUT.
      w_ok_code = ok_code.
      CLEAR ok_code.
      CASE w_ok_code.
        WHEN 'BACK'.
          LEAVE PROGRAM .
        WHEN 'CREATE'.
          CALL TRANSACTION 'Z_FIRST_TIME'.
        WHEN 'SYNC'.
          CALL TRANSACTION 'Z_SYNC'.
        WHEN 'APPROVE'.
         SUBMIT zds_xx_approval_status WITH po_aname EQ sy-uname AND RETURN.
        WHEN 'OVERVIEW'.
          PERFORM show_all_reqids.
      ENDCASE.
    ENDMODULE.

  • How can I call a Report From database function

    Hi all,
    I want to call a Report from a database function. Could you hel
    me???
    Rgds

    Hello there!
    There is a solution for executing an executable like RWRUN60
    from PL/SQL on http://asktom.oracle.com/pls/ask/f?
    p=4950:8:227101::NO::F4950_P8_DISPLAYID,F4950_P8_B:150612348067,Y
    Or you can invoke the CGI from the Reports-Server through
    UTL_HTTP
    Hope this helps
    Dannys

  • How to Check the report is Finished while calling a report from Forms 6i

    Dear All,
    I am Calling a report from oracle forms 6i, after runing report in " Run_Product(REPORTS,:fn_cntl.nb_report_name,ASYNCHRONOUS, RUNTIME, FILESYSTEM,pl_id, NULL);"
    I need to copy the pdf to store it in another place once the report is generated.
    My Problem is : that i want ot Check first the report has generated after " Run_Product(REPORTS,:fn_cntl.nb_report_name,ASYNCHRONOUS, RUNTIME, FILESYSTEM,pl_id, NULL);" is executed ? How to check the report is generated ot not?
    As i tried to use the below procedure after "Run_Product(REPORTS,:fn_cntl.nb_report_name,ASYNCHRONOUS, RUNTIME, FILESYSTEM,pl_id, NULL);"" but his does not work... nothing happens
    {code}
    PROCEDURE FPC_COPY_REPORT (p_report_name varchar2) IS
         repid REPORT_OBJECT;
         v_rep VARCHAR2(100);
         rep_status varchar2(20);
         lv_id varchar2(1000);
    BEGIN
    repid := find_report_object('AMTP_995.RDF');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
         if rep_status = 'FINISHED' then
         message('Report Completed'); message('Report Completed');
         else
              message('Error when running report.');           message('Error when running report.');
         end if;
    END;
    {code}
    Any Help

    actually My code is this:
    declare
         ln_alert          number;
         pl_id               ParamList;
         lv_report_name varchar2(10000);
         lv_path  varchar2 (100) := 'C:\';
         lv_shared_path  varchar2(1000);
         lv_copy_file varchar2(10000);
      cursor cr_dir_path IS
      select v_dir_path
      from md_directory
      where v_dir_code ='SHR';
      lv_file_name varchar2(1000);
    BEGIN
      open cr_dir_path;
      fetch cr_dir_path into lv_shared_path;
      close cr_dir_path;
    lv_report_name :=  lv_path||:fn_cntl.nb_ref_no||'_M08600000_'||to_char(sysdate,'YYYYMMDD-HHmmss')||'.pdf';
      if ffn_check_fields  THEN
         pl_id := Get_Parameter_List('LAI');
             IF NOT Id_Null(pl_id) THEN
                 Destroy_Parameter_List( pl_id );
              END IF;             
              pl_id := Create_Parameter_List('LAI');
           if :fn_cntl.nb_report_name ='MMAT_REPORT'
                then
                     if :fn_cntl.nb_report_desc ='EXPORT'
                          then
                         Add_Parameter(pl_id, 'PARAMFORM',TEXT_PARAMETER, 'NO');
             Add_Parameter(pl_id, 'DESTYPE',  TEXT_PARAMETER,'File');
            Add_Parameter(pl_id, 'DESNAME',  TEXT_PARAMETER, lv_report_name);
            Add_Parameter(pl_id, 'DESFORMAT',TEXT_PARAMETER,'PDF');
            Add_Parameter(pl_id, 'p_mat_no',TEXT_PARAMETER, :fn_cntl.nb_mat_no);   
            Add_Parameter(pl_id, 'p_ref_no',     TEXT_PARAMETER, :fn_cntl.nb_ref_no);
            Add_Parameter(pl_id, 'p_verified_by',TEXT_PARAMETER, user);
                     Run_Product(REPORTS,:fn_cntl.nb_report_name,ASYNCHRONOUS, RUNTIME, FILESYSTEM,pl_id, NULL);
          DECLARE     
               repid REPORT_OBJECT;     v_rep VARCHAR2(100);     rep_status varchar2(20);BEGIN
                         /* REP_OBJ= REPORT OBJECT CREATED UNDER REPORT NODE AT FORM */
             repid := find_report_object('MMAT_REPORT');      v_rep := RUN_REPORT_OBJECT(repid);
                        rep_status := REPORT_OBJECT_STATUS(v_rep);          
          if rep_status = 'FINISHED' then
              message('Report Completed');          message('Report Completed');
             --copy_report_object_output(v_rep,'c:\local.pdf');
             -- host('netscape c:\tlocal.pdf');     
         else          message('Error when running report.');
                                          message('Error when running report.');     
         end if;
                 END;
         end if;
      end if;
           if :fn_cntl.nb_report_desc ='EXPORT'
                then
                  error_handler('This report will be Storde in ' ||lv_report_name||' and '||lv_shared_path|| ' Location',3);
                     lv_copy_file :='copy '||' "'||lv_report_name||'" "'||lv_shared_path||'"';
                     host(lv_copy_file,no_screen);
                  error_handler('Report Has been Generated Sucessfully.',3);
           end if;
        end if;
    END;I will try first the another solution you have replied perviously... and will let you no the results... thanks a lot...

  • Problem when calling a report from java

    Hi all,
    i have created a report using ireport which contains arabic data.
    when i execute the report from ireport to generate a pdf file it works.
    however when i call this report from java i have an exception"
    Could not create the report Could not load the following font :
    pdfFontName : ARIAL.TTF
    pdfEncoding : Identity-H"
    the pdfFont i used it in ireport, also the pdfEncoding.
    did anyone passed with the same problem
    thanks for help

    Hello Oracle experts,
    The parameters are getting passed successfully in my report.
    But I want to know hous to use it in my query group.
    I just want the syntax.
    Thanks

  • Out put file is not genrated when calling xml reports from OAF page

    Dear all
    i am calling xml reports from OAF page
    the out put file is not generated
    i am writing this code
    public int tradingrequest(String quoid, String costoder,int orgid)
    try
    OADBTransaction tx = (OADBTransaction)getOADBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    String applnName =
    "XXCRM"; //Application that contains the concurrent program
    String cpName = "XXCRM_COSTSHEET"; //Concurrent program short name
    String cpDesc =
    "Trading Costsheet Report XXCRM"; // concurrent Program description
    Number orgid1=new Number(orgid);
    // Pass the Arguments using vector
    Vector cpArgs = new Vector();
    cpArgs.addElement(quoid);
    cpArgs.addElement(costoder);
    cpArgs.addElement(orgid1.toString());
    // Calling the Concurrent Program
    int requestId =
    cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);
    tx.commit();
    System.out.println("Request ID is " + requestId);
    return requestId;
    } catch (RequestSubmissionException e)
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule(this);
    throw oe;
    in controller i am writing this code
    OAMessageStyledTextBean y =
    (OAMessageStyledTextBean)webBean.findChildRecursive("quotationid");
    OAFormValueBean z =
    (OAFormValueBean)webBean.findChildRecursive("costorder");
    String quoid = y.getValue(pageContext).toString();
    String costorder = z.getValue(pageContext).toString();
    System.out.println("The quotation id and costing order are....." + quoid +
    " " + costorder);
    /*if click on run report button to run the report*/
    if ("Viewreport".equals(pageContext.getParameter(EVENT_PARAM)))
    if (tsflag.equals("Y"))
    int requestid = am.servicerequest(quoid, costorder, orgid);
    String url =
    "OA.jsp?akRegionCode=FNDCPREQUESTVIEWPAGE&akRegionApplicationId=0&retainAM=Y&addBreadCrumb=Y&REQUESTID=" +
    requestid;
    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    null, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    when i call the report from oaf page the request id is coming
    when i click on view output i am getting this message
    Error
    The concurrent request 7335031 did not create an output file.
    WHEN I GOTO FIND REQUESTS PAGE QUERY THIS REQUEST ID I AM GETTING THE OUTPUT IN XM FILE
    Regards
    Sreekanth

    java.io.FileNotFoundException: \..\..\..\xdoAqdFFZfuuJ051010_0628487460.fo (The system cannot find the path specified)
    MY CO code
    if("GenerateReport".equals(event))
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {
    // Hashtable hashtable = new Hashtable(1);
    // hashtable.put("TruckBookingRefNum",trucknum);
    // System.out.println("test"+trucknum);
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=LF Cargo Summary Report.htm";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/HTML");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode) am.invokeMethod("getTestDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    System.out.println(" ByteArrayInputStream.ByteArrayOutputStream"+pdfFile+inputStream);
    //Generate the PDF Report.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    "LFCUST",
    "XXLFCARSUM_TARGET",
    "English",//((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    "US",//((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_HTML,
    null,
    pdfFile);
    // hashtable);
    System.out.println(" TemplateHelper");
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    System.out.println(" byte"+b);
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    pdfFile.flush();
    pdfFile.close();
    catch(Exception e)
    System.out.println(" inside catch");
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(true);
    Edited by: user9367919 on May 13, 2010 10:31 AM

  • Calling ABAP report from BEx query

    Good day!
    I want to call ABAP report from BEx query by right-clicking on the field and using context menu. I know that transaction RSBBS is used (sender-receiver connecting), but I don't know how to transfare data to ABAP program
    In ABAP program I want to know at least data from those cell in BEx query, that was right-clicked.

    Depending on your requirement and environment, you have the following options:
    1. Use an info spoke and make selections as you would in a query.
    2. USe FM RS_VC_GET_QUERY_VIEW_DATA_FLAT to send the data to a file and your ABAP can read this file.
    Ravi Thothadri

  • Problem calling a report from Forms

    Hi,
    I am currently trying to upgrade our Forms and Reports from 6.0 to 10g. I created a simple form and a simple report and I called the report from the form (passing no parameters) and report was generated fine. Now I'm looking at one of our existing forms and I've complied them in 10g. This time I'm passing a parameter and the report is failing. If I run the report on its own with the same parameter it works fine. I am using the Run_report_object builtin.
    The error I get is the 41214:Unable to run report. The weird thing about this is if I pass in a bogus parameter (not valid in the database), the report will execute fine and I will get a page saying that No Data was Found (text displays when nothing was returned from the query). However, whenever I pass in a good parameter (Data should be returned), the report do not execute and I get the error. So, I updated the database to have the bogus parameter and then when I passed in the bogus parameter again, this time it failed. So it looks like that when data is coming back from the query in the report, I get the error. I'm connected to the same database that was used in the simple example stated above that returned data.
    Does anyone have any idea what could be causing this? Let me know if more information is needed.
    Thanks,
    Karen

    You can check the reports queue for error messages to see what the error actually is.
    http://server:port/reports/rwservlet/showjobs?server=repsever

Maybe you are looking for