Dynamic Logic for a report:  User Maintained Logic

Hi All,
I've come across a requirement that needs to build a report.
However, the set of definitions defined for the report output might change over time.
Now every time the Definitions change, the User might have to request the change in the report through a development.
Is there a way, where the Users can maintain certain set of rules and which can be maintained easily, but also allow the report to dynamically pick up the logic that it needs to process the data to the required output layout.
To explain a little more in detail;
Data from ZTABLEA is reported out by issuing each line with a BucketID.
The report will aggregate the data to each Bucket Levels in output.
But, The Logic for issuing the ZTABLEA line with a BucketID can change over time.
So, a ZTABLEA line which was issued a BucketID_1 initially when FIELD1 of ZTABLEA = A,
can later be assigned to another BucketID when FIELD1 of ZTABLEA = A.
And this assignment needs to be maintained by the Users.
Some of these Logics can be complex in the sense that they Could span over several Fields for a condition.
Please advice. Any and all suggestions are highly appreciated.
Thanks,
RK.
Edited by: RK on Jul 17, 2008 7:16 PM

Following in from what Kev said.
There's dynamic SQL available  (which you should put in a TRY...CATCH....ENDTRY block), so they can effectively define a WHERE condition, which would be stored in your table.
I'd suggest that you have a check when they save the new logic, that the where clause is valid.
If you need some kind of other dynamic abap look at GENERATE, READ REPORT and other associated keywords in the ABAP help.
matt

Similar Messages

  • Need to execute Dynamic query for the report

    I was wondering if we can have the option of choosing at runtime from the report builder parameter so that if the end-user selects 'Yes' then the report will run one specific query and if he chooses 'No' then another particular query is invoked. What I mean to say that by choosing between Yes and No at runtime one should have the option of returning query results based on the same table but having different columns selected via the SELECT statement
    means we have two querires on our report & upon the chosen parameter we should execute only one of them ... wht should i do to apply tht ???

    As the previous post noted lexicals are a terrific way to accomplish dynamic queries in Oracle reports.
    Another way you could accomplish this would be to use a UNION, whereas the first select in the UNION represents one user option, then second query represents the second option.
    For example:
    SELECT customer_name name, customer_address address
    FROM customer_table
    WHERE :p_choice = 'Customer Info'
    UNION
    SELECT employee_name name, employee_address address
    FROM employee_table
    WHERE :p_choice = 'Employee Info'If when running the report, the user chooses 'Customer Info' the first query would return results, if the user chose 'Employee Info' then just information from the second query would return information.
    So there are different ways to accomplish what you are looking for, you just need to find which is going to work best for you.
    Hope this helps!

  • Dynamic Query for a report

    Hi,
    I have to generate a report which contains a query with database link. This database link is not hard coded and would be picked up from another report which contans a link to this report. So this database link value for the query could be any. Can anyone guide me hot to write a dynamic select statement so that i could append database link value at run time.
    Thanks
    Salman

    Hi,
    You can not directly use a PL/SQL query to create an Interactive Report - that is not yet available.
    What you could do is create a collection from your query and then use that for the report. Have a look at: [http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/advnc.htm#BABGHJFD].
    In there, you will see APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY - this allows you to create a collection from a string. You could add a PL/SQL process to your page that runs "On Load: Before Header" that actually creates the collection. Something like:
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS('MYCOLLECTIONNAME') THEN
      APEX_COLLECTION.DELETE_COLLECTION('MYCOLLECTIONNAME');
    END IF;
    APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING');
    END;Your Interactive Report can then be based on:
    SELECT SEQ_ID, C001, C002, C003, ...
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MYCOLLECTIONNAME'The tricky part is the headings as these would tend to be the SEQ_ID, C001, C002, C003, etc column names from the collection itself.
    To get around this, make sure that the report's sql statement includes as many Cnnn columns as you will need for the widest of the reports. Before doing anything else, run the report once to make sure that all these columns are included in the output.
    Then, through Shared Components, Application Items, create items that will hold heading names - for example, G_HEADING1, G_HEADING2 etc - one for each possibile column.
    Now, update the process to:
    BEGIN
    IF APEX_COLLECTION.COLLECTION_EXISTS('MYCOLLECTIONNAME') THEN
      APEX_COLLECTION.DELETE_COLLECTION('MYCOLLECTIONNAME');
    END IF;
    IF ..test1.. THEN
      APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING 1');
      :G_HEADING1 := 'ColumnHeading1Value';
      :G_HEADING2 := 'ColumnHeading2Value';
      :G_HEADING3 := NULL; -- column not used for this query, so set it to null
    ELSIF ..test2 .. THEN
      APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY('MYCOLLECTIONNAME','MY SQL QUERY STRING 2');
      :G_HEADING1 := 'ColumnHeading1Value';
      :G_HEADING2 := 'ColumnHeading2Value';
      :G_HEADING3 := 'ColumnHeading3Value';
    ELSIF ...etc...
      .. etc ...
    END IF;
    END;Finally, on the report itself, set the column headings to *&G_HEADING1.*, *&G_HEADING2.* etc. Then, on each column, set a Condition of "Value of Item in Expression 1 is NOT NULL" and in Expression 1, enter in the application item for that column - eg, G_HEADING1
    I have done all that here: [http://apex.oracle.com/pls/otn/f?p=16338:5] - select either Departments or Employees from the list and the report will change.
    Andy

  • Exchange 2010 SP3 Create Dynamic DL for Direct Reports

    I am not sure this is possible but if there is a will there is a way I guess.
    System: Exchange 2010 SP3 on Windows Server 2008 R2
    I am trying to see if there is a way to create dynamic DLs for Manager(s) direct reports.
    Example: Manager has 5 people that report directly to them, is there a way to make an dynamic email distribution list that will poll the direct reports as people leave or hired.
    I know I can create one manually but some depts. may have high turnover rates which increase overhead so I am just trying to simplify the process. I of course googled my question but not getting the results I intended.
    Thanks. 

    hi,
    as from above  i understand you are asking about creating an custom attribute and then referencing them .. if yes please check below command
    Get-Mailbox -OrganizationalUnit Sales | Set-Mailbox CustomAttribute1 "SalesOU"Now you can create an e-mail address policy for all recipients that have the CustomAttribute1 property that equals SalesOU, as shown in this example.
    New-EmailAddressPolicy -Name "Sales" -RecipientFilter { CustomAttribute1 -eq "SalesOU"} -EnabledEmailAddressTemplates "SMTP:%s%[email protected] check this.. http://technet.microsoft.com/en-us/library/ee423541%28v=exchg.150%29.aspx
    MARK AS USEFUL/ANSWER IF IT DID
    Thanks
    Happiness Always
    Jatin

  • Dynamic Title for Interactive Report?

    I have an interactive report where I am passing in interative report filters. This is great becase it allows me to reuse a single interactive report in different ways. However, one drawback I am running into is the report title. I'd really like to be able to change the report title based on the filters that I pass in. Is this possible? Can the report title be dynamic?
    Thanks,
    Andrew Watson

    It,s possible.
    I'm using item references to alter the report title.
    Set the item value to the title that you want for your report and the region name as the example.
    Example: Report &P1_ITEM. &P1_ITEM1. &P1_ITEM2. and so far.

  • Generating dynamic columns for a report

    Hi all,
          Can anybody pls. tell me how to output dynamic columns in a report. my req. is that i've to generate so many columns as there are no. of unique(a particular field value) rows in my internal table. for e.g say suppose i've 5 rows in my internal table which has 2 fields, one short text & it's corresponding value. so now my report output shud have 5 columns with the short text as the column heading & the their corresponding values below each column heading. i heard it can be done thru field-symbols. can anyone pls. guide me.

    Hi Sushma,
    This piece of code might be useful.
    The following sections will help you to understand the steps required to define a Dynamic ALV.
    Following symbol signifies:
    Þ                    Important
    Main Steps Required
    The following are the main steps that are to be performed for defining a dynamic Alv
    1.       Defining a field catalog
    2.       Defining the dynamic table
    3.       Filling data into the table
    4.       Displaying ALV list
    Defining a field catalog
    The purpose of defining a field catalog first in case of Dynamic ALV is somewhat different than in case of normal ALV. In case of Dynamic ALV the field catalog is used to define the final internal table that will hold the data, and would be used to display the final output.
    Þ It is very important to remember that the field catalog table be refreshed first, else it might give an error.
    For example:
    DATA: T_FIELDCAT TYPE LVC_T_FCAT,
    L_FIELDCAT TYPE LVC_S_FCAT.
       Refresh T_FIELDCAT.
      CLEAR L_FIELDCAT.
      L_FIELDCAT-FIELDNAME = 'LIFNR'.
      L_FIELDCAT-INTTYPE = ''.
      L_FIELDCAT-OUTPUTLEN  = 10.
      L_FIELDCAT-COLTEXT  = TEXT-002.
      APPEND L_FIELDCAT TO T_FIELDCAT.
    Defining the dynamic table.
    This table will hold the final data that needs to be displayed. To declare the table the following things need to be done.
    Declare a field symbol
    Displaying Alv List
    This is done in the same way as we do for normal Alv. Call function “REUSE_ALV_GRID_DISPLAY” and pass the field catalog table in the export parameters and the dynamic table in Tables.
    Reward Points if it is helpful.
    Reagrds,
    Kiran I

  • Value of Infocube and ODS Line Item for a Reporting User.

    Hi,
    I want to give authorizatoin to a reporting user for InfoCube as well as ODS Line Item . I tried give values of InfoCube as well as value of ODS Line Item in Auth. Object "S_RS_COMP" in the field of Infocube. But it only accepts the value of Infocube. Then where shall I specify the value of ODS Object.
    Please guide
    Sam

    Hi Suneel,
    Thanks for your reply.
    Do you mean to say the check box in RSA1->EDit ODS Object->Settings->BEx Reporting ?
    If you  mean the same one, then it is already checked. But still am not getting the ODS Names in Infocube field of S_RS_COMP.
    Regards,
    Sam

  • Dynamic SQL for creating report in portal

    Has anyone had to create report in Portal using dynamic sql. That is you build up the query commands depending on the parameters entered by the user.
    E.g the columns displayed will be what the users has selected in the parameter form.
    Urgent reply please,
    Femi

    Hi,
    You can use SQL based reports to do this. The report should have a bind variable. The bind variable is used for the users to enter their values and query is built using the value in the bind variable. The user should enter the value of the bind variable from the customization screen.
    Here is an example
    select * from scott.emp
    where deptno = :vdept
    Here vdept appears in the customization screen and user should enter a value for this and run the report.
    Thanks,
    Sharmila

  • Dynamic name for a report

    Hi,
    I have a report query that print the emplyee report
    I use BI publisher.
    The report query name attribute is : employee.
    This name is static, in other word for each employee i get the same name (employee.pdf).
    But i want that the name of the report will be dynamic.
    for example if i have to print the jhon report i get jhon.pdf
    for david i get david.pdf
    My question is: is it possible?
    If yes how can I do that
    Thanks,
    Abdo

    Hi,
    Assuming that your link is just part of the page somewhere, then you could create a hidden page item that has the desired name in it (typically populated by a computation or process that runs Before Header). You should then be able to use:
    f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=&P1_EMPLOYEENAME.Where P1_EMPLOYEENAME is the hidden page item name.
    Andy

  • Dynamic name for attachment in User Decision

    Hi...
    I have a requirement wherein the name of the attachment in the user decision has to be populated dynamically. I am using the same BO method for user decision but is triggering 2 different objects. Please advice on how to achieve this.
    Scenario - I am using BUS2081 for Invoice and for Credit Memo. If the credit memo is created, the approver has to see the name of the attachment as Credit Memo xxxx and if an invoice is created, he has to see the attachment as Invoice xxxx. As standard, whatever object is created, the attachment name is Incoming Invoice xxxx (name of the BO Object Bus2081).
    Warm Regards,
    Jubish Jacob

    The object name is static but the default attribute can be changed (use a z-subobject and delegate back) so you can do something like this: instead of: incoming invoice(object name) 12345(invoice number - default attribute) you will have document(new object name) incoming invoice/credit memo 12345(document type & number concatenated - a new default attribute)
    Another option - I think credit memos have an object (BUS2094) or you can create one - in the task have both object types in the container, when its a credit memo transfer only the credit object when it's an invoice transfer only the invoice object.

  • Regarding Multi Language support for Z-Report

    Hi Expert,
    I have requirement of supporting multi language for Z- report.
    My existing system default client language is EN. Now I have to use Z-Report in other language like DE (German), ES (Spanish) ._But when I tried to execute Z-report in Other Language.In Parameter screen it shows system fields (those I have defined in parameters fields variable) not a text field name._
    If anybody have experience pl. explode how to resolve the problem.
    thanks in advance and for solution I will give u full points.
    Regards

    Hi,
    U have to maintain translations for the text elements and selection texts u created while creating the report. do like this.
    Open ur report text elements in change mode.
    Menu->goto->Translation* Here give the source language as EN and  target language as DE(German) and press enter. It will show all selection screen elements and text elements. Here give the translated text in corrosponding language if have the one else u can simply give the english text itself. After filling all the elements just press save. Now u will get a success/status message
    100% matches on all texts. U have to repeat this process for all the languages u want.
    After this log in to ur other languages(other than EN) and check. What ever u maintained there those will appear here.
    For standard reports/user exits u have to use transaction SE63 for maintaining translations.
    Thanks,
    Vinod.

  • Dynamic Variants for RSEXARCA

    Dear All,
    Please let me know how to create Dynamic Variant for
    the report RSEXARCA.
    Kindly let me know the procedure.
    Regards,
    KCR.

    Hi,
      Use this function Module  : RS_VARIANT_ADD
    U can even get list of Variant Related function module
    like RS_VARIANT_CHANGE.
    Just go se37 enter RS_VARIANT* and press F4.
    One Ex.
    U can use RS_VARIANT_CONTENTS for find out the values for the varient fields.
    U can use RS_VARIANT_ATTR_SAVE to save changes to the variants
    Mark the Helpfull answers & close the thread.
    Regards
    Manoj
    Message was edited by: Manoj Gupta

  • How to extend dynamic selection for Logical Database PNPCE

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

  • Selection screen for HR report with logical database PNP

    Hi All,
       I am writing a HR report. And I use the logical database PNP. Also I create a HR report category for this report. In the report category, I can define the selection screen field. But all these fields are selection option format. My question is How can I add parameters, radiobutton group and checkbox in the selection screen. Thanks.
    Alex

    Hi Alex,
    Sorry for replying so late. Please try this tutorial:
    w w w. s a p t e c h n i c a l. c o m -> tutorials -> ABAP-HR -> Creating HR Report category in PNP logical database
    Sorry, I put it like this, because direct link doens't let me post the answer. Don't know why.
    It can also be something with your custom code in selection screen. Though it works fine for, try to remove COMMENTs and observe the result. Maybe parameters are overlapping somehow. First try this:
    SELECTION-SCREEN begin of BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS RefDate type DATS.
    parameter BFlag type c RADIOBUTTON GROUP grp1.
    PARAMETER FFlag type c RADIOBUTTON GROUP grp1.
    parameters days type i.
    PARAMETERS spvsr like PA0001-MSTBR.
    selection-SCREEN end of BLOCK blk2.
    If that works together with the report category, try to extend it with adding a selection-screen comment, but do this in reversed order (comment goes first and FOR FIELD addition is supplied) like this:
    SELECTION-SCREEN begin of BLOCK blk2 WITH FRAME TITLE text-002.
    PARAMETERS RefDate type DATS.
    SELECTION-SCREEN begin of line.
    SELECTION-SCREEN COMMENT 3(10) text-003 for field bflag.  "FOR FIELD, and goes first
    parameter BFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN COMMENT 16(10) text-004 for FIELD fflag.  "here two
    PARAMETER FFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN end of line.
    parameters days type i.
    PARAMETERS spvsr like PA0001-MSTBR.
    selection-SCREEN end of BLOCK blk2.
    If still not working, see if text-003 and text-004 are not too long (you expect them to be 10 chars), This may somehow affect selection screen.
    You may also try with setting cursor position explicity by:
    SELECTION-SCREEN begin of line.
    SELECTION-SCREEN POSITION 3.
    SELECTION-SCREEN COMMENT (10) text-003 for field bflag. 
    parameter BFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN POSITION 16.
    SELECTION-SCREEN COMMENT (10) text-004 for FIELD fflag.  "here two
    PARAMETER FFlag type c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN end of line.
    It is really hard to identify where can be a bug as it is working fine for me. Keep trying with different variations, it should finally run with some.
    Regards
    Marcin

  • Define Logical Systems and Template Names for BW Reports

    Hi experts
    I would like to know if someone used the mentioned functionality 'Define Logical Systems and Template Names for BW Reports, I would like to know too IF I create a Z REPORT for example in webdynpro and insert it in this configuration it will work and where it will appear in sourcing cockpit?
    sds.
    Javier

    Hello Muthu,
    BW reports will be shown in SRM Box if the corresponding BW roles for SRM are integrated with SRM roles.
    You might to activate the corresponding datasource of this in SRM.
    And since you have to connect the source system to BW, I think you have to define SRM system as logical system in BW.
    Regards,
    Pavan

Maybe you are looking for

  • New Creative Zen Micro Is

    This is another one of the Zen Micro Issues. So I'm fully excited to get my new mp3 player. I got two batteries with my micro so that was a plus. I toss in a battery and setup the software on the PC. I fully installed everything then plugged in the z

  • The new Nano does not hold it's place in a song.

    New software came out today but this problem has not been fixed. This is what happens if I stop the Nano in mid-song (or movement) and wait perhaps more than half an hour to resume. I press play and see where I was in the song that was playing. The s

  • Flash not working in Firefox at all

    I'm running Firefox 16.0.2. Any pages with Flash tell me that I need to install the missing plugin. I've tried re-downloading the latest Flash Player a few times, uninstalling it from my laptop entirely, reinstalling, etc. and nothing has worked. I'v

  • Bluetooth audio problem

    I have 3 Bluetooth headsets.  They used to all work, but now they still connect and show they are connected, but I cannot speak or hear through any of them.  They have the contacts downloaded and I can answe call and hang up calls from them, but I he

  • Video streaming faster on 3G than WIFI?

    I've noticed that when watching Youtube or QT streams that they are much faster to load on the cell networks than on WIFI. Correct me if I'm wrong but it looks like the iPhone streams a higher quality video when connected to the WIFI? This is all goo