BPS: How to filter Lead Columns at run time

I need to know if there is a way to filter values for lead columns, after planning level and planning package where defined
Example:
Family | Material | Brand | Format | sales | cost | Margin
F1      M1         B1      F1       100     80     20
F1      M2         B1      F1        95     85     10
F1      M2         B1      F2       105     90     15
In this case the user wants to add 10% to sales and review how does it impact into margin, but he wants to apply it only to rows where Material is M1.
So, he needs to use some kind of filter data (like Excel functionality) to select only the rows corresponding to material M1.
After that, he wants to perform other filters over the other lead columns, and apply again some changes in the data columns.
Somebody can help me with this requirement?
Thanks in advance
Message was edited by: Pamela Valdivia

Hi Pamela,
First of all you would need a variable for Material with Replacement type user defined values to be able to restrict the data for Material M1 when the layout is executed.
For incrementing the sales by 10% you can create a Planning function which increases the sales amount by 10% and provide a button for the same in the User Planning Folder. You could also restrict the Planning function for Material M1 if you so desire.
The benefit of the Planning function is that you can always "Undo" the operation if you have not saved/performed a subsequent operation. So as long as the user is applying some changes and undoing the same before the second change step the data is as it is, and for what changes the user would like to simulate you can create a Planning function and provide the option in the Planning folder.
Hope it helps.
Cheers
Anurag

Similar Messages

  • Adding complex computed column at run-time fails in PB 12.6

    I support a large 'vintage' application that was originally written in the late 90's, and has been migrated from version to version over the years.  Currently I'm working to get it working in PB 12.6 Classic, build 3506, migrating it from PB 11.5
    The first issue I've come across is that PFC treeviews are not working properly.  After some debugging, I determined that the cause of the failure is the PFC code's creation of 'key' column in the datawindows being used to populate each level.
    In the pfc_u_tv.of_createkey function, it looks at the linkages between the levels of a treeviews data, and then crafts an expression, and then uses that to create a computed column, which is subsequently used to uniquely identify the data.
    The expression is a series of string concatenations, such as this:
    expression='String(ctg_cd) + "#$%" + String(app_cd) + "#$%" + String(app_cd) + "#$%" + String(win_id) + "#$%" + String(ctg_cd) + "#$%"'
    This expression is then used in a modify statement to create the new compute key column:
    ls_rc = ads_obj.Modify("create compute(band=detail x='0' y='0' " + &
      "height='0' width='0' name=pfc_tvi_key " + ls_Exp + ")")
    In earlier versions, this works, and when you do a getitemstring afterward you get a long concatenated value that PFC uses to uniquely identify treeview items.
    Such as 'a/r#$%plcy#$%plcy#$%w_m_plcy_fncl_tran#$%a/r#$%'
    However, in PB 12.6, only the first portion of the expression is processed.  There is no error returned from the Modify function, and the column is created, but the expression is only evaluating one part of the expression.  In this partiular case, it results in
    'plcy'
    I just noticed that this isn't the *first* item in the set of concatenated columns and string literals, which is interesting.  In any case, when the computed key values are not correct, the whole method PFC is using to populate and run the treeview falls apart, and you get all children under each parent, and selections on the treeview object do not work properly because the key column values are not unique.
    I can copy the expression value from a debugging session, and use that to create a computed column at design time, pasting the expression in, and naming it the same as the created column (pfv_tvi_key), and this then allows the treeview to work properly.  However, this is a very cumbersome and problematic workaround.  The application has a lot of treeviews, with a very large number of datawindows operating as all the different types of items on different levels of different trees.  I don't think it's a practical workaround, and future maintenance would be very difficult.
    bu the workaround still demonstrates it is not an issue with the syntax of the compute expression, just an issue with the way it is handled by PowerBuilder when a column is created at run time,vs. at design time.
    Has anyone else encountered this issue?  I would think there are a fair number of older apps still around that are using PFC treeviews.
    My next step will be to install PB 12.6 build 4011 and cross my fingers.  Other than that, perhaps try 12.5?

    Updating the PFC layers has started to lead down a rabbit hole of hundreds and hundreds of errors.
    Granted, many of these are probably rooted in a few ancestor issues.
    But I'm not sure this will lead to a solution.
    The problem lies in using a modify statement to create a computed column at run time containing an expression with multiple concatenated values.
    If I look at the pfc_u_tv.of_createkey function from the newer PFC version, I see the same code there:
    ls_rc = ads_obj.Modify("create compute(band=detail x='0' y='0' " + &
      "height='0' width='0' name=pfc_tvi_key " + ls_Exp + ")")
    And the same code above it which creates the expression used in the modify.
    So after doing all the patching for the new PFC version, I somehow suspect I'll still be facing the same datastore.modify problem.
    Not to say that isn't a good thing to do, just not sure it addresses the root of the problem.

  • How to create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • Is it possible to create a column in run time?

    Hi,
    I created a application that connect with Access database. I just wonder is it possible for user to create a column in run time, because the application need this kind of interaction.
    Many thanks,
    Ann

    Code that does it is here:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=453846&tstart=0&trange=15
    MOD

  • How to call abap proxy at run time?

    hello frnds,
    i m working on a scenario in which whenever Invoice is saved in SAP R/3 at that time same data should go to Oracle DB. i m using ABAP proxy on SAP R/3 side and JDBC receicver adapter on oracle side of XI.
    so to post data i need to call ABAP Proxy whenever invoice is saved.. i have tried to find out save event for invoice but not able to get... can anybody tell me the solution that how i can call proxy at run time?
    thanx in advance.
    Regards,
    Hetal.....

    Hi Audumbar,
    Check these ...
    /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    /people/vanita.thareja2/blog/2006/05/23/bpm-sending-message-asynchronously-and-getting-the-response-from-synchronous-system-using-abap-proxies
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • How to Refresh System Form in Run Time

    Dear All,
    Please give me idea for Refresh System Document in Run Time using DI,basically I am using  system columns for update for some scenarios.
    So please give solution that how should refresh system form.
    Thanks a lot.
    Ashish Singh.

    Hi,
    Please post above discussion in SDK forum.
    Thanks & Regards,
    Nagarajan

  • How to choose RT System at Run Time

    Variations of this question have been asked, but I'm not sure if they've been answered.
    We use LabVIEW RT to do a variety of behavior tests.  We have multiple experimenters using the same hardware, and each has his/her own set of "What I want to do" requirements.
    Originally, we used LabVIEW 7.0 (i.e. Before Project) to develop a Host and Remote (PXI) application.  The Host application was built as an .EXE, while the Remote was saved as an .LLB, copied to the PXI, and "invoked" at Run Time by calls to VI Server.  Note that this means that the code on the Remote might (is?) not be as compact, efficient, or optimized as if we had built an .EXE.  But we definitely can have Bob's Experiment, Jane's Experiment, and Joe's Experiment on the PC (as separate executables), and each could respectively call Bob's RT, Jane's RT, or Joe's RT on the PXI at run time.  No need to have LabVIEW (or LabVIEW expertise) on this system, and Bob, Jane, and Joe can be "ordinary users".
    "Modern LabVIEW" takes a slightly different (and probably better) view towards Real-Time -- both the Host and Remote programs are built as Executables (the RT is built as an .RTEXE).  We can "pre-deploy" the RT code to the PXI, and set it to run at Startup.  This makes getting the RT side "running" semi-automatic -- all you need to do (if it isn't running) is reboot the PXI.
    But what if you want Bob, Jane, and Joe's version, selectable by running (on the Host) Bob, Jane, or Joe's Host application?
    I'm playing with the following algorithm, which seems to work.  I'm presenting it here to get feedback, especially if there is a "better way" to do this.
    The key to this method is that there is an .INI file on the Remote, C:\ni-rt.ini, that contains, among other things, the RT Target's Startup Application path (by default, this is C:\ni-rt\startup\startup.rtexe).
    Consider three Projects, Project Bob, Project Jane, and Project Joe.  Within each Project, a Host executable is built having a name like "UI Bob" (or "Jane" or "Joe"), while the Target executable is given the name "RT Bob" (or "Jane" or "Joe").  The three .RTEXE files are copied to the Target and placed in the Startup folder, C:\ni-rt\startup.
    Now run one of the Host executables.  It does the following:
    FTP a copy of C:\ni-rt.ini from the Target to itself.
    Get the name of the Startup .RTEXE.
    If it is the "appropriate" name (i.e. if the Host program is UI Bob.exe, the Remote should be RT Bob.rtexe), do nothing, as the Target is already running the right code.
    Otherwise, we need to force the Target to run the correct Target code.  We can do this by changing the Startup entry in the .INI file to the Remote code we need (for example, RT Bob.rtexe), then tell the Remote to Reboot.  When it comes back, it will be running the appropriate RT code.
    The Host now goes ahead and tries to connect to the Remote.  If a connection cannot be established (for example, the Remote code might have stopped), a Reboot of the Remote might fix things up.
    Short of trying to write a single enormous program that encompasses every experimental scenario and situation (i.e. have a big Case Statement with a Bob, Jane, or Joe "choice", and a single executable that had everyone's code in it), this seemed to be a fairly simple way to have the robustness of compiled executables on both the Host and Remote machines, yet maintain the flexibility to let the (non-LabVIEW-guru) User choose which executable to run.
    I haven't fully deployed this system -- I'm currently at "Proof-of-Concept" stage, but I've got the various "pieces" working.  Does this seem like a sensible appropach?  Are there other, simpler, ways to accomplish this?
    Bob Schor

    Hey Bob.
    So I assume you're -completely- working with built executables?  You're not going to work in the editor environment to modify your projects at all?
    If this is the case, then having a generic deployment phase at the beginning of the executable (with a "setting up hardware for your app" splash screen) isn't a bad idea -
    Check the binary on the target, ensure it matches the binary you have on the host machine (in case you ever decide to update).
    If they don't match, FTP the new file down to replace the old one.
    FTP the ni-rt.ini file, ensure the startup exe is enabled and is pointing to the correct location.  
    If it's not enabled or not pointing to the correct startup file, modify the .INI file and FTP back to the target.
    If you had to update the INI file, ask target to reboot itself.  Wait 30 seconds, and wait for target to become available again.
    Connect to the target. If you cannot connect, reboot target.  If the target comes back and you still cannot connect to the app, notify user.
    That's almost exactly how we handle installation and deployment via MAX.  
    The big assumption here is that the built executables were all built with the same version of LabVIEW Real-Time.  If not, you'd need a system replication step in there to make sure the proper version of LabVIEW is on the target before launching the built .rtexe.  
    -Danny

  • How to Load a Panel during run time from a CVI dll

    Hi,
    I want to execute/load a panel during runtime, from a CVI dll function.
    my CVI dll "test.dll" has "READ_PAN" function. while executing this function from a Test Stand Action step i want Configure Panel (from FR_GUI.uir) to pop up.
    can you please suggest me how can i do this from my "test" project of CVI.
    int __stdcall __export RunFRConfig (CAObjHandle step,CAObjHandle thisContext)
        ERRORINFO errorInfo;
        char errMsg[1024];
        int pan;
        pan = LoadPanelEx (0, "FR_GUI.uir", READ_PAN, __CVIUserHInst);
        DisplayPanel (pan);
        RunUserInterface();
        DiscardPanel (pan);
        return 0;
            Error:
       // sprintf(FinalErrMsg,"Configure Error: %s",errMsg);  
        return -1;

    Thanks for ur reply.
    Hello Asad,
    It is possible to maximize the run time previewer when calling reports from forms. U need to set a parameter named 'MAXIMIZE' to do that.
    I m attaching a code sample for u. This is working in my production environment.
    DECLARE
    pl_id ParamList;
    BEGIN
         pl_id := Get_Parameter_List('setProposal');
         IF NOT Id_Null(pl_id) THEN
              Destroy_Parameter_List( pl_id );
         END IF;
         pl_id := Create_Parameter_List('setProposal');
    // This parameter is set to hide parameter form at run time     
         Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
    // This parameter is used to maximize previewer window at run // time
         Add_Parameter(pl_id, 'MAXIMIZE', TEXT_PARAMETER, 'YES');
    Run_Product(REPORTS, 'sample.rep', SYNCHRONOUS, RUNTIME,
    FILESYSTEM, pl_id, NULL);
    END;
    Feel free to contact me if u need anymore assistance.
    Take care and bye

  • How to determine itab type at run time

    I need to write a subroutine that organizes data in internal tables for presentation by a smartform. There are a few similarly structured internal tables all with the same field name ("recipe_type") by which the data is sorted. My problem is that how I can determine the type of the itab inside my subroutine at run time? Is it ever possible in ABAP?
    The subroutine code is attached below. Thanks for any help.
    FORM beautify_itab    TABLES itab_in TYPE table
                                     USING v_type TYPE any
                                     CHANGING itab_out TYPE table.
    Data declaration
      DATA: v_data_row LIKE LINE OF itab_in,                " THIS WON'T COMPILE!
                 v_blank_row LIKE LINE OF itab_in.              " blank row
    Organize the display of the table data
      LOOP AT itab_in INTO v_data_row.
        IF v_type <> itab_in-recipe_type.                     " 'recipe_type' is the sort key for the incoming itabs
          v_type = itab_in-recipe_type.
          IF sy-tabix > 1.
            APPEND v_blank_row TO itab_out.
          ENDIF.
          APPEND v_data_row TO itab_out.
        ELSE.
          CLEAR v_data_row-recipe_type.
          APPEND v_data_row TO itab_out.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

    The following code does what I want, but only if the input itab structure is declared first in the program. It won't work if the itab is declared as itab_in TYPE TABLE OF sflight. This is because the function 'GET_COMPONENTS_LIST'  only can load the structure of a field declared explicitly in the program.  Does anybody know of any method to load the structure of an itab based off a dtab? 
    Thanks you guys for answers. Points have been rewarded.
    *& Report  Z_GET_ITAB_TYPE_AT_RUN_TIME
    REPORT  z_get_itab_type_at_run_time.
    DATA: BEGIN OF itab_in OCCURS 0,
             seatsocc_b LIKE sflight-seatsocc,
             fldate LIKE sflight-fldate,
          END OF itab_in,
          itab_out TYPE TABLE OF string,
          wa_itab_out TYPE string.
    SELECT seatsocc_b fldate
    INTO TABLE itab_in
    FROM sflight
    WHERE carrid = 'AA' AND
          connid = '0017'
    ORDER BY seatsocc_b.
    PERFORM beautify_itab
                TABLES
                   itab_in
                USING
                   sy-repid
                   'itab_in'
                   'SEATSOCC_B'
                CHANGING
                   itab_out.
    LOOP AT itab_out INTO wa_itab_out.
      WRITE: / wa_itab_out.
    ENDLOOP.
    *&      Form  beautify_itab
          text
         -->ITAB_IN    text
         -->V_KET_FIELD   text
         -->ITAB_OUT   text
    FORM beautify_itab TABLES itab_in TYPE table
                       USING  v_prog_name LIKE sy-repid
                              v_itab_in_name TYPE any
                              v_key_field_name TYPE rstrucinfo-compname
                       CHANGING  itab_out TYPE table.
      DATA: itab_fields TYPE TABLE OF rstrucinfo,
            v_field_name LIKE rstrucinfo-compname,
            v_old_key TYPE string,
            v_field_value TYPE string,
            v_data_line TYPE string,
            v_tabix LIKE sy-tabix,
            c_blank_row TYPE string VALUE ''.
      FIELD-SYMBOLS: <fs_field>,
                     <fs_data_line>,
                     <fs_field_list> TYPE  rstrucinfo.
    gets all of the components of a structure
      CALL FUNCTION 'GET_COMPONENT_LIST'
        EXPORTING
          program    = v_prog_name
          fieldname  = v_itab_in_name
        TABLES
          components = itab_fields.
      LOOP AT itab_in ASSIGNING <fs_data_line>.
        v_tabix = sy-tabix.
        LOOP AT itab_fields ASSIGNING <fs_field_list>.
          v_field_name =  <fs_field_list>-compname.
          ASSIGN COMPONENT v_field_name OF STRUCTURE
                        <fs_data_line> TO <fs_field>.
          v_field_value = <fs_field>.
          IF v_key_field_name = v_field_name.
            IF v_old_key <> v_field_value.
              v_old_key = v_field_value.
              IF v_tabix > 1.
                APPEND c_blank_row TO itab_out.
              ENDIF.
            ELSE.
              CLEAR v_field_value.
            ENDIF.
          ENDIF.
          CONCATENATE v_data_line v_field_value INTO v_data_line
                      SEPARATED BY space.
        ENDLOOP.
        APPEND v_data_line TO itab_out.
        CLEAR v_data_line.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

  • How to dynamically validate users at run time using connection pools ?

    Hi Folks
    We are facing a peculiar situation . We have established connection to our
    oracle 8i database using Oracle Thin driver using conenction pooling at the weblogic
    server . We set up connection pools at the console to set up connections to thge
    oracle 8i database. However the user name and password is always static when
    we create the connection pool at the console .
    How do i dynamically validate other users using the same connection pool ??
    Eg - The connection pool at design time in the console uses user A and password
    - passA . Now at run time lets say I prompt the user for a login screen and want
    to trap the user id and apssword parameters entered by the user and use it with
    the connection pool created earlier . I tried using the below code snippet :-
    Properties props = new Properties();
    props.put("connectionPoolID", "Oracle_Thin_Driver_Pool");
    props.put("user" , userId );
    props.put("password",userPass);
    myDriver = (Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
    conn = myDriver.connect("jdbc:weblogic:pool", props);
    But always it connects to the database using the userid and password set in the
    console while creating the connection pool . So how i get the connection pool
    to validate my current userid and password entered through the login screen ??
    Thanks in advance
    Keith

    Hey Bob.
    So I assume you're -completely- working with built executables?  You're not going to work in the editor environment to modify your projects at all?
    If this is the case, then having a generic deployment phase at the beginning of the executable (with a "setting up hardware for your app" splash screen) isn't a bad idea -
    Check the binary on the target, ensure it matches the binary you have on the host machine (in case you ever decide to update).
    If they don't match, FTP the new file down to replace the old one.
    FTP the ni-rt.ini file, ensure the startup exe is enabled and is pointing to the correct location.  
    If it's not enabled or not pointing to the correct startup file, modify the .INI file and FTP back to the target.
    If you had to update the INI file, ask target to reboot itself.  Wait 30 seconds, and wait for target to become available again.
    Connect to the target. If you cannot connect, reboot target.  If the target comes back and you still cannot connect to the app, notify user.
    That's almost exactly how we handle installation and deployment via MAX.  
    The big assumption here is that the built executables were all built with the same version of LabVIEW Real-Time.  If not, you'd need a system replication step in there to make sure the proper version of LabVIEW is on the target before launching the built .rtexe.  
    -Danny

  • How to change the skin at run time

    I am using jDeveloper 11.1.1.3 for ADF.
    My UseCase: i want to give a dropdown for skins. User should be able to select the skin at run time and it should be loaded. Please let me know how can i achieve it.
    Zee

    As per usecase, looks like you have the LOV containing the different skins.
    You can ensure that the application is skinned according to the selected value in the LOV.
    Ensure that you have a session scope variable that is set, whenever you change the LOV.
    For more details, look into this link http://download.oracle.com/docs/cd/E14571_01/web.1111/e10140/skinning.htm
    Thanks for your reply, but then...... what will be the skin loaded by default before the user selects the skin - drop down. Do i have to set something default before hand .?Define the LOV such that there are no empty elements. i.e the first element in the LOV is selected.
    In the Managed bean, if the session scope is not set, return the skin family for the first element. This would be the scenario when the application loads.
    Thanks,
    Navaneeth

  • How to find working workingDirectory on run time

    How can I see my working Direcftory at run time.

    Are you trying to get the working directory on the server side or the client side?
    As Fabrizio mentioned, you can use WebUtil, but this would return the client side information. To obtain the server side details, you can use imported java. Fortunately, because the server side jvm already has everything you need to do this, there is no need to know how to code in java. Refer to the Forms Java Importer documentation for details:
    http://www.oracle.com/webapps/online-help/forms/10g/topics/java_importer/c_javaimporter.html
    All you need to do is import the following java packages into your form:
    java.lang.System
    java.lang.Exception
    Then add some pl/sql similar to this to your form:
    PROCEDURE java_call IS
         jo     ora_java.jobject;     
         rv     ora_java.jobject;
         ex     ora_java.jobject;     
    Begin
    -- Get server side working directory.
    -- This is the same value which is set in formsweb.cfg
         MESSAGE (SYSTEM.getProperty('user.dir'));     
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
              message('Unable to call out to Java, ' || ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
              ex := ORA_JAVA.LAST_EXCEPTION;
              message (Exception_.toString(ex));
    END;Once imported, you will have easy access to a variety of server side (Java) properties which can return valuable information. Refer to the following:
    Link: [http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()]

  • How to add customized column in the time sheet CATS (transaction CAT2) ?

    Hello,
    I need to be able to add some columns in the time sheet CAT2 containing:
    - the name and first name of the person (in addition of the number), in display mode in the CATS time sheet.
    - a  text that I will found by reading some tables and values...
    Does anyone have any idea how to do so ? and if it's possible or not?
    Thanks a lot in advance for your help.
    Best regards
    Fanny GROUX

    Hi,
    Thanks a lot, it's really help...don't know why I didn't see this customized point before in SPRO.
    But I have an other issue, my new fields is added in the CATS screen and now I'm trying to put default value by using the user exit of extension CATS0009.
    When I complete the value of my new fields in structure CATSD_IMP, there are not taking into account and the CATS screen doesn't display the value.
    Am I using the wrong table ? wrong user-exit ? or my code ..
    Thansk a lot again for your help.
    Fanny GROUX

  • How to get updated value at run time in oracle forms

    How to get updated value form oracle database on a field in oracle forms 6.0 at run time if the same form is opened by multiple users and both have get the same maximum value if one commit the record then how other would get that maximum value with out exiting that form...

    This issue is fairly common and Forms handles the situation by displaying the error, "Record has been updated by another user. Requery to see changes." if a user tries to update a record that was updated by another user.
    If your data is in a base table block, you can check before you save by checking the value in the form against the database using the Get_Item_Property('<BLOCK.ITEM>',DATABASE_VALUE). You can compare the value returned by the built-in against the value in the field to see if they have changed. This could be a lot of work and a lot of network traffic if you are checking numerous items in your data block. Forms has a standard locking mechanism that will lock the queried record as soon as a user makes any changes. If another user queries and attempts to change the record locked by another user - they will receive a "Record Locked" message.
    Francois brings up a valid point. Perhaps you should review the link Francios provided as well as this one: How to ask questions the smart way
    It is always a good idea to review your thread before you post it and ask yourself, "Could I answer this question given the information I've provided and the way I've asked the question?"
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to clear this type of run time error

    good eve,
    i am migrating sql server procedures to oracle procedures
    i am trying to execute char(39) function in plsql is the following way correct and if this way is correct i am getting
    run time error like
    create or replace
    procedure Sel_subgroup(key in varchar2,gradename in varchar2)
    as
    gid res_grades.grade_id%type;
    gn res_grades.gradename_en%type;
    stid sub_topics.subtopic_id%type;
    stn sub_topics.subtopicname_en%type;
    cc res_grades.countrycode%type;
    estid exsub_topics.exsub_topics_id%type;
    estn exsub_topics.exsubtopicname_en%type;
    d_stmt varchar2(500);
    type ref_cursor is ref cursor;
    rc ref_cursor;
    begin
    d_stmt :='SELECT RG.Grade_ID,RG.Gradename_'||key||',ST.SubTopic_ID,ST.SubTopicname_'||key||', RG.CountryCode,
    Est.ExSub_Topics_ID, Est.ExSubTopicname_'||key||' from
    Res_Grades RG INNER JOIN Sub_Topics ST ON RG.Grade_Id= ST.Grade_ID
    INNER JOIN ExSub_Topics Est ON ST.SubTopic_ID = Est.Sub_Topics_Id
    Where Gradename_'||key||' = '''||gradename||'''';
    open rc for d_stmt;
    loop
    fetch rc into gid,gn,stid,stn,cc,estid,estn;
    if rc%found then
    dbms_output.put_line(gid||gn||stid||stn||cc||estid||estn);
    else
    exit;
    end if;
    end loop;
    close rc;
    commit;
    end Sel_subgroup;the out screen result is:
    Connecting to the database rasool.
    Process exited.
    Disconnecting from the database rasool.can u please help me,
    thanking you,
    prakash

    to samb,
    It doesn't look like you are getting a runtime error. Is it possible your query is returning no rows?
    If you are sure your query should be returning rows, you probably need to check if DBMS_OUTPUT is enabled in SQL Developer (View menu I think).my query is returning a row
    where where 123=key and 'FUBAR'=gradename?
    If so, you want 3 single-quotes at the end of the string, not 4:
    You sure? I think 4 is correct.i am sure 4 is correct i have tried as per jeenesh said
    to jeenesh
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace
      2  procedure Sel_subgroup(key in varchar2,gradename in varchar2)
      3  as
      4   d_stmt varchar2(500);
      5  begin
      6  d_stmt :='SELECT RG.Grade_ID,RG.Gradename_'||key||',ST.SubTopic_ID,ST.SubTopicname_'||key||', RG.CountryCode,
      7  Est.ExSub_Topics_ID, Est.ExSubTopicname_'||key||' from
      8  Res_Grades RG INNER JOIN Sub_Topics ST ON RG.Grade_Id= ST.Grade_ID
      9  INNER JOIN ExSub_Topics Est ON ST.SubTopic_ID = Est.Sub_Topics_Id
    10  Where Gradename_'||key||' = '''||gradename||'''';
    11  dbms_output.put_line(d_stmt);
    12* end Sel_subgroup;
    SQL> /
    Procedure created.
    SQL> set serverout on
    SQL> exec Sel_subgroup('1','TEST');
    SELECT RG.Grade_ID,RG.Gradename_1,ST.SubTopic_ID,ST.SubTopicname_1,
    RG.CountryCode,
    Est.ExSub_Topics_ID, Est.ExSubTopicname_1 from
    Res_Grades RG
    INNER JOIN Sub_Topics ST ON RG.Grade_Id= ST.Grade_ID
    INNER JOIN ExSub_Topics
    Est ON ST.SubTopic_ID = Est.Sub_Topics_Id
    Where Gradename_1 = 'TEST'
    PL/SQL procedure successfully completed.i have also executed your code sir it is executing.in my coding,i found that the part of dbms_output.put_line in my ref cursor loop is not displaying me the print.
    to karthick arp
    Did enable serveroutput?yes i have enabled it with buffer size 200000
    to
    Billy Verreynne     & Frank Kulash
    as per you said sir i have done and got an error my code as follows
    SQL> var rc refcursor
    SQL> var key varchar2(2)
    SQL> var gradename varchar2(30)
    SQL> exec :key :='EN';
    PL/SQL procedure successfully completed.
    SQL> exec :gradename :='PRE-K';
    PL/SQL procedure successfully completed.
    SQL> begin sel_subgroup(key => :key, gradename => :gradename,rc => :rc); end;
      2  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    ERROR:
    ORA-24338: statement handle not executed
    SP2-0625: Error printing variable "rc"how to handle this error sir

Maybe you are looking for