Conditional Columns in Select Statement for any type of Report

Okay so I had a requirement to conditionally show columns on a report when the data in the column was not null. I played around the "vertical" report mentioned in other posts but it didn't work well for my needs. Also I know that there is a javascript solution for this as demonstarted in Denes Kubicek's app (which was copied from Vikas :) ). Anyways listed below is my approach.... Hope this can help anyone else out as it's just pl/sql returning sql. Also you will need execute on dbms_sql for this to work.
declare
v_count number := 0;
v_row_count number := 0;
v_col_name varchar2(100);
q varchar2(4000) := 'select ';
v_table_name varchar2(100) := :SOME_TABLE_NAME;
v_id varchar2(100) := 'num = '||:SOME_APEX_VALUE;
my_c INTEGER;
fdbk INTEGER;
statement varchar2(2000);
cval_out varchar2(2000);
nval_out number;
begin
select count(*) into v_count from cols
where table_name = v_table_name;
for counter in 1..v_count
loop
select column_name into v_col_name
from cols where table_name = v_table_name
and counter = column_id;
statement := 'select count(*) '||
' from '||v_table_name||
' where '||v_col_name||' is not null and '||v_id;
my_c := dbms_sql.open_cursor;
dbms_sql.parse(my_c,statement,dbms_sql.native);
dbms_sql.define_column(my_c,1,nval_out);
fdbk := dbms_sql.execute(my_c);
LOOP
exit when dbms_sql.fetch_rows(my_c) = 0;
dbms_sql.column_value(my_c,1,nval_out);
end loop;
v_row_count := nval_out;
dbms_sql.close_cursor(my_c);
if v_row_count > 0 then
q:=q||v_col_name||',';
end if;
end loop;
if(substr(q,length(q),1) = ',') then
q:= substr(q,0,length(q)-1);
end if;
q:= q||' from '||v_table_name||' where '||v_id;
end;Hope this helps...
-David
Message was edited by:
rdpatric

Hi Gints,
Thank you for your reply. This is my query and
nvl(TICKET_JOIN.TDQRLV,0) ACC_SHIPPED_QTY,
TICKET_JOIN.TDSOQS QUANTITY_TICKETED are the columns tha's creating issue. If I comment those columns Index is accessed properly.
select
'TKT' SOURCE,
TICKET_JOIN.TKDO01 HIRE_ID,
TICKET_JOIN.TKQ101 TRUCK_ID,
TICKET_JOIN.TKVEHT TRUCK_TYPE,
1 TRUCK_COMM,
nvl(TKCMP1,0) TICKET_NUM,
nvl(TKADTM,0) TICKET_TIME,
--TICKET_JOIN.TDSOQS QUANTITY_TICKETED,
0 CHECKIN_TIME,
--nvl(TICKET_JOIN.TDQRLV,0) ACC_SHIPPED_QTY,
nvl(DDADTM,0) START_TIME
from
(select
TICKET.TKCMP1,
TICKET.TKDO01,
TICKET.TKQ101,
TICKET.TKADTM ,
TICKET.TKVEHT,
TICKET_DETAILS.TDAITM ,
TICKET_DETAILS.TDQRLV ,
TICKET_DETAILS.TDSOQS ,
TICKET.TKCNTF,
TICKET.TKTRDJ,
TICKET.TK58GA8
from
CRPDTA.F5800091 TICKET_DETAILS ,
CRPDTA.F5800090 TICKET
where TICKET.TKCMP1 = TICKET_DETAILS.TDCMP1
and TICKET.TKTRDJ = TICKET_DETAILS.TDTRDJ
and TICKET.TKTRDJ = 107085
and TICKET.TKEV12 <> 'Y'
and TICKET.TK58GA8='ECSEO'
and TICKET.TKCNTF = '11') TICKET_JOIN ,
(select
DDDOCO,
DDCNTF,
DDQTFN,
DDAITM,
DDADTM,
DD58GA8,
DDTRDJ
from
CRPDTA.F5800051 ORDER_DETAILS,
CRPDTA.F5800050 ORDER_HEADER
where
ORDER_HEADER.DHDOCO = ORDER_DETAILS.DDDOCO
and ORDER_HEADER.DHTRDJ = ORDER_DETAILS.DDTRDJ
and ORDER_HEADER.DH58GA8 = ORDER_DETAILS.DD58GA8
and ORDER_HEADER.DHDCTO = ORDER_DETAILS.DDDCTO
/*and
(ORDER_HEADER.DHTRDJ = 107085
OR (ORDER_HEADER.DHTRDJ = 107084 and ORDER_HEADER.DHEV04='Y')
and TRIM(ORDER_HEADER.DH58GA8) = 'ECSEO'
and TRIM(ORDER_DETAILS.DDCNTF) = '11' ) ORDER_VIEW
where TICKET_JOIN.TKTRDJ = ORDER_VIEW.DDTRDJ
and TICKET_JOIN.TDAITM = ORDER_VIEW.DDAITM
and TICKET_JOIN.TKCNTF = ORDER_VIEW.DDCNTF
and TICKET_JOIN.TK58GA8 = ORDER_VIEW.DD58GA8
and NOT EXISTS ( select 1 from CRPDTA.F5800120 TRUCK_ASSIGNMENT
where TATRDJ = 107085
and TACNTF = '11'
and TA58GA8 = 'ECSEO'
and TICKET_JOIN.TKQ101||TICKET_JOIN.TKVEHT = TAQ101||TAVEHT )
Thanks
GM

Similar Messages

  • Select statement for summing values in column?

    How to write a select statement for sap standard table which contains data  as given below
    col1        col2
    A     10
    A     20
    A     30
    B     50
    B     60
    C     70
    Need the output of select in  internal table as given below
    A     60
    B     110
    C     70
    Regards,
    Rachel

    Thanks for all the valuable input.
    Below I have used sum in select statement(check case 2"),but i am not getting required o/p.
    Kindly guide me.
    case1 :
    select aebeln aebelp bpackno  bmenge
    into corresponding fields of table itab
    from ( eslh as a inner join esll as b
    on bpackno = apackno )
    where a~ebeln = 6000000100
    and a~ebelp = 00010
    and a~packno = '0000001025'
    order  by aebeln aebelp b~packno .
    O/p for the above .
    ebeln                       ebelp         packno                             menge
    6000000100     00010     0000001025              6.000
    6000000100     00010     0000001025               5.000
    6000000100     00010     0000001025              2.000
    6000000100     00010     0000001025              1.000
    6000000100     00010     0000001025              2.000
    case2:
    select aebeln aebelp bpackno  sum( bmenge )
    into corresponding fields of table itab
    from ( eslh as a inner join esll as b
    on bpackno = apackno )
    where a~ebeln = 6000000100
    and a~ebelp = 00010
    and a~packno = '0000001025'
    group by aebeln aebelp b~packno
    order  by aebeln aebelp b~packno .
    6000000100     00010     0000001025     0.000
    Edited by: Rachel on Nov 25, 2008 11:45 AM
    Edited by: Rachel on Nov 25, 2008 11:46 AM

  • Define selection rule for Day type

    Dear Experts
        As I want to "Define selection rule" for "day types" in Time Management-> work schedule-> Day types-> define selection rule, the third and 4th columns are default weekdays of SAP, But weekend is different in our system. How can we handle this subject? Can we change these columns to our needs? How?
    For example we want to define that friday is not working day in our company and it should be payed, is there any other option?
    Thank you all,...

    Hi friend,
    Check:
    Time Management -> Work Schedules -> Period Work Schedules -> Define Period Work Schedules
    btw, you should check factory Holiday calendar (Tcode: SCAL) and generate Work schedule for year.
    IMG: Time Management -> Work Schedules -> Work Schedule Rules and Work Schedules -> Generate Work Schedules in Batch
    Regard,
    Michael.

  • How to write Select statement for this codition

    I need to check whether SGTXT contains BELNR value.
    SGTXT is a text field and It should be matched with BELNR
    How to write select statement for this.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT should have the given BELNR Value.
    Plz note : Here I cannot give as SGTXT = BELNR as coz BELNR have only 10 digits.

    Hi,
    data temp(12).
    concatenate '%' belnr '%' into temp.
    Select AUGBL AUGDT into t_BSAD
    from BSAD
    where SGTXT like temp.
    If belnr is having multiple values,just create a internal table as follows.
    types : begin of ty,
            belnr....
            temp(12),
            end of ty.
    data itab_ type standard table of ty.
    data wa type ty.
    loop at itab into wa.
    concatenate '%' wa-belnr '%' into wa-temp.
    modify itab from wa index sy-tabix transporting temp.
    endloop.
    Change your select statement accordingly.
    Kindly reward poits if it helps.

  • DISTINCT in SELECT statements for  Entities / Views - Oracle JDeveloper 11G

    Hi Steve,
    i have a question about using DISTINCT in SELECT statements for
    Entities / Views. On Oracle JDeveloper 11G ADF / BC4J
    --- This is unique---
    SELECT
    distinct(GC."course_title"),
    GC.SEC_GRP_PARENT_ID,
    from "grp_courses" GC
    --- This is NOT unique, but ROWID seems to be mandatory as PrimaryKey---
    SELECT
    distinct(GC."course_title"),
    GC.SEC_GRP_PARENT_ID,
    rowid
    from "grp_courses" GC
    How to use this query;
    SELECT
    distinct(GC."course_title"),
    GC.SEC_GRP_PARENT_ID,
    from "grp_courses" GC
    and yet still be able to use it in View / Entity without a Primary Key or some equivalent solution.
    Thanks & Regards,

    Hi, OK - I got it to work...
    Some notes:
    1) The View wizard cannot be initiated from the Entity Object.
    2) During the View wizard process - do not associate with Entity
    3) Selected columns must be mapped as expressions
    4) Using non-distinct columns will override the distinct function

  • How can I find Top music charts for any type of music? Reggae, French etc.

    Itunes used to have a way to see all the charts for any type of music. 60's, international, Latin, but I don't see a way to find this anymore. Can anybody help me?

    Charts by those categories no longer exist in the iTunes Store, unless they've been hidden somewhere I can't find. Most of those charts were compiled by Billboard and were removed at least a couple of years ago, probably due to licensing issues.
    You can, however, hover your cursor over the Music tab, click the arrow, and select the listed genres, and the page for that genre will list the Top Songs for that genre only.
    Regards.

  • Using OS X 10.6.8 on my IMac, I find that items on my message list no longer "fade" from dark to light when I click on them. I recently switched the font from Arial to Helvetica to permit me to select italics for any word. I am composing in rich text.

    Using OS X 10.6.8 on my IMac, I find that items on my message list no longer "fade" from dark to light when I click on them. I recently switched the font from Arial to Helvetica to permit me to select italics for any word. I am composing in rich text.

    Not sure why it would default to IMAP?  But any how, start the account anew, fill in the first page of info, but before clicking on the Create button, hold down the Option key until the Create button changes to read Continue.  Click continue, and proceed in a more manual process during which you can set the account type as POP.
    Ernie

  • Regarding select statement for this requirement

    Hi................
    good evening
    here is a requirement.
    i want to retrieve data from the following table.but how to join these table is my dought.
    tables  fields
    t001w--werks " plant id
    t001w--name1 " pl;ant name
    t001w--regio " plant address
    ekko--ebeln " purchase  order
    ekko-erdat : creation date
    ekko-ernam "name of the person
    ekpo-ebelp " item
    ekpo-bstyp "purchase order type
    eket-erdat " delivery date
    mara-matnr " material number
    these are the tables and fields.now we want to retrive data from these tables
    how we have to code select statement.
    selection-screen is
    plant id
    order type
    delivery date
    please provide select statement for this requirement.
    thanks and regards.
    k.swaminath  reddy.

    Is this what you are looking for?
    SQL> CREATE OR REPLACE FUNCTION f_team
      2  RETURN VARCHAR2
      3  IS
      4    s_return VARCHAR2(500);
      5  BEGIN
      6    FOR i IN ( select team from t_team order by 1) LOOP
      7      s_return := s_return || i.team || ', ';
      8    END LOOP;
      9   
    10    RETURN substr(s_return, 1, length(s_return) - 2);
    11  END;
    12  /
    Function created.
    SQL>  SELECT f_team FROM dual;
    F_TEAM
    Australia, Bangladesh, England, India, Kenya, Pakistan, South Africa, UAE, USA, West Indies, Zimbabwe
    SQL>

  • Need Select statement for fetch the details

    Hi
      i want to fetch particular customer wise sales orderds and that sales order No  and  date of sales order was created..  and  that sales order related PO No  and Materials ..
    for this..   how can i write an executable programm.. is it needed to  define seperate  internal tables or single internal table is enough  ?
    what is the select statement for fetching  all these details..
    any help will be appriciated
    Thanks
    Bbau

    custmer master table is KNA1  knb1  knbk
    sales data tables r  VBAK VBAP VBEP
    Material data  MARA, MARAC, MARD
    PO RELATED ekko  ekpo  eket
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:04 PM

  • Equivalent select statement for complex selection

    HI,
    What is the equivalent select statement for below mentioned condition.
    SELECT-OPTIONS : SALEDOCU FOR VBAK-VBELN OBLIGATORY,
                     DATE     FOR VBAK-ERDAT OBLIGATORY,
                     CHANEEL  FOR VBAK-VTWEG,
                     SALETYPE FOR VBAK-AUART OBLIGATORY DEFAULT 'QT'
                     NO INTERVALS NO-EXTENSION.
    Regards,
    John.

    hi,
    you can use following code.
    tables vbak.
    data : begin of t_vbak occurs 0.
             include structure vbak.
    data : end of t_vbak.
    select * from vbak into table t_vbak where
                            vbeln in saledocu and
                            erdat in date and
                            vtweg in chaneel and
                            auart in saletype.
    Hope this helps.
    Regards,
    Shashank

  • For any type selector

    This might be covered elsewhere in the forum but my searches have been fruitless.
    Given:
    public Object genKey(Class clazz) {
    }and
    public interface Keyed<K> {
      public void setKey(K key);
      public Class<K> keyClass();
    }this is a valid use:
      Keyed<X> keyed = ...;
      Object key = genKey(keyed.keyClass());
      keyed.setKey(keyed.keyClass().cast(key));
    ...Now, say I have some framwork code that checks that an arbitrary object implements Keyed and assigns a key if it does:
    if ( Keyed.class.isAssignableFrom( obj.getClass() ) {
      Keyed keyed = (Keyed)obj;
      Object key = genKey(keyed.keyClass());
      keyed.setKey( keyed.keyClass().cast(key));
    ...Of course, the call to setKey generates a warning. But there is enough information there for the compiler to determine that the call is type-safe.
    What I seek is a way to declare the variable keyed with the semantics "for any type Y" as the generic selector. A wildcard doesn't work because it doesn't provide a handle to the selected type.
    Is there some way to to express this meaning in Java 5 or am I stuck with the warning?
    if ( Keyed.class.isAssignableFrom( obj.getClass() ) {
      Keyed<any Y> keyed = (Keyed)obj;
      Object key = genKey(keyed.keyClass());
      keyed.setKey( keyed.keyClass().cast(key));
    }Tia,
    -=greg

    I omitted some explanation to keep it simple, but I probably made it less clear.
    this is a valid use:
    What do you mean by "valid use"? Do you mean it
    "compiles"? Of course, it does compile, as cast()
    takes any Object as parameter, regardless if the cast
    will succeed.I understand this. By valid, I mean the it is type-safe from the compiler's
    point of view. I know that an invalid cast will throw an exception at runtime
    and that by using the cast call, I assume responsibility.
    if ( Keyed.class.isAssignableFrom( obj.getClass()  )
    Keyed keyed = (Keyed)obj;
    Object key = genKey(keyed.keyClass());
    keyed.setKey( keyed.keyClass().cast(key));
    ...Of course, the call to setKey generates a warning.
    But there is enough information there for the
    compiler to determine that the call is type-safe.No, it's not. You are using raw type Keyed here, so
    there is no type-safety involved. The cast may
    succeed or fail, who knows? Again, just talking about the compile-time safety interpretation here. Ignore
    the potential runtime exceptions.
    There is enough information here in the sense that any Class instance
    returned from the keyClass() call is guaranteed to be compatible with the
    parameter type of the setKey(..) call--according to the interface definition
    alone. The interface implementation could, of course, return all kinds of
    wrong things. But the issue I was trying to address in this post has only to do
    with the compiler warning issued in the setKey(..) call.
    You can use Keyed<T> keyed = (Keyed)
    obj; so you actually see the origin of the
    warning. Information on T only is available at
    compile-time. There is no Keyed<T>.class, so you can
    neither test its assignability nor cast to it. Hence,
    the warning about erasure. The rest of your code
    still remains the same, unsafe code, while the
    compiler gets forced to accept it as type safe.I know this. I am simply trying determine if there is a way to, as a
    compile-time benefit only, introduce a binding of the "for any" kind. It is a
    useful semantic that I don't think is available in the language.
    A first thing would be to parametrize genKey, e.g.:
    public <T> T genKey(Class<T> clazz) throws
    InstantiationException, IllegalAccessException {
    return clazz.newInstance();
    And, indeed, it is actually implemented in such a fashion--I provided the
    version I did because it spells out the problem more clearly. The problem
    is that in the framework code snippet ONLY, there is no way to express the
    selector because, as you have pointed out, it cannot be determined.
    So, the original question is the same--and I think the answer is probably
    "no": can an arbitrary selector be introduced with the meaning "for any?"
    Wildcarding is inches from being the right meaning but there is no selector
    introduction.
    Secondly, you will have to define a type to be used
    in the context, so you can connect outcomes to a
    @SuppressWarnings("unchecked")
    Keyed<T> keyed = (Keyed) obj;
    Right. Doing this is closest to what I was seeking but it is not a true
    representation of the semantic (i.e. it still generates a warning).
    So, what I'm hearing so far is, "no, there is not a syntactic construct that will
    express a 'for any selector' concept other than to force it and accept the
    resulting warning." That answer is fine with me, I just didn't want to miss out
    on any better way.
    -=greg

  • Select statement for retrieving infotype 1005 values w,r,t payscale

    Hi All,
    could you pls help me for the below requirement
    "select statement for retrieving infotype 1005 values with respect to the pay scale level.
    because pay scale level is having range of values in the infotype"
    Thanks in advance
    Prasad
    Please try it yourself first.
    Edited by: Suresh Datti on Aug 9, 2009 4:52 PM

    Hi,
    Code which you have written is correct when the R_DATE is having LOW and HIGH values, if the R_DATE is having only LOW value then this will be wrong, becuse if the R_DATE is having only LOW then OPTION value is not BT is should be EQ
    Regards
    Sudheer

  • Change Field selection group for Movt type 701

    Hi experts,
    I want to change Field Selection group for movt type 701.  Right now " Business Area " & " Cost Centre " fields are suppressed.  I want to change it to required entry.
    Please guide me over this
    Regards,
    Rajneesh Gulati

    the note explaines it:
    In Customizing an account assignment can be made for every inventory
    adjustment account. To do this the inventory adjustment account must
    first be defined as a cost element (Transaction KA01 / KA06):
    Accounting -> Controlling -> Cost centers -> Master data -> Cost element
    -> Create primary / secondary. Then an account assignment can be made
    for the cost element (Transaction OKB9):
    Tools -> Customizing -> Setup menu -> Accounting -> Controlling -> Cost
    centers -> Actual postings -> Automatic account assignment.
    If this account assignment is implemented every posting to the
    particular inventory adjustment account will automatically receive the
    appropriate account assignment.

  • Are there any types in report layouts ?

    Hello there,
    I want to know if any types in report layouts ?
    If a report type and report layout are same as one another ? If not what is the difference ?
    Help appreciated

    Hi,
    Please refer to the reports documentation as it should answer your questions.
    Oracle Reports Documentation
    http://www.oracle.com/technetwork/middleware/reports/documentation/reports-087551.html
    Thanks,
    Hussein

  • Field symbols as Table name and in where condition in a select statement

    Hello All,
    I have a scenario where I need to get user input on table name and old field value and new field value. Then based on user input, I need to select the record from the database. The column name for all the tables in question is different in the database, however there data type is the same and have same values.
    I am not able to use a field symbol for comparing the old field value to fetch the relevant record in my where clause.
    I cannnot loop through the entire table as it has 10 millilon records, please advice on how to add the where clause as field symbol as the table name is also dynamically assigned.
    Here is my code:
    DATA: TAB       LIKE SY-TNAME,
          TAB_COMP1 LIKE X031L-FIELDNAME,
          TAB_COMP2 LIKE X031L-FIELDNAME,
          NO_OF_FLD TYPE N.
    DATA: BEGIN OF BUFFER,
            ALIGNMENT TYPE F,
            C(8000)   TYPE C,
          END OF BUFFER.
    FIELD-SYMBOLS: <WA>   TYPE ANY,
                  <COMP1> TYPE ANY,
                  <COMP2> TYPE ANY.
    GET TABLE NAME GIVEN BY USER IN LOCAL VARIABLE
      TAB = TAB_NAME.
    CREATE FIELD NAME BASED ON THE TABLE NAME ENTERED.
      CASE TAB_NAME.
      WHEN 'OIUH_RV_GL'.
          KEY FIELD
            TAB_COMP1  = 'GL_GL_SYS_NO'.
            NO_OF_FLD  = 1.
      WHEN 'OIUH_RV_OPSL'.
          KEY FIELD
            TAB_COMP1  = 'OPSL_GL_SYS_NO'.
            NO_OF_FLD  = 1.
      WHEN 'OIUH_RV_OTAX'.
          NOT THE ONLY KEY FIELD
            TAB_COMP1  = 'OTAX_GL_SYS_NO'.
            TAB_COMP2  = 'OTAX_TAX_POS_NO'.
            NO_OF_FLD  = 2.
      WHEN 'OIUH_RV_GTAX'.
          NOT THE ONLY KEY FIELD
            TAB_COMP1  = 'GTAX_GL_SYS_NO'.
            TAB_COMP2  = 'GTAX_TAX_POS_NO'.
            NO_OF_FLD  = 2.
      WHEN OTHERS.
            EXIT.
      ENDCASE.
    SET FIELD SYMBOL WITH APPROPRIATE TYPE TO BUFFER AREA.
    ASSIGN BUFFER TO <WA> CASTING TYPE (TAB).
    How to add where clause and remove the if condition in the select -- endselect
    SELECT * FROM (TAB) INTO <WA>. 
      ASSIGN COMPONENT TAB_COMP1 OF STRUCTURE <WA> TO <COMP1>.
      IF NO_OF_FLD = 2.
        ASSIGN COMPONENT TAB_COMP2 OF STRUCTURE <WA> TO <COMP2>.
      ENDIF.
      IF <COMP1> = OLD_SYS_NO.
        code for updating table would come here
          WRITE: 'MATCH FOUND'.
          EXIT.
      ENDIF.
    ENDSELECT.
    Please advice. Thanks much.
    Edited by: Shipra Jhunjhunwala on Jul 22, 2009 1:33 PM
    Edited by: Shipra Jhunjhunwala on Jul 22, 2009 1:34 PM
    Edited by: Shipra Jhunjhunwala on Jul 22, 2009 1:35 PM

    1. Create single column table for holding field name depending on the table entered.
    2. Take input from user: for e.g. table_name
    3. Using case load single column table with required fields
       for e.g.
      CASE TAB_NAME.
       WHEN 'OIUH_RV_GL'.
             Append 'GL_GL_SYS_NO' to KEY_FIELD --> KEY_FIELD is the single line internal table as mentioned in step 1.
       WHEN 'OIUH_RV_OPSL'.
             Append 'OPSL_GL_SYS_NO'.
       WHEN 'OIUH_RV_OTAX'.
             Append 'OTAX_GL_SYS_NO' to KEY_FIELD.
               APPEND 'OTAX_TAX_POS_NO' to KEY_FIELD.
       WHEN 'OIUH_RV_GTAX'.
             Append 'GTAX_GL_SYS_NO' to KEY_FIELD.
               APPEND 'OTAX_TAX_POS_NO' to KEY_FIELD.
       WHEN OTHERS.
          EXIT.
       ENDCASE.
       Now depending on the table name you have required column ready
    4. Create dynamic internal table using following sudo code
       Fill the fieldcatlog using the single column field table and DD03L table, See what all columns from DD03L you want to fill in field catlog table
       loop at internal table with all the fields.
        move it to field catalog.
        append field catalog.
       endloop.
    5. Pass this field catalog table to static method create_dynamic_table method
       DATA table TYPE REF TO DATA. --> data object for holding handle to dynamic internal table.
       call method cl_alv_table_create=>create_dynamic_table
       exporting
          it_fieldcatalog = fieldcatalog_tab
       importing
          ep_table = table.
    6. Now assign table reference to field symbol of type table.
       ASSIGN table->* to <field-tab>.
    7. Also create work area <field-wa> using refrence of table.
       create data object wa LIKE LINE OF <field-tab>.
       ASSIGN wa->* to <field-wa>.
    8. Also define field symbol for field name.
       for e.g. <field_name>
    4. Dynamic internal table is ready
    5. Now execute the select statement as follows:
       SELECT (KEY_FIELD)
         INTO <ITAB> --> created dynamically above
          FROM (TABLE_NAME)
         WHERE (WHERE).  --> WHERE is single line internal table having line type of CHAR72. So for every old value there will be one line
         Where condition is same as like we give in static way only difference in this case it will stored in internal table line wise.
        In this case you need to append all your where condition line by line in to WHERE.     
    5. To fill this dynamic internal table using ASSIGN COMPONENT <Comp_number> OF STRUCTURE <field-wa> TO <field-name>
       So in this case if first field of structure STRUCT1 is user_id then sudo-code will be
       loop at internal table containing list of fields into field_wa --> single column field table
           ASSIGN COMPONENT field_wa OF STRUCTURE <field-wa> TO <field>. "Here field_wa is wa area for single column internal table holding all the fieldnames.
           Now <field-name> points to user_id field. Move some value into it as nornally we do with variables.
           Move <your_new_value> to <field-name>. --> Assign new value
            or
            <field-name> = <your_new_value>.
       Endloop.
    6. After completing all the fields one row will be ready in <field_wa>.
       APPEND <field_wa> to <field_tab>.
    Hope this helps you.
    Thanks,
    Augustin.

Maybe you are looking for

  • Deleting users in OID

    I have a trouble in OID (AS 9.0.4, SLES9). A succesfully synced AD and OID, but a part of AD users don't contain userPrincipalName, and uid in OID won't created and now I must delete them. How can I delete more than one user in oidadmin? After search

  • SQ01 ALV DISPLAY WHEN USING LOGOCAL DATABASE

    Dear All, I'm using a logical database (EMM) to build a query in SQ01, I need an ALV display. If I use only three tables of the logical database hierarchy it works fine, but as soon as I try to use a fourth one, then the ALV display does not work any

  • Mobile email 4.0 and LG Dare

    Hello, Was excited to see the improvements to Mobile email 4.0.  I have an LG Dare and was wondering if it will utilize this new version as well as the currently available feature phones?   Thanks.

  • Issue with gamecenter settings

    it looks like I'm having an issue with GameCenter: * Notifications are off. Even though I still get audible and visual notifications on every inivitation. * Getting invitations at all is somewhat puzzling, because I set myself to disallow game invita

  • Best way to open arw files on iMac or iPhoto?

    Hi, I recently bought a Sony NEX-3n and I had no idea about the different raw file formats. I was wondering what the best solution is to upload raw photos onto my imac (all updated software and OS X). I've read about converters, but I'm leary of just