Assigning a value to a record attribute ,where attribute changes dynamicall

Hi all,
i am writing a procesure in which ...
i want to assign values to a record whose attributes changes dynamically depending on the variable value...
below is the code in which i am trying to assign values to a record type rec_ce_stmt_int_tmp & i want a value "/" to be assigned to rec_ce_stmt_int_tmp.column(l_num_curr_col_no + 1)[[/i]b] ...
for example if l_num_curr_col_no value is 14 then a value "/" must be assigned to rec_ce_stmt_int_tmp.column15....
i am highlightinf the row of code where i want to assign a vlue "/" to my record attribute.... & insert this assigned values in to my table.
FOR c_fnds_dtl_rec IN
c_fnds_dtl (c_stmt_acts_rec.intf_row_id)
LOOP
IF l_num_curr_col_no > 13
THEN
rec_ce_stmt_int_tmp.column(l_num_curr_col_no + 1) := '/'; BEGIN
INSERT INTO ce_stmt_int_tmp
(rec_no,
column1,
column2,
column3,
column4,
column5,
column6,
column7,
column8,
column9,
column10,
column11,
column12,
column13,
column14
VALUES (rec_ce_stmt_int_tmp.rec_no,
rec_ce_stmt_int_tmp.column1,
rec_ce_stmt_int_tmp.column2,
rec_ce_stmt_int_tmp.column3,
rec_ce_stmt_int_tmp.column4,
rec_ce_stmt_int_tmp.column5,
rec_ce_stmt_int_tmp.column6,
rec_ce_stmt_int_tmp.column7,
rec_ce_stmt_int_tmp.column8,
rec_ce_stmt_int_tmp.column9,
rec_ce_stmt_int_tmp.column10,
rec_ce_stmt_int_tmp.column11,
rec_ce_stmt_int_tmp.column12,
rec_ce_stmt_int_tmp.column13,
rec_ce_stmt_int_tmp.column14
EXCEPTION
WHEN OTHERS
THEN
fnd_file.put_line
(fnd_file.LOG,
'Error while inserting 03/88 >13 record into ce_stmt_int_tmp :'
|| SQLERRM
RAISE end_acts_save;
END;

Hi Sathya,
Actually this is apart of my procedure, BEGIN is also there
it is giving an error saying COLUMN MUST BE DEFINED on line
rec_ce_stmt_int_tmp.column(l_num_curr_col_no + 1) := '/';
can you please help me out to achieve my task ...
thnks,
Sachin

Similar Messages

  • Assigning same value to duplicate records

    Hi,
    I have to generate a increment value for combination of 2 other columns. If it finds a duplicate value while combining the other 2 column, it should assign the same value.
    for example
    Lets say we have a table like
    a     b     c
    ABC     DEF     1
    ABC     DEF     1
    ABD     DEF     2
    ABE     DEF     3
    ABE     DEF     3
    ABE     DEG     4
    Column C is the increment value. whenever it is finding duplicate value while concatenating Column A and B, It is populating the same value in that column.

    You can try something like this
    select dense_rank() over (partition by b order by a), a, b
    from yourtable

  • How to assigne value in sub record type

    Dear below mention record type database,now i want to assigne value in payr_rec type,in this recrocrd type have one column party_id,but how can assigne value int this field ,
    TYPE group_rec_type IS RECORD(
    group_name VARCHAR2(255),
    group_type VARCHAR2(30),
    created_by_module VARCHAR2(150),
    -- Bug 2467872
    mission_statement VARCHAR2(2000),
    application_id NUMBER,
    party_rec PARTY_REC_TYPE := G_MISS_PARTY_REC
    please guide.

    to get the desired default party_rec attribute value, just assign the "sub-record" attribute defaults as desired; PL/SQL will assign a default (non-null) record as the party_rec value using those attribute defaults:
    create or replace package P_Test_It
    as
         type party_rec_type is record (
              dummy varchar2(1) default 'X'
         type group_rec_type is record (
              group_name VARCHAR2(255),
              group_type VARCHAR2(30),
              created_by_module VARCHAR2(150),
              -- Bug 2467872
              mission_statement VARCHAR2(2000),
              application_id NUMBER,
              party_rec PARTY_REC_TYPE
    end;
    set serveroutput on
    declare
         rec p_test_it.group_rec_type;
    begin
         dbms_output.put_line(rec.party_rec.dummy);
    end;
    X
    PL/SQL procedure successfully completed.Hope it helps.
    Gerard

  • Assigning value in the records

    Hi,
    I have a business scenario in which I am creating vendor and extending it for 320 company codes.
    Now suppose I have to make change in the phone number in the data manager in place of XYZ to ABC.
    Do I have to go and make change 320 place in the data manager or there is any method by the help of validation rule. So that I will write that rule and run on the set of the record automatically system will change phone number for those set of records  from XYZ to ABC.
    If you know any such validation or with help of assignment rules then please just let me know that validation rule or u have any idea please do share with me.
    Thanks,
    Rohit

    Hi Rohit,
      if(phone_number = XYZ , ABC , phone_number)
    See we are checking the phone_number filed, first we are checking for the condition; which in this case is wether the value of any row in phone_number column is 'XYZ' if it matches the replace it with 'ABC' else preserve the same value which exists.
    for example
      phone_number
       III
       ABC
      UEU
      XYZ
      KKK
      LLL
      JDD
    suppose these are the values under phone_number field and we are applying assignment to all of them; now it will first check as
       III = XYZ it does not match so III is preserved.
      ABC = XYZ it does not match so III is preserved
    XYZ = XYZ it does match so XYZ is replaced with ABC
    in this way records are compared and values are changed.
    If you do not provide the else statement then MDM considers the default values as "TRUE" and assigns it to the record. so its must to provide the else value in the if statement to have the expression completed.
    I hope this will clear you dought; any thing else please let me know
    Regards,
    Charan

  • Want to assign a value to a dff (from a sql )whenever the record is saved

    Hi
    I am new to OAF and would like to know how can i extend my VO and assign a value returned by a sql which returns a value on the basis of some fields from some fields in the same VO .
    Thanks
    Narinder

    Narinder,
    You can extend the SEEDED VO by creating a new VO and using the extends property in the VO wizard to refer to the seeded VO. Now in the new VO query you can make changes as appropriate to retrieve your values. The last step is to substitute this VO in the Applicatin so that the newly created Custom VO is used instead of standard to make sure your changes are visible.
    Best would be to read the section on Substitution in the Dev guide.
    Regards
    Sumit

  • How i can assign multiple values to tabuler text item (Help)

    HI
    IM PROGRAMMING ONE FORM AND I PUT THERE TABULER TEXT ITEM
    I WANT ASSIGN 63 VALUES TO THIS TEXT ITEM ONE BY ONE BY CODE I MEAN PUT FIRST VALUE IN THE FIRST TEXT ITEM ROW THEN SECOND TO THE SECOND TEXT ITEM AND LIKE THIS UNTIL I REACH TO THE LAST
    I MAKE LOV PUT I CAN ASSIGN ONE VALUE BY ONE VALUE EACH TIME DOUBLE CLICK ON THE TEXT ITEM ASSIGN ONE VALUE THEN DOUBLE CLICK ON THE SECOND ROW PUT MY BOSS WANT ASSIGN ALL VALUES 63 FROM ONE CLICK ON BUTTON

    Then you will have to create a when-validate-item trigger with a cursor based on your selection of your LOV . Loop through that cursor assigning the next in the next record by using the built-in function next_record. (put you selection for you value in a hidden item for example.
    something like this:
    Declare
    cursor c is
    select returnValueFromLOV
    from <yourtable>
    where yourdisplay value = :hidden_tem;
    begin
    for r in c loop
    next_record;
    item := r. returnValueFromLOV;
    end loop;
    exception
    when no_data_found
    your error handling;
    end;
    Hope it put you on the road to reach what you want
    Erwin

  • Assigning a value to an array cell populated [BULK]

    Hi all,
    I've got a problem in assigning a value to an array populated with BULK COLLECT INTO .
    I can reproduce the problem with this
    CREATE TABLE TEST_TABLE (
    value1 NUMBER,
    value2 NUMBER
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);
    INSERT INTO test_table VALUES(1,1);And this is the PL/SQL anonymous block that gives me problems:
    DECLARE
      SUBTYPE t_rec IS TEST_TABLE%ROWTYPE;
    TYPE records_table IS TABLE OF t_rec;
      elist RECORDS_TABLE;
      CURSOR table_cursor IS SELECT * FROM TEST_TABLE WHERE rownum <= 20;
    BEGIN
      OPEN table_cursor;
      FETCH table_cursor BULK COLLECT INTO elist;
        FOR j IN 1..elist.COUNT
        LOOP
          elist(j)(1) := elist(j)(1) +1;
        END LOOP;
      CLOSE table_cursor;
    END; The error is
    ORA-06550: line 13, column 7:
    PLS-00308: this construct is not allowed as the origin of an assignment
    ORA-06550: line 13, column 7:
    PL/SQL: Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:So it doesn't compile because of this line of code:
    elist(j)(1) := elist(j)(1) +1;
    Why doesn't it work?
    If I try to do this, works perfectly:
    DECLARE
    TYPE v_num_table
    IS
      TABLE OF NUMBER;
    TYPE v_2_num_table
    IS
      TABLE OF v_num_table;
      v_nums V_2_NUM_TABLE := V_2_NUM_TABLE();
    BEGIN
      v_nums.EXTEND;
      v_nums(1) := v_num_table();
      v_nums(1).EXTEND;
      v_nums(1)(1) := 1;
      v_nums(1)(1) := v_nums(1)(1) +1;
      dbms_output.put_line(v_nums(1)(1) );
    END;Edited by: user10396517 on 2-mar-2012 2.35

    Variable "elist" is a collection of record, so you access an individual field of a given collection element by specifying the field name, not its position :
    DECLARE
      SUBTYPE t_rec IS TEST_TABLE%ROWTYPE;
      TYPE records_table IS TABLE OF t_rec;
      elist RECORDS_TABLE;
      CURSOR table_cursor IS SELECT * FROM TEST_TABLE WHERE rownum <= 20;
    BEGIN
      OPEN table_cursor;
      FETCH table_cursor BULK COLLECT INTO elist;
        FOR j IN 1..elist.COUNT
        LOOP
          elist(j).value1 := elist(j).value1 + 1;
        END LOOP;
      CLOSE table_cursor;
    END;Your second example is different as you're dealing with a collection of collections.

  • Assigning a Value to a Base Table BLock Field

    hi,
    I have a form in which a block is a base table block . i need to change the value of a field. currently it shows the value of a field from the Table on which the block is based . I need to change the value of that field to display some other value of another table.
    i have a written select statement like this
    select name into vname from ws_emp where ecode = 101
    then i have assigned to this base table field
    :bt_person.ti_v_name := vname;
    this i have created in the base table blocks Post query
    but it is not assigning value
    pls correct me and suggest me if there is any other better method to do this
    Sarav

    That SHOULD work in the Post-Query trigger of the block, but doing that is never a good idea. By replacing a base-table field with any value, it causes Forms automatic processing to lock the row immediately, so no other person running your form can call up the same data. And it causes Forms to think you need to update the record, so the record's status is changed to 'CHANGED' from 'QUERY'.
    It would be better to create a non-base-table field in the block, and put the name into that field.

  • Assigning a value to a Constant

    I have OWB 10..0.1.31 on XP as Client installed.
    I want to assign a value to a constant; I did the following:
    Picking the Constant from the toolbox->assigned a name to the constant ->added an attribute to the outputgroup, the name is TODAY DATE; I then did an right click on the attribute, I expected, that a window will pop-up, which shows me, among others, the Expression-button; instead of that, the Constant-Editor pops-up again, so I am not able to assign the Constant a value.
    Does anybody does have an idea, where my mistake is ?
    Regards,
    Rüdiger

    Hi Rüdiger
    When you click on the attribute in the constant operator in the mapping canvas, the Attribute Properties should be refreshed in the mapping editor (it is a dockable panel in the mapping editor). In this panel there are a bunch of properties for the attribute (representing your constant) and one of them is the Expression. Click on the right hand column of the property inspector table next to Expression and the expression editor will appear....
    Cheers
    David

  • IDoc Control Record and Status Record Code,  where is it!!!

    Hi,
      Where can i see the code for generation of control record and status record of IDoc.
       Thanks in advance for your answers

    hi ,
    1.first create an segment with the fields u want tcode we31 relase it .
    2. create an idoc and assign segment to it tcode we30.
    3.crate a message type  tcode we81
    4.assign that message to idoc  tcode we 82.
    do the ale configarations .
    now u can write the code in our sender system
    *1.     Create parameters/select-options for input data. i.e., message type, logical system.
    parameters : p_mestyp like edmsg-msgtyp default 'ZKKUMSG',
                 p_logsys like tbdlst-logsys obligatory.
    *2.     Create Data objects for control record, data record and database table.
    data : c_segment like edidd-segnam value 'ZKKUSEG',        "Data record (IDoc)-Segment type
           c_idoctp like edidc-idoctp value 'ZKKUIDOC'.            "Control record (IDoc)-Basic type
    data : begin of i_tab occurs 0,
              ZKSNO   like ZKSTD-ZKSNO,
              ZKSNAME like ZKSTD-ZKSNAME,
           end of i_tab.
    data : w_itab like i_tab.
    data : s_segment like ZKKUSEG.
    data : i_edidd like edidd occurs 0 with header line.
    data : i_control_record like edidc.
    data : i_comm_idoc like edidc occurs 0 with header line.
    *3.     Select the data from responding tables into internal table for a defined condition.
    here you have take ur internal table
    *select single zsno zsname from zkiran into corresponding fields of itab where zsno = p_sno.
    *4.     create control record into internal table.
    i_control_record-mestyp = p_mestyp.         "Message Type
    i_control_record-idoctp = c_idoctp.         "Basic type
    i_control_record-rcvprt = 'LS'.             "Partner Type of Receiver
    i_control_record-rcvprn = p_logsys.         "Partner Number of Recipient
    *5.     create data record into internal table.
    *i_edidd-segnam =   c_segment.
    loop at i_tab into w_itab.
    s_segment-zksno    = w_itab-ZKSNO.                     "Application Data
    s_segment-zksname  = w_itab-ZKSNAME.
    i_edidd-sdata     = s_segment.
    i_edidd-segnam    = c_segment.
    clear w_itab.
    append i_edidd.
    endloop.
    *6.     Process ALE Service Layer using the function module  MASTER_IDOC_DISTRIBUTE.  It returns the corresponding IDoc No.s.
    call function 'MASTER_IDOC_DISTRIBUTE'
      exporting
        master_idoc_control            = i_control_record
      tables
        communication_idoc_control     = i_comm_idoc
        master_idoc_data               = i_edidd
      exceptions
        error_in_idoc_control          = 1
        error_writing_idoc_status      = 2
        error_in_idoc_data             = 3
        sending_logical_system_unknown = 4
        others                         = 5.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    *7.     Display Communication IDocs.
    loop at i_comm_idoc.
      write : / 'Communication IDoc No. is : ', i_comm_idoc-docnum.
    endloop.
    *8.     Commit Work.
    commit work.
    i hope this sample code help u .
    thanks

  • Assigning multiple values from a List of Values at detail (table) level

    Hi,
    I have a master detail entry screen. I want to assign multiple values when end user selects an item from the list. The field is at detail level (Table type). I can do it using the "Select one choice" type component (ADF Faces Core) but it doesnt retain the value when I go to the next record. This type of component works fine with the screen with only one record to show (form type). This component has binding with list type.
    If I use simple list with Table binding, I can not assign values to multiple items. This type of list retains value when record is changed.
    Can anyone help me resolving this issue?
    Thanks,
    CAH

    Post on Jdev forum JDeveloper and OC4J 11g Technology Preview
    --Shiv                                                                                                                                                                               

  • How to assign a value to a member with computed name ?

    Is there a way to assign a value to a member whose name is built dynamically in a calculation script ?For instance, my calculation script needs to do this :In the ACCOUNT dimension, the values of some (source) accounts must be added to their associated (destination) account and cleared from the source account.I can't use shared members.Each source account has a DESTINATION attribute, whose value is the associated destination account nameIs there a way to add the source value to the destination account? or some kind of dynamic solution without attribute ?Any help or suggestion greatly appreciated. ThanksPhilippe

    I forgot to mention that the assignation is conditional (if the value to assign is < 0).I tried this part of script with Essbase 6.5.1 (server and client):VAR var_dynamic_name;VAR var_value; ...FIX (...) ... var_dynamic_name = @MEMBER (@SUBSTRING( @ATTRIBUTESVAL( bilan ), 3 )); var_value = some formula; ... /*#### 2 Errors on next line : "This function must be a macro" and then"A variable can be only be used in a calcmember block or the rigth side of an assignement" ####*/ FIX (@MEMBER(var_dynamic_name)) cyg_bilan( IF ( var_value < 0 ) cyg_bilan = var_value; ENDIF );...ENDFIX ...

  • How to assigne multiple value in key of read table

    Hi gurus,
    I want read table xxxx with key field1 = ' xxx' or field1 = 'yyy'.
    how to assign multiple value as key for the same field while reading internal table.
    Regards
    sagar

    Hi ,
    You can loop the internal table like
    loop at  <table xxxx> where field1 = ' xxx' or field1 = 'yyy'
    or you can write two read statements to read the internal table in wrk area.
    read table   <table xxxx> with key field1 = ' xxx'.
    if sy-subrc <>0
    read table   <table xxxx> with key field1 = 'yyy'.
    if sy-subrc = 0
    endif.
    else.
    do your data processing.
    endif.
    Thans.

  • Assigning a value to a number field through a button

    11gxe , apex 4.x ,
    hi all ,
    i am trying to assign value to a number field through a button ,
    i created a button , then a dynamic action for this button , when it is clicked ,
    the dynamic action is based on Pl\Sql code , and the code is
    begin
    :p2_assign := 455 ; -- where the page is "p2" and the number field is "assign"
    end ;
    but it does not work , why ?

    I can see the toolbar now from the last link you provided me with ,
    but you showed me the way to use the static assigning , and assigning with sql , and i want to do it with "Pl\Sql"
    in order to know why my way of writing the code does not work , although it is written properly , and should work .
    every input item is a variable , and i am doing so
    begin 
    :p2_assign := 455 ; -- where the page is "p2" and the number field is "assign" 
    end ;
    to assign a value to a variable ,
    and
    doing this
    begin 
    select 455 into :p2_no from dual ; 
    end ;  
    to select a value into a variable , then
    why does not it work ??
    and how to do it with pl\sql ?
    thanks

  • How to set a value to a dynamically created node/attribute?

    Hi,
    I dynamically created attributes using the following method,
    IWDNodeInfo cbOptions = wdContext.getNodeInfo().addChild("cbOpt"+count, null, true, true, false, false, false, true, null, null, null);
    cbOptions.addAttribute("opt"+critEle.getQuest_Critid(), "ddic:com.sap.dictionary.string");
    How do i assign a  value to it now, since the node/attribute cannot be accessed via wdcontext?
    On a side note, it seems really troublesome if i need to use a checkbox grp(s) dynamically. I actually need to dynamically create a seperate node + attribute for each checkbox grp i have. Is there any better way to do this?
    Thanx in advance

    Hi
    Steps:
    1) Create the  action click is done statically (you cannot create action dyanmically)
    2) binding the  action click to checkbox dynamically 
    code
    public static void wdDoModifyView(IPrivateDynamicProgrammingView wdThis, IPrivateDynamicProgrammingView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
         if(firstTime){
                      IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
              IWDCheckBox checkBox=(IWDCheckBox)view.createElement(IWDCheckBox.class,"ck");
              IWDAction act=wdThis.wdCreateAction(IPrivateDynamicProgrammingView.WDActionEventHandler.CLICK,"");
              checkBox.setOnToggle(act);
              con.addChild(checkBox);
        //@@end
    Thanks and Regards,
    Arun

Maybe you are looking for

  • Internet Browsers wont open web pages.

    I have Windows 7 Home.  None of my internet browsers (firefox,IE,chrome)  will open any web pages.  Was working fine the day before and now nothing.  When you type in an address or search on the google tab it just thinks for a a while then the addres

  • Sun Access Manager Event Sequence

    I have a third party black box piece of hardware that is redirecting browser requests to my server for authentication. I want to utilize the Sun Access Manager to perform these authentications. Do I need to use the Policy Agent, or should I attempt t

  • Info Record Condition record changes

    Hello Experts, We have a requirement to change the % allotted to a particular condition type in Info record. there are no BAPI's available for info record change. I do not prefer BDCs. I am using 4.6c. Can you please provide me any other options for

  • TableView   javascript code

    Hi, We have a *.js file, this is a Date/Time Template created in JavaScript. Is it possible to call this *.js template from a Cell in a TableView. Any Advice would be appreciated. NAC

  • Connections per user

    I have a WAVE 474 running v4.2.3.    I see 20-30 connections per user, with several to the same host and sequential ports.   Ex.  x.x.x.y:56678, 56679, 56680.. to 56685 going to x.x.x.z:3456...3480.    Is this correct?   I am running out of TFO conne