Pass Component Name to Generic "Condition" w/o hardcoding it

Hi, thanks in advance for your help.
I'd like to create a generic PL/SQL "Condition" statement which references the Component Name of the component executing the Condition - without hardcoding the component name in the query. In other words, a statement which I could plug in to any component's Condition clause without hardcoding the name for each component. Is there a Substitution String, application variable or some other mechanism I can grab which has this value?
What say ye Oracle... Can I get there from here?

I'm not sure it does require an enhancement request, since I'm pretty sure you could code that using authorizations right now.
For example, assuming that you have different levels of users (e.g. level 1, level 2, level 3 etc), where -
Level 3 is the lowest level
Level 2 can do everything level 3 can do, plus a bit more
Level 1 can do everything level 2 can do, plus a bit more
Then you could define a table mapping users to levels (e.g. "Joe" is level 2).
Then in your Application you create authorization levels for Level 1, Level 2, Level 3 etc (i.e. you're specifying that a user must be at least Level 2 to see this item etc).
You create a new item and assign it an authorization level of 'Level 2', therefore only users who are Level 2 and above will be able to see the item.
Obviously I've missed out a huge chunk of the implementation here ;)

Similar Messages

  • Can I verify a field-symbol using its component name?

    Hello experts,
    I am looping at my field-symbol and I need to know what are its component name.
    I need to create an IF or CASE statement checking whether the field-symbol's
    component name is equal to that of the value that I declared. I want to do
    something like this:
    LOOP AT <fs_dyntable> ASSIGNING <wa_dyntable>.
    ASSIGN COMPONENT sy-index OF STRUCTURE <wa_dyntable>
            TO <component>.
            IF sy-subrc <> 0.
              EXIT.
            ENDIF.
    if component name = '2000'.
        condition...
      elseif component name = '1999'.
        condition...
      elseif component name = '1998'.
        condition...
      endif.
    endloop.
    Again, thank you guys and take care!

    Hi,
    I am not clear on your doubt , but you can use field-symbol fields like below:
    * if <component>-fld1 = '2000'.
    condition...
    elseif <component>-fld1 = '1999'.
    condition...
    elseif <component>-fld1 = '1998'.
    condition...
    endif.
    endloop.
    LOOP AT x_table ASSIGNING <wa_table>.
    IF <wa_table>-fld1 EQ 100.
    -----your code
    ENDIF.
    ENDLOOP.
    Regards
    Appana

  • Passing the column name on Where condition based on input parameter

    Hi,
    I am using Oracle10g. Following are my table schema.
    Table Name : Codes
    Columns( ID, Level0, Level1,Level2)
    View Name : SampleView
    I have a scenario : A parameter will be passed to my view from C# application. I need to cut the last 4 places of the parameter and need to check 4 conditions as follows :
    1. IF last 4 places of parameter contains the value as "AMPD" then pass level0 column on where condition.
    Sample code : A123XPAMPD
    Expeted Result: Select * from Codes where Level0 ='A123XPAMPD'
    2. IF last 4 places of parameter contains the value as "Alpha numeric" then pass level1 column on where condition.
    Sample code : A123XPAA00
    Expeted Result: Select * from Codes where Level1 ='A123XPAA00'
    3. IF last 4 places of parameter contains the value as 0000 then pass level1 column on where condition.
    Sample code : A123XP0000
    Expeted Result: Select * from Codes where Level1 ='A123XP0000'
    4. IF last 4 places of parameter contains the value as (cannot be all 0's) and cannot contain "Alphabets" then pass level2 column on where condition.
    Sample code : A123XP1001
    Expeted Result: Select * from Codes where Level2 ='A123XP1001'
    Could any one please help me on writing this logic inside the view.
    Thanks in advance.

    Do you want to make sure that at least one alphabet and one number is there?
    select case
         when regexp_like('1111','^[a-zA-Z]+$') -"This says - Only alphabets, not even space
              THEN 'Alphabets'
         when regexp_like('1111','^[a-zA-Z0-9]*$') --"This says - Only alpha-numeric, not even space
          and regexp_like('1111','[a-zA-Z]') --"To make sure atleast one alphabet is there
          and regexp_like('1111','[0-9]') --"To make sure atleast one number is there
              THEN 'AlphaNumeric'
           else 'NULL' --"This is a string. Not actual NULL
          end
    from dual;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Passing TABLE NAME as parameter is possible or not?

    I want develop a small/simple report like this
    TABLE NAME :
    WHERE :
    ORDER BY :
    QUERY ROWS
    In the above model i want to pass all the three (TABLE NAME,WHERE and ORDER BY) as a parameter.
    My doubt, is that possible to pass TABLE NAME as a parameter? If so!
    When i enter any TABLE NAME it has to fetch me out the records of that table (Based on WHERE condition and ORDER BY).
    Is that possible to do?
    Need some help!
    Edited by: Muthukumar Seshadri on Aug 10, 2012 6:19 PM

    Yes, it is possible with lexical parameters. Look in the help for examples:
    SELECT Clause
    SELECT &P_ENAME NAME, &P_EMPNO ENO, &P_JOB ROLE  FROM EMP
    P_ENAME, P_EMPNO, and P_JOB can be used to change the columns selected at runtime.  For example, you could enter DEPTNO as the value for P_EMPNO on the Runtime Parameter Form. 
    Note that in this case, you should use aliases for your columns.  Otherwise, if you change the columns selected at runtime, the column names in the SELECT list will not match the Report Builder columns and the report will not run.
    FROM Clause
    SELECT ORDID, TOTAL FROM &ATABLE
    ATABLE can be used to change the table from which columns are selected at runtime.  For example, you could enter ORD for ATABLE at runtime. 
    If you dynamically change the table name in this way, you may also want to use lexical references for the SELECT clause (look at the previous example) in case the column names differ between tables.
    WHERE Clause
    SELECT ORDID, TOTAL FROM ORD WHERE &CUST
    ORDER BY Clause
    SELECT ORDID, SHIPDATE, ORDERDATE, TOTAL  FROM ORD ORDER BY &SORT You have to be really careful with this approach. Dynamic SQL may cause serious performance problems.
    Edited by: InoL on Aug 10, 2012 10:06 AM

  • Pass column-name as a parameter to reports

    Hello,
    the code below calls a report. But now I want to sort the rows in the report. For example I have a text-item in my form-modul. If I type a column-name and press the button then the rows should be sorted in the report. Is it possible tp pass column-names as parameter to reports?
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := find_report_object('STATIONSTOPOLOGIE');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracle-dev');
    -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no pdeptno='||:dept.deptno);
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    WEB.SHOW_DOCUMENT('http://oracle-dev:8888/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=rep_oracle-dev','_blank');
    ELSE
    message('Error when running report');
    END IF;
    END;

    Hi,
    the work has been done in reports. You can use a lexical parameter in reports to add a condition for sorting to the query like:
    select .. from .. where ... &p_order.
    Then add another parameter to the report (for example p_param). Fill p_param via your interface in forms (SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, ....) with the column name. Then build a report trigger like:
    if :p_param is null
    then
    :p_order:= null;
    else
    :p_order:= 'order by '||:p_param;
    end if;
    But have a look, that p_param can only get correct values.
    Rainer

  • Passing the name of a table to a procedure

    Can anyone tell me how you can pass the name of a table to a procedure ?
    I am trying to write a generic procedure that will have the table name and the fieldname passed to it :-
    as in :-
    Select Fieldname FROM Tablename;
    null

    Refere to the documentation of
    built in package dbms_sql.

  • How to get WD component name or application name

    Hi ,
    Is there any sap standard variable where webdynpro component name or application name get store like SY-CPORG.
    Thanks And Regards,
    Rohit

    Hi,
    You can get the application name using below code:
    DATA : lr_api      TYPE REF TO if_wd_component,
              lr_app      TYPE REF TO if_wd_application,
              lr_app_info TYPE REF TO if_wd_rr_application,
              lv_app_name TYPE string.
       lr_api = wd_comp_controller->wd_get_api( ).
       CALL METHOD lr_api->get_application
         RECEIVING
           result = lr_app.
       CALL METHOD lr_app->get_application_info
         RECEIVING
           result = lr_app_info.
       CALL METHOD lr_app_info->get_name
         RECEIVING
           result = lv_app_name.
    Now pass the lv_app_name to the FM.
    hope this helps u,
    Regards,
    Kiran

  • How to Concatenate Table name and Where condition at runtime

    I am passing parameter as User and Zone to Stored Procedure.How to concatenate Table Name
    and WHERE CONDITION in SQL Statement.i have different type of users and zones.

    Hi !
    declare
      cur sys_refcursor;
      r emp%rowtype;
      v_sql varchar2(512);
    begin
    -- do your logic here
      v_sql := 'select * from emp';
      open cur for v_sql;
      loop
        fetch cur into r;
        exit when cur%notfound;
        dbms_output.put_line(r.ename);
      end loop;
      close cur;
    end;In this example you can see how can be done this with cursor vars .. You should concatenate v_sql string according to your requirements.
    But as in further posts has already been mentioned , be carefull at publishing such kind of procedures and think on security.
    Also when you want dynamicaly change from clause , you should consider using different records to accept data ? Maybe all your tables has the same structure and then this problem will be smaller.
    T
    T

  • Pass controller name runtime

    Hi,
    I want to develope reusable FXML components. I want to pass controller name runtime to FXML, so that everyone can write down own controller and pass the attributes to FXML.
    e.g.
    I will have AnchorPane.FXML. Button should contain <fx:define> component for controller name
    So that
    <AnchorPane id="AnchorPane" xmlns:fx="http://javafx.com/fxml" fx:controller="*+_XXXXXXXXXX_+*" >
    This can be included in some XXX.FXML, but XXXXXXXXXX should be passed throgh <var name="controller" value="${controller}"/>, so that button properties like name,size can be passed using own controller.
    Is there any way I can do so?
    Thanks in advance.

    I want to develope reusable FXML components. I want to pass controller name runtime to FXML, so that everyone can write down own controller and pass the attributes to FXML.This isn't currently possible. However, in JavaFX 2.1, you can provide a custom controller factory implementation to FXMLLoader that will allow your application to manage the controller instantiation process. Maybe this will help you address your use case.
    XXXXXXXXXX should be passed throgh <var name="controller" value="${controller}"/>, so that button properties like name,size can be passed using own controller.From a pure design standpoint, the controller probably should not be sourcing values like name and size. Name should probably come from a resource bundle, and size should be defined by the view. The controller is primarily meant to manage the interaction between the model and the view, and respond to user input events fired by the view.

  • Want to find calling component name

    I have 2 components as below.
    component A : in component A have used component B and also embed view of component B in view containner in component A
    component B : have only layout for display data
    I'd like to know if i want to get the name of component A at the runtime in method of component B, How i can get it ?

    Hi,
    Pass the calling component name to the called component at the time of calling. Use the sample code below.
      DATA:w_url                TYPE string,
           w_value              TYPE string.
    *--  Get the URL of the called application
      CALL METHOD cl_wd_utilities=>construct_wd_url
        EXPORTING
          application_name = "called_application_name"
        IMPORTING
          out_absolute_url = w_url.
    **--  make the Value type compatible that has to be passed with the URL
      w_value = "Calling_component_name"
    Attach the parameters and its value with the URL that
    have to be passed to the 2nd application
      CALL METHOD cl_http_server=>append_field_url
        EXPORTING
          name  = 'VARIABLE_NAME'
          value = w_value
        CHANGING
          url   = w_url.nerate a popup window for the 2nd application with the above URL
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component  TYPE REF TO if_wd_component.
      DATA lo_window         TYPE REF TO if_wd_window.
      lo_api_component  = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
      lo_window         = lo_window_manager->create_external_window(
                       url = w_url ).
      lo_window->open( ).
    And in the called application window handledefault you can retrieve the calling component name.
    In the window handedefault of called component make the VARIABLE_NAME as importing paramater, so that you will the varibale_name value in the handledefault code.
    Revert for any queries.
    Regards,
    Simi A M

  • Api required to return componant name ?

    Is there an API call to return the name of the current form based on a store procedure that you are executing
    I want to pass the name of the current form based on a stored procedure as a param to another componant.
    Thanks in anticipation
    SD.

    Jaya,
    There is now to access navigation rules from faces-config with JSF 1.x. With JSF 2.0, you could check whether FacesContext.getApplication().getNavigationHandler() returns ConfigurableNavigationHandler, and if it does, call getNavigationCase() on it.
    However, even with JSF 2.0, you should be calling these APIs from within JSF lifecycle, and not from a filter.
    Why do you have to perform navigation in a filter? If you are doing a redirect after authentication, you should be redirecting to the original (pre-login) URL.
    Hope this helps,
    Max Starets

  • BP Fact sheet: how to translate component name?

    Hello
    At my customer BP fact sheet is custimized to include a custom component. The component name is Z-custom and the description in english is "custom". If I log on to the web UI in english I can see the title on the windo "custom". But if I log on in other languages it is empty.
    This is because there was no translation to the component name before. I added the translations in SPRO - Maintain Fact Sheet but still nothing is shown in the web UI. I also checked BSP_WD_CMPWB but found no place for translation.
    Can anyone help? It must be something really quick ans stupid !!
    Sotiris
    Edited by: Sotiris Hatzis on Jul 6, 2011 12:26 PM

    Actually I also made some other changes in transaction BSP_WD_CMPWB (like titles of columns) but these changes are not shown either onthe Web UI.
    Do I need to activate something, or run something?
    Sotiris

  • Execute immediate with using clause to pass column name dynamically

    Hai,
    Is there any way using execute immeidate to pass the column name dynamically. I used to pass the column value as dynamic with the help of "Using clause" . But if i use to pass column name, it is giving numberic error at run time. Eg,. for testing has been given below.
    1. Column value as dynamic, which is working correctly.
    create or replace function testexeimm (acctnum char)
    return number as
    acctbal number;
    begin
    execute immediate 'select balance from acct_master where acct_no=:a' into acctbal using acctnum;
    return acctbal;
    end;
    2. Column name as dynamic which is not working
    create or replace function testexeimm (colnam char)
    return char as
    acctbal char;
    begin
    execute immediate 'select :a from ch_acct_mast where rownum=1' into acctbal using colnam;
    return acctbal;
    end;
    Any help in this regard will be highly appericated.
    Regards
    Sridhar

    So the variable has to be numeric too:
    create or replace function testexeimm (colnam char)
    return number as
    acctbal number;
    begin
    execute immediate 'select '|||colnam||' from ch_acct_mast where rownum=1' into acctbal;
    return acctbal;
    end;Max
    http://oracleitalia.wordpress.com

  • How to pass sicf name as a parameter frm webdynpro

    Hi All,
    I have created a properties file in which i hv provided the following path: servername:port n path to open the SAP R/3 easy access but i want to pass sicf name so it directly opens it in portal.   Please provide me some assistance. Thankyou.
    Regards,
    Jaspreet Kaur
    Edited by: Jaspreet Kaur on Dec 29, 2008 11:56 AM

    Hi Jaspreet,
    You can create an IAC iview with your service.
    Hope this helps,
    Ivá

  • Pass table name as a parameter to function

    Is there a way to pass table name as a parameter to functions? Then update the table in the function.
    Thanks a lot.
    Jiaxin

    Hi, Harm,
    Thank you very much for your suggestion and example. But to get my program work, i need to realise code like follows:
    CREATE OR REPLACE FUNCTION delstu_func(stuno char) RETURN NUMBER AS
    BEGIN
    EXECUTE IMMEDIATE 'DELETE FROM student s' ||
    'WHERE' || 's.student_number' || '=' || stuno;
    LOOP
    DBMS_OUTPUT.PUT_LINE('record deleted');
    END LOOP;
    END;
    SELECT delstu_func('s11') FROM STUDENT;
    The intention is to check if such a function can perform operations such as update, delete and insert on occurence of certain values. When executing the above statement, the system returns an error message:
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    ORA-06512: at "SCMJD1.DELSTU_FUNC", line 3
    Could you tell me where is wrong?
    Jiaxin

Maybe you are looking for

  • Low Disk Space in the installation drive

    Dear all, One of our test server, is running out of space in the installation drive. Do we have any standard jobs/Tcodes to reduce/shrink the disk space of installation drive. Please share your inputs, Regards, Younus

  • Reading decimal data into a string

    Hi, I am having an issue in converting the non char data like decimal into character.  Here is my code In the output I see '#' signs where I am supoose to get certain amount values in the decimal format. I require it because I need to download the da

  • Calendar on iPhone 3GS & iPad 3 is nog syncing with iCloud

    Since a few days I have problems with my iPhone 3GS & iPad 3 syncing calendar with iCloud. Everything else is syncing except for my calendars. On the iPad i see all previous events, but new events are not displayed. On my iPhone I can't see any calen

  • Flash Player Correct and Installed but not working

    Hi, I've got the 64bit Windows 8.1 and the version 15 of the flash player.  I've followed all the steps and can not access anything that requires a flash player.  I've checked I've got the latest update, I've enabled the shockwave thing and deactivat

  • XD02 and FD02- tax

    Hello SAP Gurus' I have a problem I hope you can help me with.  We use TAXWARE and when we input the exemption or resale number/ tax number via XD02, it changes for all co.codes???  We only want a change to the co.code we have entered and it appears