Procedure in reports

Hi everybody,
I'm beginner in oracle reports and I'd like to know if is possible and how do I create and use stored procedures to generate my reports. A simple query isn't enough for the type of report I need to implement...
Thanks
Diogo Domanski

Hi Diogo,
As long as your database user has execute privs on the stored program unit, they can use it in Reports. You can also use stored functions in your query. To create them, you can either do it manually in sqlplus or you can use the Stored Program Unit Editor in Procedure Builder.
Hope that points you in the right direction!
Cheers, Toby

Similar Messages

  • Create a Procedural ALV Report with editable fields and save the changes

    Hi,
    I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDIT_02
    BCALV_TEST_GRID_EDIT_04_FORMS
    BCALV_TEST_GRID_EDITABLE
    BCALV_EDIT_01
    BCALV_EDIT_02
    BCALV_EDIT_03
    BCALV_EDIT_04
    BCALV_EDIT_05
    BCALV_EDIT_06
    BCALV_EDIT_07
    BCALV_EDIT_08
    BCALV_FULLSCREEN_GRID_EDIT
    But all these are using OO Concepts.
    Please help.
    Regards,
    Smruthi

    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      line_color(4) TYPE c,     "Used to store row color attributes
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
    fieldcatalog-edit             = 'X'
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
      gd_layout-info_fieldname =      'LINE_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_pf_status_set = 'STATUS'
                i_callback_top_of_page   = 'TOP-OF-PAGE'
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
               IT_EVENTS                = GT_XEVENTS
                i_save                  = 'X'
               is_variant              = z_template
           TABLES
                t_outtab                = it_ekko
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      DATA: ld_color(1) TYPE c.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
      LOOP AT it_ekko INTO wa_ekko.
        ld_color = ld_color + 1.
        IF ld_color = 8.
          ld_color = 1.
        ENDIF.
        CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
        MODIFY it_ekko FROM wa_ekko.
      ENDLOOP.
    ENDFORM.                    " DATA_RETRIEVAL
          FORM top-of-page                                              *
    FORM top-of-page.
      WRITE:/ 'This is First Line of the Page'.
    ENDFORM.
          FORM status                                                   *
    FORM status USING rt_extab TYPE slis_t_extab.  .
      SET PF-STATUS 'ALV'.
    ENDFORM.
          FORM USER_COMMAND                                          *
    -->  RF_UCOMM                                                      *
    -->  RS                                                            *
    FORM user_command USING rf_ucomm LIKE sy-ucomm
                             rs TYPE slis_selfield.            
      DATA ref1 TYPE REF TO cl_gui_alv_grid.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = ref1.
      CALL METHOD ref1->check_changed_data.
      CASE rf_ucomm.
    when 'SAVE'.
    get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
    endcase.
    endform.
    ENDFORM.
    here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
    create a custom PF status and create push buttons and assign your ok codes in your PF status.
    if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
    Hope this will help you.
    Regards,
    phani.

  • How to change header value dynamiclly in procedural alv report?

    Hi experts,
    I develop one report (using procedural alv ).I gave 3 input check boxes (ex : in 1st checkbox 10days in 2nd check box 20 days
    in 3rd check box 30 days they entered like this in the input checkboxes in days 10,20,30.In o/p report 3 columns i maintained like this .   Column1                          column2                                                 column  3
           from 0 to 10 days          from 11 to 20 days                                    from 21 to 30 days.
    I want to display alv report o/p like this in the respective columns.
    For example they enter 15 25  35 (i/p)
    o//p in alv report 
       Column1                          column2                                                 column  3
           from 0 to 15 days          from 16 to 25 days                                    from 26 to 35 days.
    i want to change days  dynamically  in alv header  .Pls give me the code using procedural alv report.
    If u want i will give u detail.pls help me in this.

    I assume the main issue is chaniging ALV header dynamically, isn't it? For this you need to use field seltext_m of fieldcatalog for particular column. So you can contruct header dynamically by string concatenation like
    parameters: pa_1st(2) type n,  "i.e. 15
                        pa_2nd(2) type n,  "i.e 25
                        pa_3rd(2) type n.  "i.e. 35
    "first field
    concatenate '0' 'to' pa_1st into it_fieldcatalog-seltext_m.
    "next field
    add 1 to pa_1st.
    concatenate pa_1st 'to' pa_2nd into it_fieldcatalog-seltext_m.
    "last field
    add 1 to pa_2nd.
    concatenate pa_2nd 'to' pa_3rd into it_fieldcatalog-seltext_m.
    Refer [Sample ALV: Heading in ALV|http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm] for more information.
    Regards
    Marcin

  • Calling a stored procedure from Reports

    I am trying to call a stored procedure using oracle reports in the afterparameter code. My code is:
    v_ain := sp_get_ain(:P_session_id);
    Can someone help me out by telling what is wrong. I keep getting an error stating that sp_get_ain needs to be declared.?!

    I am creating a function and a stored procedure and calling them
    in afterparameter report trigger.
    -------------------Create function ----------------
    create or replace function get_name( emp_id number) return varchar2 is
    v_name varchar2(20);
    begin
    select name into v_name
    from sample_table
    where employ_id = emp_id ;
    return(v_name); ---------This is the way to return value from function.
    exception
    when no_data_found then
    return('Name not found.');
    when others then
    return('Other error found.');
    end ;
    ==================================================================================
    ------------------------Create procedure ------------------------------------
    create or replace procedure get_name( emp_id number, return_name out varchar2) is
    v_name varchar2(20);
    begin
    select name into v_name
    from sample_table
    where employ_id = emp_id ;
    return_name := v_name ; --Assign out parameter value from procedure.
    exception
    when no_data_found then
    return_name := 'Name not found.';
    when others then
    return_name := 'Other error found.';
    end ;
    ============================================================================
    -----------------Call function and procedure from report ---------------------
    In formula column or any report trigger you can use this code.
    v_function_return_name varchar2(20);
    v_procedure_return_name varchar2(20);
    v_employ_id number(10);
    begin
    v_employ_id := 101 ;
    v_function_return_name := get_name(v_employ_id ); --- call function
    get_name(v_employ_id , v_procedure_return_name ); -- call procedure
    end;
    Here v_function_return_name has same value as v_procedure_return_name,
    these are the values returned from function and procedure.
    --Anita

  • My iPhone 4 cellphone was stolen last year. I have done all the procedures of reporting it to the South African Police Services and my Vodacom service provider. I do have the case number and I did blacklist my stolen phone. I have not had any assistance.

    My iPhone 4 cellphone was stolen last year. I have done all the procedures of reporting it to the South African Police Services and my Vodacom service provider. I do have the case number and I did blacklist my stolen phone. I have not had any assistance. I had installed Find My iPhone but did not have any iCloud account on it (ie. iCloud Username and Password). So I am unable to track it or find its location as yet. Please help me find my iPhone 4.

    Your only chance is setting it up as new device without using the latest backup afterwards, which you already did.
    If this does not work, you should get it serviced:
    Apple - Support - Service Answer Center
    How to back up your data and set up as a new device

  • Use of procedure in Report Builder

    Hello all,
    i am using Oracle 10gR2 Report Builder it is working properly with sql queries but i want to try it with procedures
    so is it possible to use procedures in Report Builder as the same way we import query. i used a procedure but got an error :- ORA-24333 zero iteration count
    Thanks & Regards
    Pratik Lakhpatwala
    Jr Oracle DBA
    Edited by: Pratik.L on Oct 9, 2009 2:11 AM
    Edited by: Pratik.L on Oct 9, 2009 2:12 AM

    Does this procedure return the resultset as a REF CURSOR?
    Having not worked on Report builder, I am not sure if this error is related to calling of procedure itself.

  • How to display multi line headings in procedural alv report

    Hi experts,
    How to display multi line heading in alv( procedural alv report) report.
    some columns single line and some columns multi line in the same report.
    ex: 
                  solvent consumed          solvent recovered
                   fresh |   recovery             recovery | spent                            batch no                         storage
    I am using procedural alv .pls give me idea.

    Hi Ram,
    Check the sample report [how to display multi line headings in procedural alv report|http://sample-code-abap.blogspot.com/2008/01/printing-multiple-line-header-and.html]
    Thanks,
    Duy

  • Procedure based reports in BO

    Hi,
    Is procedure based reports are possible in WebI in any of the versions?
    -Thanks

    Hi,
    Yes , Procedure based reports are possible .
    You need to create Universe on the top of Stored Procedure .
    And Then Web I using that universe .

  • Calling Procedures form Report 6i

    I would highly appreciate it if I can get advise on how to call procedures from report 6i.
    My procedure requires two input parameters and returns about six columns in all. The problem I have is in trying to figure out how to display the values returned on the report.
    I checked the on-line help to no avail. Thanks.

    You can put placeholder columns in your data model group and populate them by using them as the OUT parameters in your stored procedure, called from a formula column. The placeholder columns can then have fields referencing them in the report layout.
    HTH
    Paul Williams

  • Calling Stored Procedure in Reports

    Hi,
    What is the exact syntax to call a stored procedure?
    I have a stored procedure called 'proc_ccipt'
    I created a public synonym for it and I am trying to call it from 'Before Report' event of a report:
    Execute proc_ccipt;
    and I get the compilation error "Encountered the symbol 'proc_ccipt' ....".
    This procedure inserts rows into a temp table.
    Thanks
    Catherine
    null

    hello catherine
    in pl/sql block you don't have to use execute before procedure name. so in your case it is simply proc_ccipt;
    hope this helps

  • Oracle Stored Procedure in Reports

    Hi ,
    How can i call oracle stored procedure in Oracle Reports. The procedure takes an object type variable and as out parameter.
    Thanks,
    Ashish Goel

    Hi,
    Thanks for the help but i have a stored procedure which ia already built in my oracle database.
    The signature of the proceure are as follows:
    PRC_AGGR_DETAILS (P_BP_Id IN NUMBER,
    P_Level IN VARCHAR2,
    P_AggSummary OUT ObjAggSummary,
    P_err_msg OUT VARCHAR2,
    P_err_code OUT NUMBER);
    where
    P_AggSummary is an object (user defined)
    CREATE OR REPLACE Type ObjAggSummary as OBJECT (BP_ID NUMBER(12),
    Detail_Level VARCHAR2 (7),
    Delta_Limit_Cash NUMBER(20,3),
    Delta_Limit_Cont NUMBER(20,3),
    Delta_Limit_Margin NUMBER(20,3),
    Pndg_Limit_Cash NUMBER(20,3),
    Pndg_Limit_Cont NUMBER(20,3),
    Pndg_Limit_Margin NUMBER(20,3),
    Net_Limit_Cash NUMBER(20,3),
    Net_Limit_Cont NUMBER(20,3),
    Net_Limit_Margin NUMBER(20,3),
    CDS NUMBER(20,3),
    CONSTRUCTOR FUNCTION ObjAggSummary RETURN SELF AS RESULT
    Now i need to display all these values in the object ObjAggSummary in my different report as different fields.

  • Stored procedure in reports

    hi all,
    Have any one used stored procedure to populate data for reports
    also publish a sample code which illustrates the above said issue

    thank u chida,
    nice reply it seems that the report triggers are of much useful.
    please reply me about the usage of the report triggers
    i can know about the utility and criticality of the triggers available in reports, also it will be useful for me in interview point-of-view in future.
    expecting a reply

  • Can't run host function in procedure and reports

    Hello
    i'm unable to use the host function in reports and procedure.
    host('ar60runb userid=apps/apps report=/vision/d01/oracle/visappl/fnd/11.5.0/reports/US/UBLPS1.rdf batch=yes mode=bitmap destype=file desname=/vision/d01/oracle/visappl/fnd/11.5.0/reports/US/UBLPS1.pdf desformat=pdf paraform=yes P_EMP_NO='||i.EMPLOYEE_NUMBER||' PAYDT='||i.PAY_RUN_DATE);
    Kindly help ASAP!!!!
    Regards
    Fahad

    "I noticed that when I publish apk from Flash I don't  have option to select path to android SDK below 2 checkboxes ( install app on device and run app on device after publishing)"
    Are you saying the 2 checkbox's are missing? If so ,(or even if not), perhaps you don't have the latest extension installed in flash?
    http://labs.adobe.com/technologies/flashpro_extensionforair/
    I had an issue like you describe before. Everything was updated with my machine and phone, usb debugging , allow installation of non market apps... but i was not able to manually install my own apk's on my device.
    If i were to put the .apk on my server or just drag it to the phone via USB i could not install it. it was "untitled" or "unknown" i forget.
    The only way it would work was on export "install application on the connected android device".
    However If i took anyone else's .apk made from flash, i could install it from my server or via usb drag/drop.
    Even at one point someone on the forum posted an apk and the source .fla
    Installed that apk? = YES
    Export the same .fla myself with no changes = FAIL to install (unless launching directly from flash).
    I was using windows xp, I happen to be upgrading my cpu last month so i installed windows 7 and re-installed flash, and now it works fine. I never figured it out. I was somehow producing non-viable .apks . However it works now and I have done nothing different (besides going from xp to win7 and reinstalling flash).
    "other air apps (from other ppl) work both on phone and device."
    I'm guessing you only installed other air4android apps from the market?
    If you haven't tried yet, i could email you a .fla and .apk, see if you can install that from your ftp. Then re-export if yourself and see if it fails again?
    edit:spelling

  • Execute procedure in report

    hello all,
    i create a procedure in oracle database 9i now i want call this procedure in oracle report 6i in "after parameter form"
    kindly guide me how can i do this......!
    thanks to all

    Create an After-Parameter-Form-trigger and sinmply write the name of the procedure in it (if the procedure has parameters, you have to give values for them). Make sure that you are connected to the database in reports-builder.

  • Multiple stored procedures on report

    I linked two stored procedures on Crystal Report using primary keys but have been having login issues when I migrated from Development to Test environment. I'm NOT using SubReports.
    I want to know if it is even possible to use multiple stored procedures on Crystal Report without using SubReports? I'm using Crystal Reports 10 and SQL Server 2008

    2) CR 10 does not support MS SQL 2008. Check the supported platforms documentation. I Recommend upgrading to CR 2008.
    -- Crystal Reports using single stored procedure and sub reports worked fine with SQL 2008
    That is kind of like saying; my Ferrari was not designed for dirt roads. And it was pretty good on the dirt back lane. But when I went on a mountain logging road,  it broke.
    Anyhow. From your description it also looks like this works for you in the designer ("development" environment), but not once you get it into Enterprise. If that is the case, post your query to the [Business Objects Enterprise Administration|BI Platform; forum, see what they say.
    Ludek

Maybe you are looking for

  • No videeo on A31

    I have an A31 that has no video. The system boots up, but there is no video or any sign of video. I was using the system earlier in the day with no problems. It may have gone into suspend mode, it may have gone into hibernate mode. I don't know for s

  • List box question

    I am seeing a weird behavior with single select list boxes. If you want to select an item in the list box you click on it. My question is how do you deselect the item? If you click on it again the item should be deselected, but in this case it stays

  • Load data from file and send to background

    Hello, is it possible to load data from a file on the presentation server and then create a batch input to call a transaction with those values but on background NOT using data set? Thanks in advance.

  • ITunes.rsrc Colored Icons

    Hello all, I recently upgraded to iTunes 10.1 and was annoyed to see that my "hacked" colored icons (if you don't know what I'm talking about, see http://obamapacman.com/2010/09/how-to-add-color-icons-apple-itunes-10-gray-sideb ar-mod/ ) had disappea

  • Al instalar de nuevo mi programa adobe acrobat x pro, no me funciona ¿Cómo puedo solucionarlo?

    Al instalar de nuevo mi programa adobe acrobat x pro, no me funciona. ¿Cómo puedo solucionarlo?