Create a dynamic report

Hi,
I would like to create a dynamic report in crystal report.
put data fields, text fields, criteria parameters on report in run time.
I will appreciate if you can send me an example code in java that creates and shows the report.
Thanks,
Anat

So find the appropriate website and forum and ask there.

Similar Messages

  • How to create the dynamic report

    Hi,
    please help me, how to create the dynamic report

    Hi,
      Try this..
    DATA: p_temp(30)  TYPE c DEFAULT 'ZTEST_REPORT'.
    TYPES: BEGIN OF t_abapcode occurs 0,
            row(72) TYPE c,
           END OF t_abapcod.
    T_ABAPCODE-ROW = 'REPORT ZTEST_REPORT.'.
    APPEND T_ABAPCODE.
    T_ABAPCODE-ROW = 'WRITE: / ''TEST REPORT''. '.
    APPEND T_ABAPCODE.
    INSERT REPORT p_temp FROM it_abapcode.
          SUBMIT (p_temp) AND RETURN.
          DELETE REPORT p_temp.
    Thanks,
    naren

  • How can i create an dynamic report in Java

    hello everybody,
    I want to make dynamic reports in Java. Report contain data and images with good layout.. such as crystal reports presentation..
    Reports fields decided at run time or we can say that it is generated according to user requirement...
    can it is possible in Java. If it is then which tool is better for it..
    please suggest me.. this is very urgent requirement for me...

    i don't know what types of tools are avaiable in market... Tools for what? You still didn't tell us what exactly you want to do.
    i just imagin that
    "An user create a database dynamically on server
    databaseNobody "dynamically creates a database".
    and he decide reports desgin according to
    his requirement..... we provide an control for this
    type possibilities....."
    so this is question is build in my mind.. so i
    forward this question to this forums..
    I am just going to check the physibility of my mind
    imagination...Feasibility you mean. IMHO, the feasibility of creating that stuff yourself is very low. Reinventing the wheel usually doesn't make it better, and it's likely to be more expensive to pay you for creating an inferior solution (not because of lack of skills, but simply because the available products had a few years time to grow, feature-wise) than to simply buy the licenses. Look at Crystal Reports or JFreeChart or Jasper Reports. Or use Google to look up J2EE-based reporting libraries. There might be more.
    Which of these is best, I don't know, I never used any of those. Also, the definition of "best" changes with the requirements. What's better, a Ferrari or a truck?

  • Can I create a dynamic report in the server without using a report template

    Hi,
    My company just bought a Crystal Report Server XI and it didn't have a report designer.
    I can't start creating report without the designer.
    The question is can  I generate a dynamic report at runtime (on the crystal report server ) without using report template?
    My project requirement is to use a crystal report server to manage the reports.
    Some client web application will just access this report server.
    I  hope the experts can provide me some guidance.
    regards,
    Rulix
    Edited by: Rulix Batistil on Nov 3, 2008 8:08 AM

    Hi Rulix,
    The latest version of CR Server is 2008. Therefore I'm assuming you are using CR Server 2008.
    New in CR 2008 is the .NET report modification software development kit (SDK). The report application server (RAS) SDK is now available for users of Crystal Reports .NET API without the use of a RAS server. Report modification such as changing, adding, or removing database providers, or adding, removing, or creating report objects, parameters, formulas, and sections can be achieved by accessing the RAS SDK through the Crystal Reports .NET SDK.
    Java developers however receive the JRC and Java SDK documentation through the free Crystal Reports for Eclipse download. This product will be updated on a separate schedule from Crystal Reports.
    Further Information and samples are available in our [Developer Library|https://www.sdn.sap.com/irj/sdn/businessobjects?rid=/webcontent/uuid/5001d5de-f867-2b10-00bf-8d27683c85a0]
    Kind regards,
    Tim

  • Creating a dynamic report level formula in Analysis

    Hello Experts,
    I have a requirement in Analysis to create a report level formula for "Number of days a Product has been on Backorder" which is a calculation based on existing report objects/elements i.e Current Date - Sales Order Creation Date.  The problems that I'm facing right now with this are :
    a) How to set up Analysis to only select current date automatically each time the report is run as oppose to selecting the current date manually each time ?
    b) How do i write the formula that adjusts the Column/Row(with the formula) itself if more objects are added into the report or moved out of the report.
    Please help folks.
    Thanks
    Gaurav

    Gaurav:
    a) How to set up Analysis to only select current date automatically each time the report is run as oppose to selecting the current date manually each time ?
    Why not do this in the BEx Query Designer?
    As for part b, I am not following; please include screen shots.

  • Creating dynamic report on a join

    I'd like to create a dynamic report on something like this
    select a.name, b.gender
    from employees a, gender b
    where a.gender_id=b.gender_id;
    to get this
    NAME GENDER
    bob male
    fred male
    sally female
    instead of this which is not that useful to the end user...is it possible?
    SQL> select name, gender_id from employees;
    NAME GENDER_ID
    bob 1
    fred 1
    sally 2

    Hello:
    >
    I'd like to create a dynamic report on something like this
    select a.name, b.gender
    from employees a, gender b
    where a.gender_id=b.gender_id;
    >
    Why not simply use this query for the report ? What needs to be 'dynamic' here ?
    Varad

  • Dynamic report output in a webdynpro alv

    Hi,
    I have created a dynamic report in the R/3 system . In this report, i am creating a report program within the report and subsequently executing this dynamically created report and displaying in the ALV..
    Is it possible to handle such a scenario in a webdynpro ALV. One option is to use ITS and display the report in the portal but is there some other way so that i can directly view this report in an alv grid in a view.
    all help appreciated!!
    regards,
    Priyank

    Hi Priyank,
    This could be one of the solution:
    1] Run the report in background mode (using submit statement, dn't forget to give printer as LOCL), get the spool id programatically. Use the FM's CONVERT_OTFSPOOLJOB_2_PDF or CONVERT_ABAPSPOOLJOB_2_PDF.
    Which returns the ouput of table tline, convert this to xtring and bind it to xtring attribute.
    In view add a interactive form and bind the xstring attribute to the Interactive form.
    By following the above steps, we can display the result in the PDF in WD ABAP.
    2] The report result is ALV and in most of the cases we generally do not have function modules or any other easy way to get the output.
    In such cases the best approach which we follow is, to run this in background mode and generate the spool and display the ouput in PDF.
    3] But if intertactive form is not present in your requirement then we need to debug the logic of the report (if no FM or class present) and get the results and display it in the View.
    You can create a service which takes the parameters of the report, submits it and
    transfers the result to HTML. In a view you use an IFRame which takes the URL of the service and shows the result HTML.
    just additionally read this thread,
    Display simple ABAPLIST
    Here an IFrame is used to display HTML output of report. But as IFRame gets obsolete the Suresh's solution seems to be pretty cool.
    Hope this will help you!
    Cheers,
    Darshna.

  • Financial Reporting Studio: Formula for percentages in Dynamic report

    Hi,
    I have a formula problem in Financial Reporting Studio vers. 9.20.582. I created a dynamic report with four columns:
    1. Column: Entities
    Entity A, Entity B
    2. Column: Accounts
    Account A, Account B, Account C
    3. Column A: Accounts
    Data for a selected period
    4. Column B: Formula
    Percentage Account B to Account A and Account C to Account A per each Entity
    My question is: Could I create a formula in 4th column that shows a percentage of Account B in comparison to Account A for each Entity (everything in one cell)?
    Because when I use for example the Formula Percentoftotal([a], [a,1(1)]) it shows for second entity B the wrong percentages.
    I hope this was understandable.
    Thank you very much for your help.
    Chris
    Edited by: user8009251 on 14.04.2010 00:45
    Edited by: user8009251 on 14.04.2010 00:46

    Hi
    Good question? I think, there is a solution.
    You can use the concept of multiple grid here.
    Please keep the referred grid at one place and use another grid where you want the formulas.
    Please mail me for further info: [email protected]

  • Dynami report

    Hi, I would like to know how can I create a dynamic report where de user defines de columns to display in the report, this is for a client's report, where each client wants a diferent information, from the same table.
    Than you

    Yes it is possible.
    Follow the steps below.
    1. Create query with all columns.
    2. Create parameter for each column(ex: col1_param,col2_param etc..)
    3. Write format trigger for each column in which you check the parameter value for that column.if it is to be selected then return true else return false.
    IF :col1_param = 1 then
    return true ;
    else
    return false;
    end if;
    4. If the column1 is not selected and column2 , column 3 are selected, then column2 has to be printed in place of column1 and column 3 has to be printed in place of column 2 .
    To achieve this create Anchors between Column1,2,3 by setting the anchor property horizontally collapse = YES.
    Hope this helps you.
    If you are interested I can send you example Report.RDF
    Sridhar

  • Dynamic reporting in Java

    Hi to all
    I want to create a dynamic reporting tool , in which user can add & delete no of columns from database table and for selected columns , user want to generate reports. Can any one give me idea about Java API or any other API that we can use in java application for dynamic reporting. Please give me reference example for suggested API if possible. I shall be very thankfull for your support & guidence.
    Preet

    socmag_Java_developer wrote:
    I want to create my own GUI reporting tool in java. Can you suggest me any Java API with some examplesIf you mean "*Standard* Java API", don't you find suggestions and examples in the first answer?

  • Need correction for dynamic report

    Hi Experts,
    As i have very less experience in SAP , can anyone please help me.
    The report code i attached here generate only 10 columns in the report and all the lines in internal table i am showing in these 10 columns, the problem is if i have more that 10 lines in the tline(script for long material text- MM03) then it leaves those lines, so
    I need to create a dynamic report for this which will create columns depending on the lines in the tline.As i dnt no much about ALV i read so namy things but not able to make it dynamic
    Please, can anyone help me by doing changes in this code and make it dynamic report/ALV
    REPORT  zmm_test_mat_desc.
    TABLES : ekpo,makt, t001w.
    TYPE-POOLS: slis.
    DATA : thread LIKE thead.
    DATA : l_index LIKE sy-tabix.
    DATA : p_index LIKE sy-tabix.
    DATA: BEGIN OF int_out OCCURS 0,
    matnr LIKE makt-matnr,
    maktx LIKE makt-maktx,
    tdline1 LIKE tline-tdline,
    tdline2 LIKE tline-tdline,
    tdline3 LIKE tline-tdline,
    tdline4 LIKE tline-tdline,
    tdline5 LIKE tline-tdline,
    tdline6 LIKE tline-tdline,
    tdline7 LIKE tline-tdline,
    tdline8 LIKE tline-tdline,
    tdline9 LIKE tline-tdline,
    tdline10 LIKE tline-tdline,
    werks LIKE ekpo-werks,
    END OF int_out.
    DATA: BEGIN OF int_out_new OCCURS 0,
    matnr LIKE makt-matnr,
    maktx LIKE makt-maktx,
    tdline1 LIKE tline-tdline,
    tdline2 LIKE tline-tdline,
    tdline3 LIKE tline-tdline,
    tdline4 LIKE tline-tdline,
    tdline5 LIKE tline-tdline,
    tdline6 LIKE tline-tdline,
    tdline7 LIKE tline-tdline,
    tdline8 LIKE tline-tdline,
    tdline9 LIKE tline-tdline,
    tdline10 LIKE tline-tdline,
    tline LIKE tline OCCURS 0,
    werks LIKE ekpo-werks,
    END OF int_out_new.
    DATA: it_tlines LIKE tline OCCURS 10 WITH HEADER LINE.
    ****ALV list definintion
    DATA: ws_cat TYPE slis_fieldcat_alv ,
    int_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
    g_custom_container TYPE REF TO cl_gui_custom_container.
    DATA : it_heading TYPE slis_t_listheader WITH HEADER LINE.
    *DATA : it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA : lay TYPE slis_layout_alv.
    DATA : it_sort_subtotal TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA : it_event TYPE slis_t_event WITH HEADER LINE.
    DATA: v_repid LIKE sy-repid.
    *selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_werks FOR ekpo-werks OBLIGATORY .
    SELECT-OPTIONS: s_matnr FOR makt-matnr OBLIGATORY .
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
    AT SELECTION-SCREEN.
      SELECT SINGLE * FROM t001w WHERE werks IN s_werks.
      IF sy-subrc NE 0.
        MESSAGE e001(319) WITH 'Plant does not Exist!'.
      ENDIF.
      SELECT SINGLE * FROM makt WHERE matnr IN s_matnr.
      IF sy-subrc <> 0.
        MESSAGE e001(319) WITH 'Material does not Exist!'.
      ENDIF.
    START-OF-SELECTION.
      BREAK-POINT.
      PERFORM get_data.
    PERFORM field_catalog.
    PERFORM display_data.
    END-OF-SELECTION.
    *FORM GET_DATA.
    FORM get_data.
      DATA: l_index LIKE sy-tabix.
    *To Fetch Data From Makt.
      SELECT b~werks a~matnr a~maktx
      INTO CORRESPONDING FIELDS OF TABLE int_out
      FROM makt AS a INNER JOIN marc AS b ON a~matnr = b~matnr
      WHERE a~matnr IN s_matnr
      AND b~werks IN s_werks.
      LOOP AT int_out.
        l_index = sy-tabix.
    read table int_out_new with key matnr = int_out-matnr.
        int_out_new-werks = int_out-werks.
        int_out_new-matnr = int_out-matnr.
        int_out_new-maktx = int_out-maktx.
        thread-tdname = int_out-matnr.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            client                  = sy-mandt
            id                      = 'BEST'
            language                = sy-langu
            name                    = thread-tdname
            object                  = 'MATERIAL'
          TABLES
            lines                   = it_tlines
          EXCEPTIONS
            id                      = 1
            language                = 2
            name                    = 3
            not_found               = 4
            object                  = 5
            reference_check         = 6
            wrong_access_to_archive = 7
            OTHERS                  = 8.
    *Loop on it_tlines where long text is coming .
        LOOP AT it_tlines.
          IF sy-subrc = 0.
            p_index = sy-tabix.
            IF p_index = 1.
              int_out_new-tdline1 = it_tlines-tdline.
            ELSEIF p_index = 2.
              int_out_new-tdline2 = it_tlines-tdline.
            ELSEIF p_index = 3.
              int_out_new-tdline3 = it_tlines-tdline.
            ELSEIF p_index = 4.
              int_out_new-tdline4 = it_tlines-tdline.
            ELSEIF p_index = 5.
              int_out_new-tdline5 = it_tlines-tdline.
            ELSEIF p_index = 6.
              int_out_new-tdline6 = it_tlines-tdline.
            ELSEIF p_index = 7.
              int_out_new-tdline7 = it_tlines-tdline.
            ELSEIF p_index = 8.
              int_out_new-tdline8 = it_tlines-tdline.
            ELSEIF p_index = 9.
              int_out_new-tdline9 = it_tlines-tdline.
            ELSEIF p_index GE 10.
              int_out_new-tdline10 = it_tlines-tdline.
            ENDIF.
          ENDIF.
        ENDLOOP.
        DELETE ADJACENT DUPLICATES FROM int_out .
        APPEND int_out_new.
        CLEAR int_out_new.
      ENDLOOP.
    Field Catalog
    ***MATERIAL NO no
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'WERKS'.
      int_fcat-reptext_ddic = 'Plant'.
      APPEND int_fcat .
    ***MATERIAL NO no
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'MATNR'.
      int_fcat-reptext_ddic = 'Material N0'.
      APPEND int_fcat .
    *material Short Description
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'MAKTX'.
      int_fcat-reptext_ddic = 'Material Short Description'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '45'.
      APPEND int_fcat .
    Material Long Description1
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE1'.
      int_fcat-reptext_ddic = 'Material Long Description1'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description2
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE2'.
      int_fcat-reptext_ddic = 'Material Long Description2'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description3
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE3'.
      int_fcat-reptext_ddic = 'Material Long Description3'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description4
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE4'.
      int_fcat-reptext_ddic = 'Material Long Description4'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description5
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE5'.
      int_fcat-reptext_ddic = 'Material Long Description5'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description5
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE5'.
      int_fcat-reptext_ddic = 'Material Long Description5'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description5
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE5'.
      int_fcat-reptext_ddic = 'Material Long Description5'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description6
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE6'.
      int_fcat-reptext_ddic = 'Material Long Description6'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description7
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE7'.
      int_fcat-reptext_ddic = 'Material Long Description7'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description8
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE8'.
      int_fcat-reptext_ddic = 'Material Long Description8'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description9
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE9'.
      int_fcat-reptext_ddic = 'Material Long Description9'.
      int_fcat-datatype = 'CHAR'.
      int_fcat-outputlen = '75'.
      APPEND int_fcat .
    Material Long Description10
      int_fcat-tabname = 'INT_OUT_NEW'.
      int_fcat-fieldname = 'TDLINE10'.
      int_fcat-reptext_ddic = 'Material Long Description10'.
      int_fcat-datatype = 'CHAR'.
    int_fcat-outputlen = '75'.
      APPEND int_fcat .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = int_fcat[]
        TABLES
          t_outtab           = int_out_new
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    ENDFORM. "display_data
    Regards
    Nik.

    Nikhil,
    Instead of declaring 10 lines, please declare a variable of type STRING.
    Then append each line of your material text and concatenate it into the string.
    Then you can comfartably have one long text and have it displayed to the user.
    Please let us know if any further information is required.
    Thanks
    Ganesh.S

  • How to create a dynamic RTF report which creates dynamic columns based on dynamic column selection from a table?

    Hi All,
    Suppose I have table, whose structure changes frequently on daily basis.
    For eg. desc my_table gives you following column name on Day 1
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    On Day 2, two more columns are added, viz, Address and Salary.
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    Address
    Salary
    Now I want to create an Dynnamic RTF report which would fetch data from ALL columns from my_table on daily basis. For that I have defined a concurrent program with XML as output type and have attached a data template/data definition to it which takes in XML as input and gives final output of conc program in EXCEL layout. I am able to do this for constant number of columns, but dont know how to do it when the number of columns to be displayed changes dynamically.
    For Day 1 my XML file should be like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 1, EXCEL output from RTF template should be like this.
    Name     Age     Phone
    Swapnill     23     12345
    For Day 2 my XML file should be like this. With 2 new columns selected in SELECT clause.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    ,Address
    ,Salary
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
      <element name="Address" value="Address" />
      <element name="Salary" value="Salary" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 2, EXCEL output from RTF template should be like this.
    Name     Age     Phone     Address     Salary
    Swapnill     23     12345         Madrid     100000
    Now, I dont know below things.
    Make the XML dynamic as in on Day 1 there must be 3 columns in the SELECT statement and on Day 2, 5 columns. I want to create one dynamic XML which should not be required to be changed if new columns are added in my_table. I dont know how to create this query and also create their corresponding elements below.
    Make the RTF template dyanamic as in Day1 there must 3 columns in EXCEL output and on Day 2, 5 columns. I want to create a Dynamic RTF template which would show all the columns selected in Dynamic XML.I dont know how the RTF will create new XML tags and how it will know where to place it in the report. Means, I can create RTF template on Day 1, by loading XML data for 3 columns and placing 3 XML tags in template. But how will it create and place tags for new columns on Day 2?
    Hope, you got my requirement, its a challenging one. Please let me know how I can implement the required solution using RTF dynamically without any manual intervention.
    Regards,
    Swapnil K.
    Message was edited by: SwapnilK

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • How to create a dynamic action from link column in classic report

    I Have an apex page that display a modal window utilizing jquery. In the modal window I have a classic report with a link column that I want to capture its click event.
    I was thinking I could create a dynamic action with selection type=jquery selector. Not for sure if I need to do anything on link column and do not know the syntax
    for jquery selector. Would appreciate any help or direction???

    Thank you for your response. I am very new to Jquery so don't understand all that well.
    What I did:
    I created a dynamic action
    Event: Click
    Selection Type: jQuery Selector
    jQuery Selector: tdheaders
    Created True Actions
    I created an alert to see if this is being executed.
    Alert 'I made it here'
    What I have:
    I created a report region with the following query:
    Select empno, ename, 'SELECT' from emp
    where (ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
    or :P2_SEARCHPU is null)
    I created 'SELECT' column as Link Column
    Report Attributes
    Link Text Select
    Target Page in this Application
    Page 2
    Region Header
    <div id="ModalForm2" title="Employee List" style="display:none">
    Region Footer
    </div>
    This report is displayed in a modal form when a button is clicked.
    Code for modal window in Page Header
    <script type="text/javascript">
    $( function() {
    $('#ModalForm2').dialog(
    { modal : true ,
    autoOpen : false ,
    buttons : {
    Cancel : function() {
    closeForm2();
    function openForm2()
    $('#ModalForm2').dialog('open');
    function closeForm2()
    $('#ModalForm2 input[type="text"]').val('');
    $('#ModalForm2').dialog('close');
    </script>
    I am trying to capture the click event on the link column of the report in the modal form. I want to pass a couple of column values
    back to the main form and close the modal window. I do not want to do the submit that happens if I click on the link column and link back to the main page(2)
    If I let the submit to happen, all other entered fields are cleared on my main form.
    Just don't understand the jQuery selector. I have no problem catching the button clicks on the modal form.

  • How to create a dynamic tree report

    hi experts,
           i have a requirement to create a dynamic tree report in OM module.
      this report should show the number of people positions required in a org unit, and also the number of people available in a org unit.
      There is something called as qualification catalog to which qualifications are attached, to these qualifications org units are attached, these org units will have some positions attached to it, and each of this position might have a person attached to it.
    The user will enter the qualification catalog number in the selection screen for which he should be getting the result in a tree format which flows from qualification catalog to qualifications, from qualifications to org units, from orgunits to the total no of positions present in this orgunit and the no of positions occupied in the orgunit.
      This is a challenging job as far as i am concerned.
    Please suggest me a way to approach this,i promise to reward the answers.
    thanks in advance,
      santosh.

    Hi,
    Check the demo tree programs for yuor requirement?
    SAP List Tree:  SAPSIMPLE_TREE_CONTROL_DEMO
    SAP Column Tree : SAPCOLUMN_TREE_CONTROL_DEMO
    SAP Easy Tree : SAPSIMPLE_TREE_CONTROL_DEMO
    Thanks,
    Ramakrishna

  • Create dynamic report or query for piece count

    Hi abaper's
    This is a very straight forward requirement. so please give me code
    First you have to get the corresponding plant from table T320 for the given warehouse numbers in the selection screen. 
    1.     Get the sum of order qty of sales orders from the sales order tables      for the given warehouse(Plant), distribution channel and the give date      range.
    2.     Get the confirmed transfer orders qty from the TO master table where      TO confirmation date is in the given date range and WH number.
    3.     Get the total PGIed qty from the delivery master table where PGI'ed      date in the given date range, shipping point is in the corresponding      plant of the WH and for the given distribution channel.
    As you are going to use the major tables please try to write the select commands effectively to avoid further performance issues.

    How to improve the performance fo this code.....this very urgent.
    & Issue Number          : 22199                                    &
    & Programmer            : Anjaneyulu.Pabba                         &
    & Transport Number      : D01K962471                               &
    & Date of Creation      : 19/03/2008                               &
    & Description           : Dynamic report or query for piece count  &
    & Requested By          : Parvati.Polisetty                        &
    REPORT  ZR_SD_PIECE_COUNT_ALV no standard page heading
                                  line-size 255
                                  line-count 65.
                          TABLES DECLARATION
    *TABLES: T320,   "Assignment IM Storage Location to WM Warehouse Number
          VBAK,   "Sales Document: Header Data
          VBAP,   "Sales Document: Item Data
          TVKOV,  "Org. Unit: Distribution Channels per Sales Organization
          LTAK,   "WM transfer order header
          LTAP,   "Transfer order item
          LIKP,   "SD Document: Delivery Header Data
          LIPS.   "SD document: Delivery: Item data
                          TYPE-POOLS DECLARATION
    TYPE-POOLS: SLIS .
         Internal Table Declaration
    DATA : BEGIN OF TY_T320,
            WERKS TYPE WERKS_D,
            LGNUM TYPE LGNUM,
           END OF TY_T320.
    DATA : BEGIN OF TY_VBAK,
            VBELN  TYPE VBELN_VA,
            VTWEG  TYPE VTWEG,
            WERKS  TYPE WERKS_D,
            KWMENG TYPE KWMENG,
            VSTEL  TYPE VSTEL,
           END OF TY_VBAK.
    DATA : BEGIN OF TY_LTAK,
            LGNUM TYPE LGNUM,
            TANUM TYPE TANUM,
            VISTA TYPE LTAP_VISTA,
           END OF TY_LTAK.
    DATA : BEGIN OF TY_LIKP,
            VBELN TYPE VBELN_VL,
            WERKS TYPE WERKS_D,
            LFIMG TYPE LFIMG,
           END OF TY_LIKP.
    DATA : BEGIN OF TY_ITAB ,
    LGNUM  TYPE LGNUM,    "Warehouse Number / Warehouse Complex
    WERKS  TYPE WERKS_D,  "Plant
    VBELN  TYPE VBELN_VA, "Sales Document
    VTWEG  TYPE VTWEG,   "Distribution Channel
    KWMENG TYPE KWMENG,  "Cumulative order quantity in sales units
    TANUM  TYPE TANUM ,     "Transfer Order Number
    VISTA  TYPE LTAP_VISTA, "Source actual quantity in alternative
                                                 unit of measure
    LFIMG  TYPE LFIMG,  "Actual quantity delivered (in sales units)
    END OF TY_ITAB .
    DATA: T_T320 LIKE STANDARD TABLE OF TY_T320 INITIAL SIZE 0 WITH HEADER
                                                                   LINE,
          T_VBAK LIKE STANDARD TABLE OF TY_VBAK INITIAL SIZE 0 .
    DATA: T_LTAK LIKE STANDARD TABLE OF TY_LTAK INITIAL SIZE 0 WITH HEADER
                                                                    LINE.
    DATA :T_LIKP LIKE STANDARD TABLE OF TY_LIKP INITIAL SIZE 0 WITH HEADER
                                                                    LINE.
    DATA:T_ITAB LIKE STANDARD TABLE OF TY_ITAB INITIAL SIZE 0 WITH HEADER
                                                                   LINE .
    *&      Fieldcatalog Declaration
    DATA : T_FCAT TYPE SLIS_T_FIELDCAT_ALV,
           W_FCAT TYPE SLIS_FIELDCAT_ALV.
    DATA : W_LAYOUT TYPE SLIS_LAYOUT_ALV.
    ********Global Data Declaration***
    DATA :G_REPID        LIKE SY-REPID,
         G_EXIT(1)      TYPE C,
         GX_VARIANT     LIKE DISVARIANT,
         X_SAVE,                          "for Parameter I_SAVE
         GS_VARIANT TYPE DISVARIANT.      "for parameter IS_VARIANT
    data: g_lgnum type t320-lgnum,
          g_vtweg type vbak-vtweg,
          g_erdat type vbak-erdat.
    *&      Selection-Screen
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_LGNUM FOR  g_lgnum, "Warehouse Number
                    S_VTWEG FOR g_vtweg, "Distribution Channel
                    S_ERDAT FOR g_erdat ."Date on which the record was
    **********"created
    SELECTION-SCREEN END OF BLOCK B1 .
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETER: P_VARI LIKE DISVARIANT-VARIANT.  "Layout
    SELECTION-SCREEN END OF BLOCK B2.
    *&       INITIALIZATION EVENT
    INITIALIZATION.
      CLEAR GS_VARIANT.
    'gs_variant' must at least contain the report-id to allow
    saving a variant.
      G_REPID = SY-REPID.
    § 2.At least field REPORT of this structure has to be filled!
      GS_VARIANT-REPORT = G_REPID.
    § 3.Determine saving options.
      X_SAVE = 'A'.   "The user may save all types of variants
    *******Validating selection-screen values**********************
    getting F4 value for display variant field
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
      PERFORM F4_FOR_VARIANT.
    ****validation of F4 value of display variant
    AT SELECTION-SCREEN.
      PERFORM PAI_OF_SELECTION_SCREEN.
    *&      Start-Of-Selection
    START-OF-SELECTION.
    *****Subroutine to  select Plant from T320
      PERFORM FIND_PLANT .
    *****Subroutine to select Order Quantity from VBAP
      PERFORM ORDER_QUANTITY .
    *****Subroutine to select Transfer Order Quantity from LTAK and LTAP
      PERFORM TRANSFER_ORDER_QUANTITY.
    *****Subroutine to select TDelivery Quantity from  LIKP and LIPS
      PERFORM DELIVERY_QUANTITY.
    *&      End-Of-Selection
    END-OF-SELECTION.
    *****Subroutine for Fieldcatalog
      PERFORM FIELDCATALOG .
    *****Subroutine for Final Output
      PERFORM DISPLAY_OUTPUT .
    *&     Subroutine Implementaion
    *&      Form  FIND_PLANT
          text
    -->  p1        text
    <--  p2        text
    FORM FIND_PLANT .
      SELECT  WERKS
              LGNUM
              FROM T320
              INTO  TABLE T_T320
              WHERE LGNUM IN S_LGNUM.
    ENDFORM.                    " FIND_PLANT
    *&      Form  order_quantity
          text
    -->  p1        text
    <--  p2        text
    FORM ORDER_QUANTITY .
      SELECT VK~VBELN
             VK~VTWEG
             VP~WERKS
             VP~KWMENG
             VP~VSTEL
             INTO TABLE T_VBAK FROM VBAK AS VK
             INNER JOIN  VBAP AS VP
             ON VKVBELN = VPVBELN
             FOR ALL ENTRIES IN T_T320
             WHERE VK~VTWEG IN S_VTWEG
             AND   VK~ERDAT IN S_ERDAT
             AND   VP~WERKS = T_T320-WERKS.
    ENDFORM.                    " order_quantity
    *&      Form  Transfer_order_quantity
          text
    -->  p1        text
    <--  p2        text
    FORM TRANSFER_ORDER_QUANTITY .
      SELECT LK~LGNUM
             LK~TANUM
             LP~VISTA
             INTO TABLE T_LTAK FROM LTAK AS LK
             INNER JOIN LTAP AS LP
             ON LKLGNUM = LPLGNUM
             WHERE LK~KQUIT = 'X'
             AND   LK~BDATU IN S_ERDAT
             AND   LK~LGNUM IN S_LGNUM.
    ENDFORM.                    " Transfer_order_quantity
    *&      Form  Delivery_QUANTITY
          text
    -->  p1        text
    <--  p2        text
    FORM DELIVERY_QUANTITY .
      SELECT  VBELN WERKS LFIMG FROM LIPS
              INTO TABLE T_LIKP
              FOR ALL ENTRIES IN T_T320
              WHERE WERKS = T_T320-WERKS
              AND ERDAT IN S_ERDAT
              AND VTWEG IN S_VTWEG.
    ENDFORM.                    " Delivery_QUANTITY
    *&      Form  fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCATALOG .
      W_FCAT-COL_POS       = '1' .
      W_FCAT-FIELDNAME     = 'LGNUM' .
      W_FCAT-REF_TABNAME   = 'T320'.
      W_FCAT-REF_FIELDNAME = 'LGNUM' .
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS       = '2' .
      W_FCAT-FIELDNAME     = 'VTWEG' .
      W_FCAT-REF_TABNAME   = 'VBAK'.
      W_FCAT-REF_FIELDNAME = 'VTWEG' .
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS       = '3' .
      W_FCAT-FIELDNAME     = 'KWMENG' .
      W_FCAT-REF_TABNAME   = 'VBAP'.
      W_FCAT-REF_FIELDNAME = 'KWMENG' .
    *w_fcat-seltext_m     = '# of Orders'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS       = '4' .
      W_FCAT-FIELDNAME     = 'VISTA' .
      W_FCAT-REF_TABNAME   = 'LTAP'.
      W_FCAT-REF_FIELDNAME = 'VISTA' .
    *w_fcat-seltext_m     = '# of Pcs Picked'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
      W_FCAT-COL_POS       = '5' .
      W_FCAT-FIELDNAME     = 'LFIMG' .
      W_FCAT-REF_TABNAME   = 'LIPS'.
      W_FCAT-REF_FIELDNAME = 'LFIMG' .
    *w_fcat-seltext_m     = '# of Pcs Shipped'.
      APPEND W_FCAT TO T_FCAT.
      CLEAR W_FCAT.
    W_FCAT-COL_POS       = '6' .
    W_FCAT-FIELDNAME     = 'TANUM' .
    W_FCAT-REF_TABNAME   = 'LTAK'.
    W_FCAT-REF_FIELDNAME = 'TANUM' .
    **w_fcat-seltext_m     = '# of Pcs Shipped'.
    APPEND W_FCAT TO T_FCAT.
    CLEAR W_FCAT.
    W_FCAT-COL_POS       = '7' .
    W_FCAT-FIELDNAME     = 'WERKS' .
    W_FCAT-REF_TABNAME   = 'T320'.
    W_FCAT-REF_FIELDNAME = 'WERKS' .
    **w_fcat-seltext_m     = '# of Pcs Shipped'.
    APPEND W_FCAT TO T_FCAT.
    CLEAR W_FCAT.
    ENDFORM.                    " fieldcatalog
    *&      Form  display_output
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_OUTPUT .
      LOOP AT T_T320 INTO TY_T320.
        TY_ITAB-WERKS = TY_T320-WERKS.
        TY_ITAB-LGNUM = TY_T320-LGNUM.
        READ TABLE T_VBAK INTO TY_VBAK WITH KEY WERKS = TY_T320-WERKS.
        IF SY-SUBRC = 0.
        TY_ITAB-VBELN  = TY_VBAK-VBELN.
        TY_ITAB-VTWEG  = TY_VBAK-VTWEG.
        TY_ITAB-KWMENG = TY_VBAK-KWMENG + ty_itab-kwmeng.
        ENDIF.
        READ TABLE T_LTAK INTO TY_LTAK WITH KEY LGNUM = TY_T320-LGNUM.
        IF SY-SUBRC = 0.
        TY_ITAB-TANUM = TY_LTAK-TANUM.
        TY_ITAB-VISTA = TY_LTAK-VISTA + ty_itab-vista.
        ENDIF.
        READ TABLE T_LIKP INTO TY_LIKP WITH KEY WERKS = TY_T320-WERKS.
        IF SY-SUBRC = 0.
        TY_ITAB-LFIMG = TY_LIKP-LFIMG + ty_itab-lfimg.
        ENDIF.
        APPEND TY_ITAB TO T_ITAB.
      ENDLOOP.
    Function Module for Displaying Final Output ********
      W_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = SY-CPROG
          IS_LAYOUT          = W_LAYOUT
          IT_FIELDCAT        = T_FCAT[]
        TABLES
          T_OUTTAB           = T_ITAB.
    ENDFORM.                    " display_output
    *&      Form  f4_for_variant
          text
    -->  p1        text
    <--  p2        text
    FORM F4_FOR_VARIANT .
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          IS_VARIANT = GS_VARIANT
          I_SAVE     = X_SAVE
        IMPORTING
          E_EXIT     = G_EXIT
          ES_VARIANT = GX_VARIANT
        EXCEPTIONS
          NOT_FOUND  = 2.
      IF SY-SUBRC = 2.
        MESSAGE ID SY-MSGID TYPE 'S'      NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        IF G_EXIT = SPACE.
          P_VARI = GX_VARIANT-VARIANT.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f4_for_variant
    *&      Form  pai_of_selection_screen
          text
    -->  p1        text
    <--  p2        text
    FORM PAI_OF_SELECTION_SCREEN .
      IF NOT P_VARI IS INITIAL.
        MOVE GS_VARIANT TO GX_VARIANT.
        MOVE P_VARI TO GX_VARIANT-VARIANT.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            I_SAVE     = X_SAVE
          CHANGING
            CS_VARIANT = GX_VARIANT.
        GS_VARIANT = GX_VARIANT.
      ELSE.
        PERFORM VARIANT_INIT.
      ENDIF.
    ENDFORM.                    " pai_of_selection_screen
    *&      Form  variant_init
          text
    -->  p1        text
    <--  p2        text
    FORM VARIANT_INIT .
      CLEAR GS_VARIANT.
      GS_VARIANT-REPORT = G_REPID.
    ENDFORM.                    " variant_init

Maybe you are looking for