Assigning a 'dynamically created sequence' value to a variable

in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
v_seq_name := 'seq_'||loadid||v_table_name;
execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
1) v_curr_value : = v_seq_name.currval ;
2) select v_seq_name||'.nextval' into v_curr_value from dual;
can you please suggest me how i can get the value in plsql block.

DIVI wrote:
in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
v_seq_name := 'seq_'||loadid||v_table_name;
execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
1) v_curr_value : = v_seq_name.currval ;
2) select v_seq_name||'.nextval' into v_curr_value from dual;
can you please suggest me how i can get the value in plsql block.Well, you haven't given the error you are getting but I guess the procedure isn't compiling? You need to execute immediate any reference to the sequence.
Having said that, your architecture is probably wrong if you are dynamically creating things in a procedure.
Why do you need to create them dynamically?

Similar Messages

  • How to append the dynamically created sequence in to the main sequence

    i have created a sequence dynamically using c# with myEngine.NewSequence(). I  am loading this sequence into a sequence file created using myEngine.NewSequenceFile(). every sequence file has a main sequence by default. Now I need to append the created sequence in to the main sequence. can you please help me to solve this issue?

    1. Sequence seqMain = seqFile.GetSequenceByName("MainSequence");  2. Your stuff that creates a SequenceStuff e.g. "Hello"3. Step stepSeqCall = engine.NewStep(AdapterKeyNames.SequenceAdapterKeyName, "SequenceCall"); 4.stepSeqCall.Name = "HELLO" or sequenceStuff.Name;5. objModule.UseCurrentFile = true;
    6.objModule.SequenceName = stepSeqCall.Name ;
    7.seqMain.InsertStep(stepSeqCall, nSeq, StepGroups.StepGroup_Main);
    Greetings from Germany
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Dynamic create sequence and select nextval within one transaction

    The following procedure doesn't compile if sequence SEQ_ADR does not exist before compilation. I had to create the sequence manually before being able to compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;Edited by: totalnewby on Aug 23, 2012 6:41 AM

    totalnewby wrote:
    The following procedure doesn't compile if sequence SEQ_ADR does not exist before compilation. I had to create the sequence manually before being able to compile this procedure. How can I avoid this manual generation?
    PROCEDURE A_270(proc_id number) IS
    seq_cnt number;
    curr_max number;
    BEGIN
    select count(*) into seq_cnt from user_sequences where sequence_name='SEQ_ADR';
    if seq_cnt > 0 then
    execute immediate 'drop sequence SEQ_ADR';
    end if;
    select max(id)+1 into curr_max from adress;
    execute immediate 'create sequence SEQ_ADR start with '||curr_max||'';
    insert into adress(ID,
    IMPORTED_DT
    select
    SEQ_ADR.nextval ID,
    sysdate IMPORTED_DT
    from new_adress;
    END;Edited by: totalnewby on Aug 23, 2012 6:41 AMEssentially the same question asked by 'gogol' two days ago at creating and using sequence inside a proc
    It was a bad idea then. It is a bad idea now.

  • How to handle dynamically created row values when get upadted "please help"

    Hi,
    In my application I have requirement to display the data for specific date when user clicks on viewData. (it shows the entries for that specific days . There may be number of entries). For showing this I have created Value Object and I am setting all the entries for particular selection date to value object and (simply one day entry indicates one instance of my VO if there are 10 entries then I am creating 10 instances of VO and passing this to the actionfor)
    On my JSP page I am displaying that data by using <logic:iterate>
    <logic:iterate id=�myid� name =�nameofform� property =�Listproperty�>
    <tr>
    <td><input type=�text� property=�abc� value=<bean:write name=�myid� property=�propertyinVO�></td>
    // and same for other other values as well
    �.
    </logic:itearte>
    Now I have requirement that if user edit these entries and click on SAVEDATA the updated values should go to the DB.
    As I don�t have property mapped separately I am not able to take updated values of those as they are getting dynamically generated
    Is there is any way by which I can get these updated values.
    I am in badly need of that . Urgent help will highly appreciated.
    Thanks
    Sheena

    Hi, first off, no need to determine what has been checked or not. If the checkbox is checked, on the post, the value will be submitted as part of the request. If the checkbox is not checked, it will not be submitted (it's value will be null). Depending on what you need, I have approached this a number of different ways. One way is to name all checkboxes the same name. If you need to distinguish between two rows in the form, then in the value field for the checkbox, use some type of distinguishing factor, for example,
    <input type=checkbox name=chkName value="1:abc">
    <input type=checkbox name=chkName value="1:def">
    Now, you only have to make one call on the Servlet/JSP receiving the form post, request.getParameterValues("chkName") which will return an array of the non-null Strings that were checked.

  • Using a single sequence value over multiple scripts (in a variable?)

    Hi all...
    I'm writing a number of scripts that insert rows into tables.
    To better explain my point, I'll paste a simple breakdown of the scripts here as that will be easier to understand...
    Script 1:
    INSERT INTO WORKGROUP_DEPARTMENTS(ID, DEPT_NAME, DEPT_TYPE)
    VALUES (SEQ_WGDPT.NEXTVAL, 'Staff', 3);
    Script 2:
    INSERT INTO WORKGROUP_SECTIONS(ID, SECT_NAME, WGDPT_ID)
    VALUES (SEQ_WGSEC.NEXTVAL, 'Staff 1',
    (SELECT ID FROM WORKGROUP_DEPARTMENTS
    WHERE DEPT_NAME = 'Staff'
    AND DEPT_TYPE = '3')
    Script 3:
    INSERT INTO WORKGROUPS(NAME, UNIT_TYPE, WGSEC_ID)
    VALUES ('Staff Room', 3,
    (SELECT ID FROM WORKGROUP_SECTIONS
    WHERE SECT_NAME = 'Staff 1')
    As you can see, in scripts 1 and 2 a new value is produced from a sequence (SEQ_WGDPT & SEQ_WGSEC respectively). Then, in scripts 2 & 3 (respectively) these values are inserted into another table.
    What I'm trying to figure out is: can I do the same thing here without having to include the horrible SELECT statements in scripts 2 & 3 in order to find the ID, which was produced by the sequence in the previous script?
    Unfortunately they do have to be separate scripts, and as such I can't call Sequence.CurrVal from a different script as other users may have used the sequence since it was used initially in the previous script. I could call it from the original calling script, and save it intop a variable, but I have no idea how to - even if it is the right idea!
    I tried to insert the sequence value into a variable a la PL/SQL so that I could call this variable from the next script, but failed miserably as I'm rubbish!
    Any help would be great. Thanks.

    You can use PL/SQL, for example:
    SQL> desc t
    Name                                      Null?    Type
    ID                                                 NUMBER
    NAME                                               VARCHAR2(10)
    SQL> desc t1
    Name                                      Null?    Type
    ID                                                 NUMBER
    NAME                                               VARCHAR2(10)
    ID1                                                NUMBER
    SQL> desc t2
    Name                                      Null?    Type
    ID                                                 NUMBER
    NAME                                               VARCHAR2(10)
    ID2                                                NUMBER
    SQL> create sequence seq_1;
    Sequence created.
    SQL> declare
      2   prev_id number;
      3  begin
      4   insert into t values(seq_1.nextval,'A')
      5   returning id into prev_id;
      6   insert into t1 values(seq_1.nextval,'B',prev_id)
      7   returning id into prev_id;
      8   insert into t2 values(seq_1.nextval,'C',prev_id);
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> select * from t;
            ID NAME
             1 A
    SQL> select * from t1;
            ID NAME              ID1
             2 B                   1
    SQL> select * from t2;
            ID NAME              ID2
             3 C                   2
    Rgds

  • How to Get Value from a Variable to restrict a Key Figure ?

    I am trying to make a query in Query designer, we are running BI7.
    I have a user entry veriable on the Fiscal year period, the user will need to enter a period they want the report for, i.e. 07.2008 for July 2008 report and 04.2008 for April 2008 report.
    Based on what the user entered as the starting period (in the variable entry), I have to then use that initial value and show the Year to date value (of sales etc) in the next column.
    To Clarify, if user entered 07.2008 then all the data from 01.2008 to 07.2008 needs to be in the next column.   if user entered 04.2008 then all the data from 01.2008 to 04.2008 should be in the next column.
    So to summarise according to my understanding, I want to get the value from a variable and pass it onto another variable to restrict a key firgure (sales amount)...
    Can someone please clarify what i need to do here?  
    Many thanks in advance, points will be awarded accordingly.

    hi,
    please follow the below steps:
    1. Create a new varialbe , this variable should be processed by customer exit.
    2.  In the column section, create a new column and drag the sales key figure, also drag fiscal year period and restrict with the new variable.
    3. In the cmod tcode write a customer exit code to extract the value of the user entry and assign it your variable, you can refer to the below code.
      WHEN '< New VAR name>'.
        IF I_STEP = '2'.                                 "AFTER THE POPUP
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
            WHERE VNAM = '<Fiscal Year Period VAR Name>'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4).
            L_S_RANGE-LOW+4(3) = '001'.
            L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.       "LOW E.G. 2001006
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
    For ex- if the user enters 008/2008, this code will create as range assign 001/2008 - 008/2008 value to the variable.
    hope it helps,
    rgs,
    Parth.

  • 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

  • Using dynamic query to create sequence

    Hello,
    I created the sequence dynamically in a Procedure, but when I executed, it gave me an Insufficient privileges error:
    SQL> create table dummy (id number, module_id varchar2(20), p_order number, status varchar2(1));
    SQL> insert into dummy values (10, 'test', 0, 'D');
    SQL> CREATE OR REPLACE PROCEDURE PRO_SEQ_ARRNGE(P_ID NUMBER) AS
    V_MOD DUMMY.MODULE_ID%TYPE;
    v_query1 varchar2(200);
    v_query2 varchar2(200);
    V_COUNT NUMBER;
    begin
    v_query1 := 'drop sequence unqid';
    v_query2 := 'create sequence unqid start with 1 increment by 1 minvalue 1';
    SELECT COUNT(*)
    INTO V_COUNT
    FROM USER_SEQUENCES
    WHERE SEQUENCE_NAME = 'UNQID';
    IF V_COUNT = 0 THEN
    execute immediate v_query2;
    ELSE
    execute immediate v_query1;
    execute immediate v_query2;
    END IF;
    SELECT distinct MODULE_ID INTO V_MOD FROM DUMMY WHERE ID = P_ID;
    update dummy
    set P_order = 0, status = 'D'
    WHERE ID = P_ID
    and module_id = v_mod;
    --COMMIT;
    execute immediate 'UPDATE DUMMY SET P_ORDER = UNQID.NEXTVAL WHERE MODULE_ID = V_MOD AND STATUS = ''A''';
    --COMMIT;
    END PRO_SEQ_ARRNGE;
    SQL> exec PRO_SEQ_ARRNGE(10);
    BEGIN PRO_SEQ_ARRNGE(10); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "SYSTEM.PRO_SEQ_ARRNGE", line 15
    ORA-06512: at line 1
    Can you please advise how to resolve it?
    Thanks in advance,
    Tinku

    When I try it, I get a different error
    SQL> create table dummy (id number, module_id varchar2(20), p_order number, status varchar2(1));
    Table created.
    SQL>  insert into dummy values (10, 'test', 0, 'D');
    1 row created.
    SQL>  CREATE OR REPLACE PROCEDURE PRO_SEQ_ARRNGE(P_ID NUMBER) AS
      2  V_MOD DUMMY.MODULE_ID%TYPE;
      3  v_query1 varchar2(200);
      4  v_query2 varchar2(200);
      5  V_COUNT NUMBER;
      6  begin
      7  v_query1 := 'drop sequence unqid';
      8  v_query2 := 'create sequence unqid start with 1 increment by 1 minvalue 1';
      9  SELECT COUNT(*)
    10  INTO V_COUNT
    11  FROM USER_SEQUENCES
    12  WHERE SEQUENCE_NAME = 'UNQID';
    13
    14  IF V_COUNT = 0 THEN
    15  execute immediate v_query2;
    16  ELSE
    17  execute immediate v_query1;
    18  execute immediate v_query2;
    19  END IF;
    20
    21  SELECT distinct MODULE_ID INTO V_MOD FROM DUMMY WHERE ID = P_ID;
    22
    23  update dummy
    24  set P_order = 0, status = 'D'
    25  WHERE ID = P_ID
    26  and module_id = v_mod;
    27  --COMMIT;
    28
    29  execute immediate 'UPDATE DUMMY SET P_ORDER = UNQID.NEXTVAL WHERE MODULE_ID = V_MOD AND STATUS = ''A''';
    30  --COMMIT;
    31
    32  END PRO_SEQ_ARRNGE;
    33  /
    Procedure created.
    SQL> exec PRO_SEQ_ARRNGE(10);
    BEGIN PRO_SEQ_ARRNGE(10); END;
    ERROR at line 1:
    ORA-00904: "V_MOD": invalid identifier
    ORA-06512: at "SCOTT.PRO_SEQ_ARRNGE", line 29
    ORA-06512: at line 1The problem is that you can't refer to a local variable like V_MOD in a dynamic SQL statement. You'd need to use a bind variable
    SQL> ed
    Wrote file afiedt.buf
      1   CREATE OR REPLACE PROCEDURE PRO_SEQ_ARRNGE(P_ID NUMBER) AS
      2  V_MOD DUMMY.MODULE_ID%TYPE;
      3  v_query1 varchar2(200);
      4  v_query2 varchar2(200);
      5  V_COUNT NUMBER;
      6  begin
      7  v_query1 := 'drop sequence unqid';
      8  v_query2 := 'create sequence unqid start with 1 increment by 1 minvalue 1';
      9  SELECT COUNT(*)
    10  INTO V_COUNT
    11  FROM USER_SEQUENCES
    12  WHERE SEQUENCE_NAME = 'UNQID';
    13  IF V_COUNT = 0 THEN
    14  execute immediate v_query2;
    15  ELSE
    16  execute immediate v_query1;
    17  execute immediate v_query2;
    18  END IF;
    19  SELECT distinct MODULE_ID INTO V_MOD FROM DUMMY WHERE ID = P_ID;
    20  update dummy
    21  set P_order = 0, status = 'D'
    22  WHERE ID = P_ID
    23  and module_id = v_mod;
    24  --COMMIT;
    25  execute immediate 'UPDATE DUMMY SET P_ORDER = UNQID.NEXTVAL WHERE MODULE_ID = :1 AND STATUS = ''A'''
    26    using v_mod;
    27  --COMMIT;
    28* END PRO_SEQ_ARRNGE;
    29  /
    Procedure created.
    SQL> exec pro_seq_arrnge(10);
    PL/SQL procedure successfully completed.Of course, I'm not using the SYSTEM schema. You should really, really avoid SYS and SYSTEM-- things often work differently there than they do normally. I also join the other folks that have tried to help you in suggesting that creating a sequence dynamically in a procedure is a very poor idea and almost certainly indicates that you need to reconsider your design.
    Justin

  • Passing values to dynamically created internal table

    Hi,
    I have the flat file data as
    f1,f2,f3........so on
    where f1 f2 and f3 are field names.
    I have a variable var which contains the data
    V1,0001,0002.........so on
    data: var type string.
    The value of field f1 is v1
    The value of field f2 is 0001
    The value of field f3 is 0002.......so on
    FIELD-SYMBOLS:     <fs_1> TYPE STANDARD TABLE
    I have dynamically created an internal table for fields f1  f2 f3 ...... using 
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = lt_fieldcatalog
        IMPORTING
          ep_table                  = <fs_data>
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ASSIGN <fs_data>->* TO <fs_1>.
    Now for <fs_1> I have to pass the corresponding values of the fields f1 f2 f3 .
    How can i solve this.
    Thanks and regards ,
    Parvatha Reddy

    Hi,
    There is no data in <fs_1>.
    I need to pass the data form the string var to the fields of <fs_1>..
    I understand that you want to populate the internal table <fs_1>.
    for that you fist need work area.. use below statement to create work area..
    DATA: new_line TYPE REF TO data.
    CREATE DATA new_line LIKE LINE OF <fs_1>.
    ASSIGN new_line->*  TO <fs_2>.
    <fs_2> is not your work aread...
    to assign value to each field of you work aread <fs_2>. use statement
    ASSIGN COMPONENT 1 OF STRUCTURE <fs_2> TO <fs_3>.
    <fs_3> = f1 .
    now <fs_3> will point to the first field of work area <fs_2>, f1 is value from your string .. repeat above for each field in workarea, by increasing the component number. Once your work area is filled
    append it to table.
    append <fs_2> to <fs_1>
    apologies if I am not getting the requiremnt correctly..

  • Dynamic Internal table values read and assign it back

    Hi All,
            I want to get the internal table field name dynamically and fetch its value and do some calculation and asign the new value to the same field name.
           CONCATENATE '<WA_PIPE>-ZW' v_index INTO v_fld.
            CONDENSE v_fld NO-GAPS.
            FIELD-SYMBOLS <fs> TYPE ANY.
            ASSIGN (v_fld) TO <fs>.
            v_fld1 = <fs> * <wa_pipe>-zrate.
    Now i've the internal table field name as <WA_PIPE>-ZW1 in v_fld and v_fld1 is having the value of the same field.
    How to assign it to the internal table field.
    Thanks.
    Ashok

    *& Report  YY_TEST1
    REPORT  YY_TEST1.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
    <dyn_wa>.
    data: it_alvfc type slis_t_fieldcat_alv,
    wa_alvfc type slis_fieldcat_alv,
    it_fldcat type lvc_t_fcat,
    wa_fldcat type lvc_s_fcat.
    selection-screen begin of block b1 with frame title text-001.
      parameters: p_flds(5) type c.
    selection-screen end of block b1.
    start-of-selection.
    *build the dynamic internal table
    perform build_dyn_itab.
    *write 5 records to the alv grid
    do 5 times.
    perform build_report.
    enddo.
    *call the alv grid.
    perform call_alv.
    *Build_dyn_itab
    form build_dyn_itab.
    *Create the dynamic internal table
    data: new_table type ref to data,
    new_line type ref to data.
    *Create fields .
    do p_flds times.
    clear wa_fldcat.
    wa_fldcat-fieldname = sy-index.
    wa_fldcat-datatype = 'CHAR'.
    wa_fldcat-intlen = 5.
    append wa_fldcat to it_fldcat .
    enddo.
    *Create dynamic internal table and assign to FS
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = it_fldcat
    importing
    ep_table = new_table.
    assign new_table->* to <dyn_table>.
    *Create dynamic work area and assign to FS
    create data new_line like line of <dyn_table>.
    assign new_line->* to <dyn_wa>.
    endform.
    *Form build_report
    form build_report.
    *Fill some values into the dynamic internal table
    data: fieldname(20) type c.
    data: fieldvalue(5) type c.
    data: index(3) type c.
    field-symbols: <fs1>.
    do p_flds times.
    index = sy-index.
    *Set up fieldvalue
    concatenate 'FLD' index into
    fieldvalue.
    condense fieldvalue no-gaps.
    assign component index of structure <dyn_wa> to <fs1>.
    <fs1> = fieldvalue.
    enddo.
    *Append to the dynamic internal table
    append <dyn_wa> to <dyn_table>.
    endform.
    *CALL_ALV
    form call_alv.
    *Build FC for ALV
    loop at it_fldcat into wa_fldcat.
    wa_alvfc-fieldname = wa_fldcat-fieldname.
    wa_alvfc-seltext_s = sy-tabix.
    wa_alvfc-outputlen = wa_fldcat-intlen.
    append wa_alvfc to it_alvfc.
    endloop.
    *Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    it_fieldcat = it_alvfc
    tables
    t_outtab = <dyn_table>.
    endform.

  • Appending values to dynamically created fieldsymbol

    Hi ,
    I have a requirement to append values to dynamically created fieldsymbols
    from internal table   .
    I am using the following code but it dosnt work
    <F4> declared as line of <dyn_table>.
    loop at it_tab into wa_tab .( this contain the data to be appended to dyn fieldsymbol)
    loop at it_fieldcat into wa_fieldcat. ( this contains the fieldnames )
    case wa_final_fieldcat-FIELDNAME.
    when 'AAA'.
    v_field_name = 'AAA.
    when 'BBB'.
    v_field_name = 'BBB'.
    endcase.
    ASSIGN COMPONENT v_field_name of STRUCTURE wa_tab to <F4>.
    endloop.
    append <f4> to <dyn_table>
    ********************************************8
    But only get one value i.e field BBB  value appended to
    <dyn_table>.
    is there any way i can do the append to field symbol looping through internal
    table ?
    thanks
    raj

    i done it in alv so take the part you need .
    1) to create dynamic table  :  CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    also create dynamic fieldcatalog .
    2) you can pull data just one time from the DB to dynamic table
    so i take the data in regulare it table and in the and i put it
    in the dynamic table
    hope i help  , if you didnt understand some part  , say so  .
      DATA  : LT_FCAT   TYPE LVC_T_FCAT  ,
             lo_struct TYPE REF TO data,
               LV_STRUC_NAME TYPE TABNAME VALUE 'YMM_ST_TNUOT_MLY'.
    REFRESH ls_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          I_STRUCTURE_NAME       = LV_STRUC_NAME
          I_BYPASSING_BUFFER     = 'X'
        CHANGING
          CT_FIELDCAT            = IT_COLUM_HEADER
        EXCEPTIONS
          INCONSISTENT_INTERFACE = 1
          PROGRAM_ERROR          = 2
          OTHERS                 = 3.
      IF SY-SUBRC <> 0.
       MESSAGE e402(mo) WITH lv_struc_name.
        EXIT.
      ENDIF.
      DATA INDX(3) .
      IF G_COUNETR_NUMBER_OF_KOSTL > 0 .
        DO G_COUNETR_NUMBER_OF_KOSTL TIMES.
          INDX = SY-INDEX.
          SHIFT INDX LEFT DELETING LEADING SPACE.
          CONCATENATE 'KOSTL' INDX INTO LS_FCAT-FIELDNAME.
          LS_FCAT-INTTYPE    = 'I'.
          LS_FCAT-COL_POS =  27 +  SY-INDEX .
          CONCATENATE TEXT-028    INDX INTO LS_FCAT-COLTEXT.
          LS_FCAT-OUTPUTLEN = 10.
          APPEND LS_FCAT TO IT_COLUM_HEADER.
        ENDDO.
      ENDIF.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG           = IT_COLUM_HEADER
        IMPORTING
          EP_TABLE                  = GT_TABLE
        EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          OTHERS                    = 2.
      ASSIGN GT_TABLE->* TO <DYN_TABLE>.
    *--> Arbeitsbereich dynamisch erzeugen
      CREATE DATA LO_STRUCT LIKE LINE OF <DYN_TABLE>.
      ASSIGN LO_STRUCT->* TO <WA>.
      LOOP AT IT_COLUM_HEADER INTO LS_FCAT.
        IF LS_FCAT-FIELDNAME NE 'MANDT'.
          ADD 1 TO LS_FCAT-COL_POS.
          PERFORM TRANSLATE_HEADER.
          MODIFY IT_COLUM_HEADER FROM LS_FCAT.
        ENDIF.
      ENDLOOP.
    =============   assigning to dynamic table
    DATA  : FIELD(10)   ,
               INDX1(3) .
      DATA: WA_DREF TYPE REF TO DATA.
      DATA :  FS_SUM_GL LIKE LINE OF IT_YMM_ST_TNUOT_MLY.
      CREATE DATA LP_DATA LIKE LINE OF <DYN_TABLE>.
      ASSIGN LP_DATA->* TO <LS_LINE>.
      LOOP AT IT_YMM_ST_TNUOT_MLY.
        MOVE-CORRESPONDING IT_YMM_ST_TNUOT_MLY TO <LS_LINE>.
        INSERT <LS_LINE> INTO TABLE <DYN_TABLE>.
      ENDLOOP  .
      DATA L_COUNTER_ROLL TYPE I .
      LOOP AT <DYN_TABLE> INTO <LS_LINE> .
        MOVE-CORRESPONDING <LS_LINE> TO FS_SUM_GL.
        CLEAR : FIELD , INDX1 , L_COUNTER_ROLL .
        L_COUNTER_ROLL = 1 .
        LOOP AT IT_EKKN  WHERE EBELN = FS_SUM_GL-EBELN.
                        AND   EBELP = FS_SUM_GL-EBELP.
         IF SY-SUBRC  = 0  .
          INDX1 = L_COUNTER_ROLL.
          SHIFT INDX1 LEFT DELETING LEADING SPACE.
          CONCATENATE 'KOSTL'  INDX1 INTO FIELD .
          ASSIGN COMPONENT FIELD  OF STRUCTURE <LS_LINE> TO <FS1>.
          <FS1> = IT_EKKN-KOSTL .
          MODIFY <DYN_TABLE> INDEX SY-TABIX FROM  <LS_LINE> .
          L_COUNTER_ROLL = L_COUNTER_ROLL + 1 .
         ENDIF.
        ENDLOOP .
      ENDLOOP .

  • Dynamically assign value to bind variable in a view object before pageload

    I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
    I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
    The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
    Really need help on the issue, and I cannot believe that it is so hard to accomplish.
    Thank you very much,

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • How to assign a dynamic value to the value property of a button ?

    Hi Folks,
    I have a need, can i know how to assign a dynamic value to the value property of a button. Scenario is like follows...
    This is a struts based web application
    1. I have a file which consists of login user details (user name and his previlages) for a web application.
    2. I got those user details, into a List.
    3. When a user logged into the web app, in the home page there are few buttons. The type and number of buttons shown depends on the type of user/ user. (Buttons have different combination and the number of buttons available are not constant, they will vary from user to user).
    4. for each button, there will be a different action. I can pass the value of a button to an action class, but here button must have a dynamic value.
    Here is my test code:
    <%
    if (List != null)
    for (int i = 0; i <List.length; i++)
    %>
    <html:submit property="rduname" value= "<%=List%>" onclick="return submitRdu('<%=List[i] %>');"/>
    <%
    %>
    But my problem is how to assign a dynamic value to the value property of the button ( i know 'value= "<%=List[i]%>" ' will not work, just wanted show you guys).
    Thanks in advance,
    UV
    Edited by: UV_Dev on Oct 9, 2008 2:15 PM

    Let me try i know am not good at JSP but do we need double quotes here
    value= <%=List%>i think JSTL should help you about the dynamic thing                                                                                                                                                                                                                                                                                                                       

  • How to generate a PDF 417 Barcode by assigning a dynamic value at runtime?

    PDF 417 Barcode Description given in the Livecycle Designer 8.2
    : PDF 417 Non-Scriptable Barcode. Value must be assigned to this barcode at design time, and this barcode will not update after form object value changes.
    And my question is how to generate a PDF 417 Barcode by assigning a dynamic value at runtime?

    All the information you described points to the problem that reports seems can't generate to a file which already exist. You can verify that by simply doing
    r30run32 C:\AC_REPORT.REP DESTYPE = FILE DESFORMAT = PDF BATCH = YES' desname=c:\temp\ac_report.pdf
    several times. If first time the report is successfully generated in c:\temp\ac_report.pdf, but not the second, third time, then it looks like there is a bug on reports r30run32 executable.
    You may try to find any latest patch for Reports 3.0 to see if patch can solve you problem. But keep in mind Reports 3.0 is de-supported, you are better to move to 6i or 9i reports.
    Thanks,
    -Shaun

  • Dynamically create Value Objects from XML file

    Hi
    I want to create a value object from Xml file dynamically,like in the xml file i have the name of the variable and the datatype of the variable.is it possible do that,if so how.

    Read about apache's Digester tool. This is part of the Jakartha project. This tool helps in creating java objects from the XML files. I am not sure, if that is what u r looking for.

Maybe you are looking for