Need code for call a report from stored produre in oracle9i(using rwclient)

dear all,
i need a stored procedure to run the report 9i(.rdf) from pl/sql.But i have code in older version(rwcgi60).So i want stored procedure for rwclient.
The below code not working in oracle9i version.its very urgent.Thanks in advance..
create table report
(id number not null primary key,
filename varchar2(100) not null,
report_connection_id number not null,
destype varchar2(5) not null)
create table report_connection
(id number not null primary key,
user_id varchar2(100) not null,
pass varchar2(100) not null,
database_server varchar2(50) not null,
report_server varchar2(50) not null)
alter table cm.report add foreign key (report_connection_id) references cm.report_connection (id)
insert into report_connection values (1, 'scott', 'tiger', 'orcl', 'Rep60_Dev');
insert into report values (1, 'test.rdf', 1, 'PDF');
commit;
procedure pr_example (p_id report.id%type) is
cursor cur_data is
select r.filename,
c.user_id,
c.pass,
r.destype,
c.database_server,
c.report_server
from report r,
report_connection c
where r.report_connection_id = c.id
and r.id = p_id;
v_blob blob;
v_url varchar2(2000);
v_pieces utl_http.html_pieces;
v_buffer raw(2000);
v_buffer_size integer := 2000;
begin
for v_rec in cur_data loop
v_url := 'yourserver.domain.com/dev60cgi/rwcgi60.exe?report=' || v_rec.filename || '&desformat=' ||
v_rec.destype || '&userid=' || v_rec.user_id || '/' || v_rec.pass || '@' || v_rec.database_server ||
'&server=' ||v_rec.report_server || '&destype=cache';
if v_rec.destype = 'PDF' then
owa_util.mime_header('application/pdf', false);
htp.p('content-disposition: filename='||v_rec.filename);
owa_util.http_header_close;
--you can add a bunch of elsif logic here for different destypes and setting the correct mime type.
end if;
--sets transfer timeout to be one hour
utl_http.set_transfer_timeout(3600);
--runs the report
v_pieces := utl_http.request_pieces(v_url,64000);
v_blob := empty_blob();
dbms_lob.createtemporary(v_blob,true);
for i in 1 .. v_pieces.count loop
v_buffer := utl_raw.cast_to_raw(v_pieces(i));
v_buffer_size := utl_raw.length(v_buffer);
if v_buffer_size > 0 then
dbms_lob.writeappend(v_blob, v_buffer_size, v_buffer);
end if;
end loop;
wpg_docload.download_file(v_blob);
end loop;
end;
Now run this url:
http://yourserver.domain.com/pls/dad_name/pr_example?p_id=1
regards
mani

JosAH wrote:
A couple of years ago Sun supplied their javax.comm package (mysteriously versioned as version 2)
but they stopped it for the PC Windows.
There's an alternative: rxtx which offers an identical API as Sun did and their own native implementation for serial and parallel port handling; I have used both and the rxtx version is clearly superior to Sun's old version: http://www.rxtx.org
This question popped up recently.
tschodt wrote in [http://forums.sun.com/thread.jspa?messageID=10863769#10863769:}
[Java Communications API|http://java.sun.com/products/javacomm/]
Implementations of the API are currently available for Solaris SPARC, Solaris x86, and Linux x86.follow the Download link to find
Sun no longer offer's the Windows platform binaries of javax.comm, however javax.comm 2.0.3 can be used for the Windows platform, by using it in conjunction with the Win32 implementation layer provided by the RxTx project. To use that, download javax.comm for the 'generic' platform (which provides the front-end javax.comm API only, without platform specific back-end implementations bundled). Then acquire the Windows binary implementation rxtx-2.0.7pre1 from http://www.rxtx.org.

Similar Messages

  • Calling Oracle Reports from stored procedures

    Hi ,
    Can anybody tell me whether this is possible and if so, how it can be done. Thanks for your help.
    Regards,
    Deepa

    Oracle Forms allows you to easily integrate Oracle Reports into your
    applications. However, on the Macintosh, it is not possible to use
    the normal Oracle Reports runtime to generate ASCII text files. In
    order to allow ASCII text files to be generated with Oracle Reports
    on the Macintosh, the Reports<TEXT> Runtime applications was
    developed. This version of the runtime only allows you to generate
    text files and should not be used for other purposes.
    While the Reports<TEXT> Runtime application has been provided, there
    is no built in integration with Forms. This bulletin explains a
    method which you can use integrate these two applications with little
    effort. In order to use this method, you will need the following
    items installed on your computer:
    * Oracle Forms 4.0
    * Oracle Reports 2.0
    * Oracle Command 1.0
    * AppleScript 1.1. This is available as part of the Macintosh
    Operating System version 7.5 as well as with certain 3rd party
    applications.
    Because the only way to use the Reports<TEXT> Runtime application is
    through Oracle Command, we will be using Oracle Command to run the
    Reports<TEXT> Runtime application. However, we need some way to
    communicate with Oracle Command which report we would like to run and
    what parameters we would like to pass in to Reports. To accomplish
    this goal, an AppleScript application will be used. Forms can use
    AppleEvents (Apple's method for inter-application communication) to
    communicate with this AppleScript application which can then create
    an Oracle Command script file to run. So, the summary of events
    which will take place are as follows:
    1. Forms dynamically creates a command line to run the
    Reports<TEXT> Runtime application.
    2. Using AppleEvents, Forms communicates this command line to the
    AppleScript application which writes out an Oracle Command
    script file.
    3. The AppleScript application communicates with Oracle Command and
    tells it to run the script which it just created.
    4. Oracle Command runs the script which invokes the Reports<TEXT>
    Runtime application.
    1. Creating the AppleScript Application
    The core of this solution is the AppleScript Application. While it
    is not necessary for you to be familiar with AppleScript, it will
    help tremendously in your understanding of how everything works.
    Here we provide you with an AppleScript which provides the
    functionality we need to implement our procedure.
    Note: This AppleScript is designed to work with the Macintosh
    Operating System version 7.5. It should work with earlier
    versions of the Operating System, but no guarantees are
    made. Furthermore, there are known problems with the version
    of AppleScript provided with version 7.1.2 of the Operating
    System which will cause your machine to crash when this
    script is executed. These problems with AppleScript were
    corrected for the version 7.5 release of the Operating System.
    -- This AppleScript Application is responsible for being a
    -- "go-between" between Oracle Forms and Oracle Command. It is
    -- responsible for both dynamically creating Oracle Command script
    -- files and disposing of these files.
    -- NOTE: This AppleScript Application was written for the Macintosh
    -- Operating System version 7.5. It has not been tested
    -- on any other version of the Macintosh Operating
    -- System.
    -- Author
    -- ======
    -- Doug Bitting
    -- Oracle Worldwide Technical Support
    -- Apple Desktop Products Group
    -- Date: 21-MAR-95
    -- The syntax "on <<...>> args" is how you setup an AppleScript to
    -- accept AppleEvents.
    -- Be careful, the << and >> characters are option-\ and option-|
    -- respectively. They are not two less-than signs and two
    -- greater-than signs.
    on <<event R20Trunt>> cmdScript
    -- First, let's construct a, hopefully, unique file name
    set dt to ((current date) as string)
    set hr to (word 5 of dt)
    set mn to (word 6 of dt)
    set sec to (word 7 of dt)
    set fName to (hr * 3600 + mn * 60 + sec as string)
    -- For this example, we will put all dynamically constructed
    -- script files onto the desktop.
    set tFold to (path to desktop)
    set fName to (tFold & "tmp." & fName as string)
    -- set up a mnemonic for the Return character
    set cr to (ASCII character 13)
    try
    -- open our Oracle Command script file
    -- The sequence <opt-l> at the end of the following line
    -- should be type in as an option-l (that is, a lowercase L).
    set fRef to (open for access file fName with write <opt-l>
    permission)
    -- Now, write the Oracle Command command line which was
    -- passed to us via AppleEvents.
    -- The sequence <opt-l> at the end of the following line
    -- should be type in as an option-l (that is, a lowercase L).
    write (cmdScript & cr) starting at <opt-l>
    ((get eof fRef) + 1) to fRef
    -- Now we have to also ask Oracle Command to let us know
    -- when it is finished with the script file we are
    -- creating. Basically, we are asking Oracle Command to
    -- use AppleEvents to let us know when to throw away the
    -- file we are creating
    -- The sequence <opt-l> at the end of the following lines
    -- should be type in as an option-l (that is, a lowercase L).
    write ("host SENDAE aplt R20T remv ---- t \"" & fName <opt-l>
    & "\";" as string) starting at <opt-l>
    ((get eof fRef) + 1) to fRef
    -- close the Oracle Command script file
    close access fRef
    -- Now that we have setup the temporary file,
    -- tell Oracle Command to execute it.
    tell application "Oracle Command 1.0"
    runscript fName
    end tell
    -- You can put some error handling here if you'd like.
    end try
    end <<event R20Trunt>>
    -- This is the AppleEvent handler to clean up when we are done. It
    -- simply throws the temp file into the trash can.
    -- Be careful, the << and >> characters are option-\ and option-|
    -- respectively. They are not two less-than signs and two
    -- greater-than signs.
    on <<event R20Tremv>> fName
    tell application "Finder"
    move (fName as alias) to (path to trash)
    end tell
    end <<event R20Tremv>>
    2. Setting Up Forms
    It is useful to setup a PL/SQL Program Unit to hide the details
    behind running the Text Runtime. Here is a suggested PL/SQL Program
    Unit for you to use:
    -- The following procedure is used to hide some of the details in
    -- using the AppleScript Application. It accepts 4 arguments:
    -- * The report name
    -- * The name of the output file
    -- * The parameters you would like to pass in. These need to be
    -- formatted just as if you were calling reports from a
    -- command line.
    -- * A connect string for Reports<TEXT> Runtime to connect with.
    procedure run_text_report (
    rName in char,
    oName in char,
    params in char,
    cString in char) is
    cLine varchar2(1000);
    begin
    cLine := 'execute r20text module='&#0124; &#0124;rname;
    cLine := cLine &#0124; &#0124; ' userid='&#0124; &#0124;cString;
    cLine := cLine &#0124; &#0124; ' paramform=no batch=yes';
    cLine := cLine &#0124; &#0124; ' destype=file desname='&#0124; &#0124;oname;
    cLine := cLine &#0124; &#0124; ' desformat=dflt.prt '&#0124; &#0124;params&#0124; &#0124;';';
    host('SENDAE aplt R20T runt ---- t "'&#0124; &#0124;cLine&#0124; &#0124;'"');
    -- NOTE: in the above host() command, the series of quotes at the
    -- end reads as follows: double-quote, single-quote, vertical
    -- bar, vertical bar, the word cLine, vertical bar, vertical
    -- bar, single-quote, double-quote, single-quote.
    end;
    Here is an example of how I can use the above procedure. In a
    WHEN-BUTTON-PRESSED trigger, I might have:
    declare
    reportName varchar2(16);
    outputName varchar2(64);
    paramVals varchar2(64);
    connectStr varchar2(16);
    begin
    -- We want to run the report named "myreport". The output from this
    -- report should go into a file named "output.txt" located in the
    -- "Reports" directory on my hard drive. This report accepts two
    -- parameters: p_start_date and p_end_date. The connect string for
    -- the database I am using is simply "scott/tiger"
    -- Setup some variables to hold all the information I want to pass
    -- in to run_text_report(). This information is put into variables
    -- for readability.
    reportName := 'myreport';
    outputName := 'HD:Reports:output.txt';
    paramVals := 'p_start_date=''01-MAR-95'' p_end_date=''31-MAR-95''';
    connectStr := 'scott/tiger';
    -- Run the report
    run_text_report(reportName, outputName, paramVals, connectStr);
    end;
    3. Putting the pieces together
    In order for this solution to function, you need to make sure that
    both your AppleScript application and Oracle Command are running when
    you make a call to run_text_report(). It is possible for you to
    launch Oracle Command from within Oracle Forms with the following
    line of code:
    host('LAUNCHID oBTL');
    If you place the above line of code in a WHEN-NEW-FORM trigger, you
    can assure that Oracle Command will be running when your form is
    launched.
    It is also possible for you to have Oracle Forms launch your
    AppleScript application. However, in order for you to do this, you
    need to be very familiar with the Macintosh Operating System, how to
    change the creator type of a file, and know what effects that change
    can produce. If you do not know how to change the creator type of
    your AppleScript application or are not comfortable doing so, you
    should simply document that your users need to make sure to launch
    your AppleScript application before trying to use your Form.
    However, if you know how to change the creator type of your
    AppleScript application and are comfortable doing so, here are the
    steps you will need to take to have Oracle Forms launch your
    AppleScript application for you:
    * Change the creator type of your AppleScript application to
    something unique.
    * Modify the run_text_report() procedure. You need to change the
    four character sequence "aplt" found in the host() command to the
    new creator type of your AppleScript application.
    * Add the line host('LAUNCHID <your new creator type>'); to your
    WHEN-NEW-FORM trigger or to whichever trigger you placed the
    host('LAUNCHID oBTL'); statement.
    There is one significant difference between RUN_PRODUCT and this
    solution. With RUN_PRODUCT, you have the option of specifying
    whether or not the call should be synchronous or asynchronous.
    However, the call to run_text_report() will always be asynchronous.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Deepa Pai:
    Hi ,
    Can anybody tell me whether this is possible and if so, how it can be done. Thanks for your help.
    Regards,
    Deepa <HR></BLOCKQUOTE>
    null

  • Example code for calling LabVIEW VI from C#

    I'm a bit rusty about LabVIEW. Haven't used it for about three years now
    I'm making an automation tool in Visual C# where the user should be able to select a VI to call and setup the input and output parameters.
    I must then make some VI-browser code where inputs and outputs are listed for a selected VI.
    I will also have to make the code that opens and runs the selected VI.
    Any hints and links could help as I havent done much "Call VI Server" or COM Interop with C# yet.
    /Jan

    Hello Jan
    I have a link to an example that shows how to control a LabVIEW VI through ActiveX.
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DC9156A4E034080020E74861&p_...
    Will this work for you...
    Regards
    Mohadjer
    NI-DK

  • How to generate a report from stored procedure

    I would like to generate a report from stored procedure.
    I used to work on sql server. this can be done as easy as put a select statement at the end of stored procedure.
    The resule can be displayed on the development IDE, like sql developer or consume by Java JDBC client.
    is there equivalent way to do this in Oracle stored procedure?

    Hi,
    What type of report you are looking..for.. ??
    As you said that "I used to work on sql server. this can be done as easy as put a select statement at the end of stored procedure. "
    When you execute it will return the result set and you will display directly on the FrontEnd.. Is my Understanding is correct Up to here.
    See, In oracle you have call some custom stored procedures as you did in SQL Sever, but you have return the Results Sets, with help of Out put paramter, Either Cursors or Varrays..
    or Else you can generate the Html reports based on your requirement, HTML can be used in the stored procedures of Oracle which will generate for your, you need to code it.
    I could not able get the relevant link for your reference.
    I will get back to you on this.
    - Pavan Kumar N

  • How to Call Crystal Reports from Swing Application

    Hi All,
    I have a requirement for calling Crystal Report from Swing Application. Please let me know how can I do that, and also provide the Source code for calling the crystal report.
    Thanks in advance.
    Chandra

    hi
    this is the code that i am using in my application which is similar to urs. but i am working with CR XI so make all the neccessary changes.
        import java.awt.*;
        import javax.swing.*;
        import com.crystaldecisions.ReportViewer.*;
        import com.crystaldecisions.reports.sdk.*;
        import com.crystaldecisions.sdk.occa.report.reportsource.*;
       public class HelloSwing
            public static void createAndShowGUI()
                try
                    //Make sure we have nice window decorations.
                    JFrame.setDefaultLookAndFeelDecorated(true);
                    //Create and set up the window.
                    JFrame frame = new JFrame("HelloWorldSwing");
                    frame.setTitle( "Testing Reports");
                    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   ReportViewerBean viewer = new ReportViewerBean();
                    viewer.init( new String[0], null, null, null);
                  ReportClientDocument rpt = new ReportClientDocument();
                    rpt.open( "report path", 1 );
                    IReportSource rptSource = rpt.getReportSource();
                    viewer.setReportSource( rptSource );
                    frame.getContentPane().add( viewer, BorderLayout.CENTER );
                    frame.setSize( 700, 500 );
                    frame.setVisible(true);
                    viewer.start();
                catch ( Exception exception )
                    System.out.println( exception.toString() );
            public static void main(String[] args)
                javax.swing.SwingUtilities.invokeLater(new Runnable()
                    public void run()
                        createAndShowGUI();
       there are 23 jar files that u need to import into ur package. but remember that ReportViewerBean should be the first jar file in the list & it should be followed by jrcerom.jar
    specify the key in the CRConfig.xml file (which also has to be imported in the package)
    u can find these jar files in the common objects folder in your program files.
    hope it helps. best of luck

  • How to call a report from a web application

    Hi,
    I have a web server in wich is installed Reports 6i. My question is how can I call reports 6i to generate a pdf using a .rep file from my web application (built with java)?

    Hi,
    The below link will be very useful for one who need idea on calling Oracle Report from Java Application,
    http://www.oracle.com/technology/products/reports/htdocs/getstart/examples/reportswebservice/index.html
    Thanks & Rgds,
    M T

  • 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 Form in 10g

    Hi all,
    I am very new to Oracle Form builder, I wana to call a report from a Form.
    we are using Oracle 10g Developer suit.
    Can any body please help me regarding on this?
    Regards
    Tanmaya Pradhan(Tam)

    ..or
    Take a look at
    Re: Run Report10g  Through form 10g

  • Need code for sales order create report using bapi's

    need code for sales order create report using bapi's

    Hi,
    Go through below link
    http://www.saptechies.com/bapi_salesorder_createfromdat2/
    <b>Reward points if it helps,</b>
    Satish

  • Urgently Need Code for Copy & Paste from Html Table in JSP to Excel file

    I am creating a html table in JSP file .
    I need code for 'Cut,Copy,Paste' functions ie. if someone wants to copy data from my table to excel file or from excel file to html table he shud be able to do that.
    Can someone give me code for 'Cut,Copy and Paste' i.e. some javascript functions which can do cut, copy and paste which i can put in my jsp file
    Thanks
    Message was edited by:
    javatechguru2007

    package com.chinmayananda
    public class Tetris{
    // complete here
    code]
    public abstract class AbstractTetris {
       public abstract void start();
       public abstract void stop();
    }nearly done

  • I need a code to run a report from a forms on 10G...

    Hi!! I´m migrating from 6i to 10G and i cant run a report... can someone send me a sample code to run a report from a form in 10G??
    Thanks!!
    Regards!

    iam using Javabean in oracle 10g forms to tun the report....
    First create a block with a name control and add an bean to it with a name
    userid_bean.click the proerty of the bean and changes its width and height
    so that u cannot see it when u run the particular form.
    now use the below code where u are coding to run the report.
    Declare
    rep_url varchar2(2000);
    begin
    rep_url := '/reports/rwservlet?report=filepath\rep1.RDF' ||
    '&desformat=htmlcss&destype=cache&userid=sample/sample@oracle' || '&paramform=yes';
    -- Write Log messages to the Forms JInitiator console.The Next line must
    -- be disabled before running this code in any production environment.
    set_custom_property('control.userid_bean',1,'ADD_USERID',
    get_application_property(username)||'/'||
              get_application_property(password)||'@'||
              get_application_property(connect_string));
    -- writing the cookie
    set_custom_property('control.userid_bean',1,'WRITE_USERID_COOKIE','10g');
    web.show_document(rep_url,'_blank');
    end;

  • **How to call a report from a form by passing a specfic value?????

    Hi Expert,
    I want to call a report from a form.My problem scenario like, a user is login to his account and there is a option called ADMIT CARD(Push Button).Now when he pressed the button a report will generate.I want that when he pressed the button the user id of the user will passed to the report and the report will generate corresponding to his details which was stored in the database.This scenario is like any online admit card.
    Suppose I want a details report of employee whose employee_id=100.How could I pass this value(employee id) to report which will generate a report details.
    Thanks,
    TAPAN
    Message was edited by:
    user630863

    Thanks for replying.
    Actually I am a beginner.I think that I have to use RUN_REPORT_OBJECT built-in.But I cannot understand the parameterlist.Can u plz give me any example or code then I am very thankful.
    Suppose I want a details report of employee whose employee_id=100.How could I pass this value(employee id) to report which will generate a report details.
    Thanks,
    TAPAN

  • Calling a report from a form based on procedure

    I created a form based on a procedure.
    It is a entry form where the user is selecting or enters data then on submit I must display the report based on selected data.
    I know I can simply create a report with all bind variable and do the job.
    My question is what is the syntax to call the report from the procedure for the selected parameters values.
    Thanks
    Lawrence

    If you want to display other HTML page after successful submission, you need to use
    either go or call method.
    I created a form on SCOTT.EMP and a report on SCOTT.EMP and the report accept a parameter for
    the deptno. Here is my on successfull submission code:
    declare
    l_dept number;
    l_url varchar2(2000);
    begin
    l_dept := p_session.get_value_as_number('DEFAULT', 'A_DEPTNO', 1);
    l_url := 'scott.rpt_mask_1.show?p_arg_names=emp.deptno&p_arg_values='&#0124; &#0124;l_dept;
    go(l_url);
    end;
    null

  • 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 standard Report from a zprogram

    Hi Experts,
    We want to call ME5J transaction code from a zprogram using Submit statement.
    We used following code to call the report
    SUBMIT RM06BKPS WITH TCNT-PROF_DB EQ '000000000001' WITH CN_PROJN IN PROJECT  EXPORTING LIST TO MEMORY AND RETURN.
    After using this statement we are getting output of the report. We don't need to display the result. We want to fetch data from above report using
    CALL FUNCTION 'LIST_FROM_MEMORY'.
    How to hide output display of ME5J?
    Regards,
    Sibin

    Hello,
    you can use the class cl_salv_bs_runtime_info=>get_data_ref to get the standard report output without displaying the ALV grid.
    Check the Blog by glen simpson.
    http://scn.sap.com/community/abap/blog/2011/07/07/gain-programmatic-access-to-data-of-sapgui-alv-reports
    you would get the result in a type table declared and then do the Processing as per the requirement.
    Sample code for same.
    *& Report  ZCALL_STANDARD*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*
    REPORT zcall_standard.
    TABLES : cdhdr.
    PARAMETERS : udate TYPE sy-datlo DEFAULT sy-datlo OBLIGATORY,
                 udate_to TYPE sy-datlo DEFAULT sy-datlo OBLIGATORY,
                 utime_fr TYPE sy-timlo DEFAULT sy-timlo OBLIGATORY,
                 utime_to TYPE sy-timlo DEFAULT sy-timlo OBLIGATORY.SELECT-OPTIONS : user FOR cdhdr-username.
    FIELD-SYMBOLS <lt_data>             TYPE ANY TABLE.DATA:          lr_data               TYPE REF TO data,
           ls_metadata TYPE cl_salv_bs_runtime_info=>s_type_metadata.DATA          lr_data_descr          TYPE REF TO cl_abap_datadescr.
    DATA: r_alv_table         TYPE REF TO cl_salv_table,
          r_func              TYPE REF TO cl_salv_functions.DATA: r_display           TYPE REF TO cl_salv_display_settings.
    DATA: r_columns           TYPE REF TO cl_salv_columns.DATA: r_column            TYPE REF TO cl_salv_column.
    DATA: lr_events           TYPE REF TO cl_salv_events_table,
          lr_functions_list   TYPE REF TO cl_salv_functions_list.
    cl_salv_bs_runtime_info=>set(
             EXPORTING display  = abap_false
                       metadata = abap_true
                       data     = abap_true ).
    SUBMIT rsvtprot  WITH cusobj = 'V_T001B'
             WITH dbeg = udate*                 WITH tbeg = utime_fr
             WITH dend = udate_to*                 WITH tend = utime_to
             WITH users = user[]
             WITH alv_grid = 'X' AND RETURN.
    TRY.
        cl_salv_bs_runtime_info=>get_data_ref(
             IMPORTING r_data_descr      = lr_data_descr ).
        CREATE DATA lr_data           TYPE HANDLE lr_data_descr.
        ASSIGN lr_data->*           TO <lt_data>.
        cl_salv_bs_runtime_info=>get_data(
          IMPORTING
            t_data      = <lt_data>
    *            TRY.
        CALL METHOD cl_salv_bs_runtime_info=>get_metadata
          RECEIVING
            value = ls_metadata.*             CATCH cx_salv_bs_sc_runtime_info .*            ENDTRY.
      CATCH cx_salv_bs_sc_runtime_info.
        MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
    ENDTRY.
    cl_salv_bs_runtime_info=>clear_all( ).
    CALL METHOD cl_salv_table=>factory
      IMPORTING
        r_salv_table = r_alv_table
      CHANGING
        t_table      = <lt_data>.
    CALL METHOD r_alv_table->get_functions
      RECEIVING
        value = r_func.
    CALL METHOD r_func->set_all
      EXPORTING
        value = abap_true.
    r_display = r_alv_table->get_display_settings( ).
    r_display->set_striped_pattern( cl_salv_display_settings=>true ).
    lr_functions_list = r_alv_table->get_functions( ).
    r_columns = r_alv_table->get_columns( ).
    r_columns->set_optimize( if_salv_c_bool_sap=>true ).
    CALL METHOD r_alv_table->display.

Maybe you are looking for