Append screen inserted row to internal table

Hi Experts,
I have created a program using table control. But after filling a row when i press enter the entire row getting blank.
So i need to append the last inserted row from table control to internal table so that when i press enter that row remains on screen.
Thanks & Regards
Ashutosh Katara

Hi,
try this code  in PAI,
IF sy-ucomm = 'ENTER'.
  if  tabc-col1 is NOT INITIAL and
     tabc-col2 is NOT INITIAL and
    tabc-col3 is NOT INITIAL and
     tabc-col4 is NOT INITIAL.
    w_tab-field1 =  tabc-col1.
    w_tab-field2 = tabc-col2.
    w_tab-field3 = tabc-col3.
    w_tab-field3 =  tabc-col4.
   modify <itab> FROM <workarea> INDEX sy-tabix.
ENDIF.
ENDIF

Similar Messages

  • Error while inserting rows in a table

    Hi,
    We have recently migrated from 9i to 10g. We have a scheduled job out our DB which first deletes all the rows from a table and then inserts them back by selecting rows from 5 tables. This table has a composite primary key based on 6 columns in it. In 9i, when i try to insert rows into the table after deleting all the rows from it, I am able to insert the data successfully . However, in 10g, when i try doing the same operation, it fails with the ORA error:
    ORA-00001: unique constraint violated
    The same query which works perfectly in 9i fails in 10g
    If anybody has some ideas on how to resolve the same, kindly let me know.
    Thanks in advance.

    Hi,
    I was finally able to resolve the reason behind that error message and found it even more weird. The error was because I was using the substr function for extracting the characters 1-4 from a column which is 5 characters long. When i specify the query as:
    select substr(column1, 1, 4)) from table1;
    only the characters 1-3 are retrieved. Now if i change the query to select substr(column1, 1, 5)) from table1, in that case also only 3 characters are retrieved although i have specified the substr to start from 1 and read till 5 characters. Also, when i run the query:
    select length(substr(column1, 1, 4)) from table1 or select length(substr(column1, 1, 5)) from table1
    I get the answer as 3.
    However, the most amazing part is that the query is working perfectly in 9i and is retrieving the data correctly i.e. from substr 1-4.
    Can anyone suggest what the problem could be?
    Thanks
    Edited by: CrazyAnie on May 13, 2009 1:34 AM

  • Need to insert rows into 100 tables at a time

    hi there,
    below is our script for creation of 100 tables...
    we need a plsql script, to insert rows into 100 tables at a single time...
    please help us...vey urgent...
    DECLARE
    counter NUMBER;
    sql_string VARCHAR2(2000);
    BEGIN FOR counter IN 1..100 LOOP sql_string := 'CREATE TABLE emp_table'||counter||'
    (id integer primary key, col_a VARCHAR2(42),col_b date,col_c number,col_d varchar2(20),col_e varchar2(20),
    col_f varchar2(20),col_g varchar2(20),col_h date,col_i varchar2(20),col_j varchar2(20),col_k date)';
    EXECUTE IMMEDIATE sql_string;
    END LOOP;
    END;
    /

    hi,
    below is our procedure and the error we are getting...
    Name Null? Type
    ID VARCHAR2(10)
    COL_A VARCHAR2(10)
    COL_B VARCHAR2(10)
    COL_C VARCHAR2(10)
    COL_D VARCHAR2(10)
    COL_E VARCHAR2(10)
    COL_F VARCHAR2(10)
    COL_G VARCHAR2(10)
    COL_H VARCHAR2(10)
    COL_J DATE
    DECLARE
    counter NUMBER;
    sql_string VARCHAR2(4000);
    BEGIN FOR counter IN 1..100 LOOP sql_string := 'CREATE TABLE emp_a'||counter||'
    (id varchar2(10), col_a varchar2(10), col_b varchar2(10), col_c varchar2(10), col_d varchar2(10), col_e varchar2(10),
    col_f varchar2(10), col_g varchar2(10), col_h varchar2(10), col_j date)';
    EXECUTE IMMEDIATE sql_string;
    END LOOP;
    END;
    DECLARE
    counter NUMBER;
    sql_string VARCHAR2 (2000);
    BEGIN
    FOR OuterCounter IN 1 .. 100 LOOP --- table prefix in which it is to be inserted
    FOR InnerCounter IN 1 .. 100 LOOP --- records to be inserted
    sql_string := 'INSERT INTO emp_a' || Outercounter || ' (id, col_a, col_b, col_c, col_d, col_e, col_f, col_g, col_h, col_j)
    VALUES ('
    || InnerCounter || ', to_char( ''col_a''' || innercounter || '),'
    || InnerCounter || ', to_char( ''col_d''' || innercounter || '),'
    || ', to_char( ''col_e''' || innercounter || '),'
    || ', to_char( ''col_f''' || innercounter || '),'
    || ', to_char( ''col_g''' || innercounter || '),'
    || ', to_char( ''col_h''' || innercounter || '),'
    || ', to_char( ''col_j''' || innercounter || '), SYSDATE)';
    EXECUTE IMMEDIATE sql_string;
    END LOOP;
    END LOOP;
    END;
    DECLARE
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    ORA-06512: at line 17
    please check the procedure and write the correct one...

  • Help in inserting rows into a table

    I have a table called acct_fact,
    I need to insert rows in the table using a script but the problem is there's a column called seq_nbr which has random seq nbr of 14character length like 'ZWX98MGD9MVAD6J','ZWX98MG67RVAD6J' etc.,
    While inserting rows I need to generate such seq_nbr for those columns and insert rows into the table, can I use any such mechanism in my insert query to insert such random nbr's while inserting rows into a table.
    If so please suggest me

    Hi Peter,
    Thankyou for the quick reply:)
    can you suggest me how to implement it here in my script snippet:
    while read var_acct_nbr
    do
    echo "update acct_attr set acct_attr_exp_dt ='$ExpDate' where Acct_Attr_Value_Text='15' and acct_attr_exp_dt is null and person_id='LDCarrBillAgrm' and acct_nbr='$var_acct_nbr' ;" >> ./$DirectoryName/SQLQuery_$TimeStamp.sql
    echo "insert into acct_fact values ('$var_acct_nbr','$ExpDate','$ExpTime','*seq_nbr*','N','ProjTereza','Remoção de acordo d; data de expiração: $ExpDate',null,'1','LDE',null);" >> ./$DirectoryName/SQLQuery_$TimeStamp.sql
    done < ./$DirectoryName/ExpireAccts_$TimeStamp.LOG
    the script takes each acct_nbr nbr form a input file and fires an insert statement.
    The one in bold is the column where such sequence need to be inserted.can you help me in implementing the way you suggested in my script i.e., insert statement
    Thanks in Advance:)
    Edited by: rkrish on Jun 27, 2012 3:04 AM

  • Inserting records from internal table to database table

    Hi all,
    i want to insert records from internal table to zDatabase table, can u plz guide me which statement is better in performance to insert the records.
    1) insert one by one record from internal table
    loop at itab.
    insert ztable from wa.
    endloop.
    2) insert total records at a time
    INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or let me know if any other statement is there with high performance.
    i internal table contains nearly 40000 records.
    thanks.

    Hi,
    Insert the entire table at atime rather than a record so as to increase the performance.
    you can use INSERT <dbtabname> CLIENT SPECIFIED FROM TABLE itab.
    or
    MODIFY ZPRODUCT FROM TABLE GI_AFPO.
    Regards,
    Raj.

  • Last Inserted Row in a Table

    Hi,
    I want to select only the last inserted row in a table. Can anybody help me how can i get it.
    Eg
    select * from emp;
    empno ename sal
    12 abc 100
    13 xyz 200
    Now i have inserted a row as
    Insert into emp values (14,'Rohit',500);
    So i only want to select the last inserted row i.e.. empno 14 (in this case).
    Thanks
    Bye
    Rohit Taneja

    Thanks to all for replying.
    But the result is not which i desire.
    I have deleted the existing row in the same table as
    SQL> Delete from emp where empno = 13;
    1 row deleted.
    Then i inserted a new row as
    SQL> insert into emp values(10,'SRI',200);
    1 row created.
    Then i committed the work
    SQL> commit;
    Commit complete.
    But still am getting the last row as
    SQL> select * from emp
    where rowid=(select max(rowid)
    from emp);
    EMPNO ENAME SAL
    14 ROHIT 500
    as the solution.
    But here i am supposed to get the row with empno 10.
    I have tried both the queries and still geting the same result.
    Please look aat it again,
    Thanks in advance
    Bye
    Rohit Taneja
    Hi,
    I want to select only the last inserted row in a
    table. Can anybody help me how can i get it.
    Eg
    select * from emp;
    empno ename sal
    12 abc 100
    13 xyz 200
    Now i have inserted a row as
    Insert into emp values (14,'Rohit',500);
    So i only want to select the last inserted row i.e..
    empno 14 (in this case).
    Thanks
    Bye
    Rohit Taneja

  • Determine Number of  rows in Internal Table

    Hi,
      I have defined my internal table as follows:
         TYPES : BEGIN OF ABC_KEY,
                  FIELD1(2)   TYPE C,
                  FIELD2(1)   TYPE C,
                  FIELD3(8)   TYPE N,
                  END OF ABC_KEY.
    DATA: itab1 TYPE TABLE OF ABC_KEY
                      WITH KEY FIELD1,
           wa_lines_1 LIKE LINE OF itab1.
    How can I retrieve the number of rows in Internal Table?
    Thanks.
    Regards,
    bw_newbie

    You can define the number of rows of the internal table using the DESCRIBE itab command .
    As the rest have already stated a sample code snippet .
    For more info type in DESCRIBE in your prgram and click on (F1) by placing the cursor on DESCRIBE .
    You will find more options as to how you can use the DESCRIBE command according to your requirement .
    Thanks ,
    Hari

  • Adding 2 more rows to a select without inserting rows to base table

    hello all,
    i have a below simple select statement which is querying a table.
    select * from STUDY_SCHED_INTERVAL_TEMP
    where STUDY_KEY = 1063;
    but here is the situations. As you can see its returning 7 rows. But i need to add
    2 more rows..with everything else default value or what exist... except adding 2 more rows.
    i cannot insert into base table. I want my end results to increment by 2 days in
    measurement_date_Taken to 01-apr-09....so basically measurement_date_taken should
    end at study_end_Date...
    IS THAT EVEN POSSIBLE WITHOUT INSERTING ROWS INTO THE TABLE AND JUST PLAYIHY AROUND WITH
    THE SELECT STATEMENT??
    sorry if this is confusing...i am on 10.2.0.3
    Edited by: S2K on Aug 13, 2009 2:19 PM

    Well, I'm not sure if this query looks as good as my lawn, but seems to work anyway ;)
    I've used the 'simplified version', but the principle should work for your table to, S2K.
    As Frank already pointed out (and I stumbled upon it while clunging): you just select your already existing rows and union them with the 'missing records', you calculate the number of days you're 'missing' based on the study_end_date:
    MHO%xe> alter session set nls_date_language='AMERICAN';
    Sessie is gewijzigd.
    Verstreken: 00:00:00.01
    MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn
      2  select 1063 study_key
      3  ,      to_date('01-MAR-09', 'dd-mon-rr') phase_start_date
      4  ,      to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken
      5  ,      to_date('01-APR-09', 'dd-mon-rr') study_end_date
      6  from dual union all
      7  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      8  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
      9  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
    10  select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
    11  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all
    12  select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual
    13  ) -- actual query:
    14  select study_key
    15  ,      phase_start_date
    16  ,      measurement_date_taken
    17  ,      study_end_date
    18  from   t
    19  union all
    20  select study_key
    21  ,      phase_start_date
    22  ,      measurement_date_taken + level -- or rownum
    23  ,      study_end_date
    24  from ( select study_key
    25         ,      phase_start_date
    26         ,      measurement_date_taken
    27         ,      study_end_date
    28         ,      add_up
    29         from (
    30                select study_key
    31                ,      phase_start_date
    32                ,      measurement_date_taken
    33                ,      study_end_date
    34                ,      study_end_date - max(measurement_date_taken) over (partition by study_key
    35                                                                          order by measurement_date_taken ) add_up
    36                ,      lead(measurement_date_taken) over (partition by study_key
    37                                                          order by measurement_date_taken ) last_rec
    38                from   t
    39              )
    40         where last_rec is null
    41       )
    42  where rownum <= add_up
    43  connect by level <= add_up;
    STUDY_KEY PHASE_START_DATE    MEASUREMENT_DATE_TA STUDY_END_DATE
          1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00
          1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00
          1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00
    9 rijen zijn geselecteerd.If there's a simpler way (in SQL), I hope others will join and share their example/ideas/thoughts.
    I have a feeling that this is using more resources than needed.
    But I've got to cut the daisies first now, they interfere my 'lawn-green-ess' ;)

  • How to append  row in internal table for perticular condition

    Hi,
    I have 4 records in my internal table and i want to append row
    after second row when condition will match.
    please guide me.
    thanks in advancs
    regards
    SND

    hi,
    using key word INDEX u can insert a record in aspecified position as
    if internal table is with header line.
    INSERT <internaltable> index SY_INDEX [or index no if u  know where to insert]
    with out header line.
    INSERT <internaltable> FROM <workarea> index SY_INDEX [or index no if u  know where to insert]
    if condition is true.
    insert itab index 2.
    endif.
    if helpful reward some points.
    with regards,
    Suresh.A

  • Appending empty rows in internal table

    Hi,
      i am using table control, where there is a condition, some row may left empty. end if i press enter button the empty row is filled by the next available record. My need is to pick the records in the table control to the internal table including the empty rows as it is.

    Hi Karthikeyan,
    By default with user pressinng enter, empty rows will get deleted.
    How are you populating your table control? Is it from standard transaction or your internal table?
    If it is from your internal table, you can add anothe flag field for empty row.
    Whenever row is empty in your internal table, mark flag field as 'X', so in the table control you these entries will not get vanished with pressing of enter.
    This is one idea and you can build on this. You can make this flag column as non editable so that no one can change these.
    hope this helps,
    ags.

  • How to add a group of rows in internal table

    Hi champs,
       I have some requirement.
    I have one internal table which contain 4 columns .out of which 3 has some numeric value and first has some letters e.g A ,B,C etc.
    Now suppose i have 20 rows in itab in which 10 are A 5 are B and 5 are C .Now as column 3 has numeric values i need to get the total of column 3 for all A ,B and C .
    How to solve this problem.Please guid me.
    thanks in advance
    Jhon

    Hi,
    Check the following code:
    DATA: BEGIN OF LINE,
    COL1 TYPE C,
    COL2 TYPE I,
    COL3 TYPE I,
    END OF LINE.
    DATA ITAB LIKE HASHED TABLE OF LINE
    WITH UNIQUE KEY COL1 COL2.
    LINE-COL1 = 'A'.
    DO 3 TIMES.
    LINE-COL2 = SY-INDEX.
    LINE-COL3 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    LINE-COL1 = 'B'.
    DO 3 TIMES.
    LINE-COL2 = 2 * SY-INDEX.
    LINE-COL3 = ( 2 * SY-INDEX ) ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    SORT ITAB.
    LOOP AT ITAB INTO LINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    AT END OF COL1.
    SUM.
    ULINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    SKIP.
    ENDAT.
    AT LAST.
    SUM.
    ULINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    ENDAT.
    ENDLOOP.
    Regards,
    Bhaskar

  • How to convert rows of internal table to columns of another internal table?

    Hi,
    Experts,
    test_data.xls:
    one two three four five
    one two three four
    one two three
    one two
    one
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        FILENAME                      = 'c:/test_data.xls'
        I_BEGIN_COL                   = '1'
        I_BEGIN_ROW                   = '1'
        I_END_COL                     = '10'
        I_END_ROW                     = '10'
      TABLES
        INTERN                        = it_tab
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3
    output:
    0001 0001 one
    0001 0002 two
    0001 0003 three
    0001 0004 four
    0001 0005 five
    0002 0001 one
    0002 0002 two
    0002 0003 three
    0002 0004 four
    0003 0001 one
    0003 0002 two
    0003 0003 three
    0004 0001 one
    0004 0002 two
    0005 0001 one
    but i want this format:
      one two three four five
    one two three four
    one two three
    one two
    one
    i don't want this type of output display i want to display in ABAP report as in file format how can i achieve this post some ideas on it.
    Thank U,
    Shabeer ahmed.

    Hi,
    Use this piece of code :
    parameters:  p_flname type rlgrap-filename.
      data:
             li_filecontent  type standard table of alsmex_tabline ,
             lwa_filecontent type  alsmex_tabline ,
             lv_begin_col    type i value 1,
             lv_begin_row    type i value 1,
             lv_end_col      type i value 17,
             lv_end_row      type i value 65000,
             li_fieldlist    type lvc_t_fcat,
             li_data         type ref to data,
             dy_line         type ref to data.
      field-symbols:<dyntable> type standard table,
                    <fs_data> type ref to data,
                    <fs_1>,
                    <dyn_wa>,
                    <dyn_field>.
    *Transfer excel file contents to internal table
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        exporting
          filename                = p_flname
          i_begin_col             = lv_begin_col
          i_begin_row             = lv_begin_row
          i_end_col               = lv_end_col
          i_end_row               = lv_end_row
        tables
          intern                  = li_filecontent
        exceptions
          inconsistent_parameters = 1
          upload_ole              = 2
          error_message           = 3
          others                  = 4.
      if sy-subrc = 0.
    *Creating the list of fields in the table
        perform f_create_tab_field tables li_fieldlist using 'BUKRS'      4 .
        perform f_create_tab_field tables li_fieldlist using 'ZPOC_KUNNR' 10 .
        perform f_create_tab_field tables li_fieldlist using 'RANL'       13.
        perform f_create_tab_field tables li_fieldlist using 'ZPEDAT'     10 .
        perform f_create_tab_field tables li_fieldlist using 'KWERT'      15 .
        perform f_create_tab_field tables li_fieldlist using 'BONUS'      2 .
        perform f_create_tab_field tables li_fieldlist using 'WAERS'      5 .
        perform f_create_tab_field tables li_fieldlist using 'ZVAL'       15 .
        perform f_create_tab_field tables li_fieldlist using 'ZQTY'       15 .
        perform f_create_tab_field tables li_fieldlist using 'KMEIN'      3 .
        assign li_data to <fs_data>.
    *CREATING INTERNAL TABLE TO store data
        call method cl_alv_table_create=>create_dynamic_table
          exporting
            it_fieldcatalog           = li_fieldlist
          importing
            ep_table                  = <fs_data>
          exceptions
            generate_subpool_dir_full = 1
            others                    = 2.
        if sy-subrc = 0.
          assign <fs_data>->* to <fs_1>.
          assign <fs_1> to <dyntable>.
    Create dynamic work area and assign to FS
          create data dy_line like line of <dyntable>.   " creating a line type of the table just created above
          assign dy_line->* to <dyn_wa>.                 " creating the work area with reference to the line type
          loop at li_filecontent into lwa_filecontent.
            assign component  lwa_filecontent-col     "accessing corresponding field in the field catalog
                of structure <dyn_wa> to <dyn_field>. "and assigning this field to a field symbol
            if sy-subrc = 0.
              <dyn_field> = lwa_filecontent-value.     " filling value for this field
            endif.
            at end of row.
              append  <dyn_wa> to <dyntable>.
              clear <dyn_wa>.
            endat.
            clear lwa_filecontent.
          endloop.
          i_input_file[] =  <dyntable>.
        endif.
      elseif sy-subrc <> 0.
        message s027 display like c_error with text-001.
        stop.
      endif.
    form f_create_tab_field  tables   p_li_fieldlist structure lvc_s_fcat
                         using    p_fname
                                  p_lenght.
      data:lwa_fieldlist   type lvc_s_fcat.
      lwa_fieldlist-fieldname = p_fname.
      lwa_fieldlist-intlen = p_lenght.
      append lwa_fieldlist to  p_li_fieldlist.
      clear lwa_fieldlist.
    endform.                    " F_CREATE_TAB_FIELD
    Regards,
    Dev.

  • Question in ABAP syntax, read & insert data from internal table, while loop

    Hi, SDN Fellow.
    I am from Java background and learnt ABAP, I don't usually write much ABAP code.
    I am trying to implement the following logic in a RFC now.
    I have one z-custom database table, the structure as the following:
    It has two columns, with these sample data.
    Says datable table is ZEMPMGRTAB.
    EmployeeID,ManagerID
    user10,user1
    user9,user1
    user8,user1
    user7,user2
    user6,user2
    user5,user2
    user4,user2
    user2,user1
    The logic is this:
    I have a input parameter, userid. I am using this parameter to have a select statement to query the record into export table,EXPTAB 'LIKE' table ZEMPMGRTAB.
    SELECT * FROM  ZEMPMGRTAB
      into table EXPTAB
       WHERE  EMPLOYEEID  = USERID.
    Say, my parameter value, USERID ='USER4'.
    Referring to the sample data above, I can get the record of this in my EXPTAB,
    EmployeeID,ManagerID
    user4,user2
    Now, I want to iterately use the EXPTABLE-ManagerID
    as the USERID input in SELECT statement, until it has no return result. Then, insert the new records in
    EXPTAB.
    In above new loop case, we will get this table content in EXPTAB,
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    I kind of think of the pseudocode logic as below:
    (These may not be a valid ABAP code, so I need help to convert/correct them)
    DATA:
    IWA TYEP ZZEMPMGRTAB,
    ITAB
    HASHED TABLE OF ZZEMPMGRTAB
    WITH UNIQUE KEY EMPLOYEEID.
    SELECT * FROM  ZEMPMGRTAB
      into table ITAB
       WHERE  EMPLOYEEID  = USERID.
    *Question 1: I cannot insert a internal table to export table, it is *incompatible type, what is the alternative way fo this?
    *Question 2: How can I access thedata of the internal table like this,ITAB-MANAGERID? As if I can, I would do this:
    * IWA-EMPLOYEEE = ITAB-EMPLOYEEID. IWA-MANAGERID = IWA-MANAGERID. INSERT IWA INTO TABLE EXPTAB.
    * Question 3: Is the 'NE NULL' - 'not equal to NULL' is right syntax?
    IF ITAB NE NULL.
    INSERT ITAB INTO EXPTAB.
    ENDIF
    * Question 4: Is my WHILE loop setup right here? And are the syntax right?
    WHILE ITAB NE NULL.
    SELECT * FROM  ZEMPMGRTAB
      into table ITAB
       WHERE  EMPLOYEEID  = ITAB-MANAGERID.
    IF ITAB NE NULL.
    INSERT ITAB INTO EXPTAB.
    ENDIF
    REFRESH ITAB.
    ENDWHILE.
    Assume all the syntax and logic are right, I should get this result:
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    If I have a new entry in datable table,ZEMPMGRTAB like this:
    user1,user0
    My pseudocode logic will get this result:
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    user1,user0
    I truly appreciate if you can help me to validate the above syntax and pseudocode logic.
    Thanks in advance.
    KC

    Hi,
    FUNCTION ZGETSOMEINFO3.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(USERID) TYPE  AWTXT
    *"     VALUE(FMTYPEID) TYPE  AWTXT
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRETURN
    *"  TABLES
    *"      APPROVERT STRUCTURE  ZTAB_FMAPPROVER
    *"      ACTOWNERT STRUCTURE  ZTAB_FMACTOWNER
    DATA: T_RESULT TYPE STANDARD TABLE OF ZTAB_FMAPPROVER.
    **Question 1: For this line, I got an error says "Program ''USERID" *not found. Is the syntax right, as the USERID is a parameter for the function.
    perform add_line(USERID).
      ENDFUNCTION.
    form add_line using i_user type ZTAB_FMAPPROVER.EMPLOYEEID
                        changing T_RESULT TYPE ZTAB_FMAPPROVER.
    data: ls_row type ZTAB_FMAPPROVER.
    * Get record for i_user
    select single * into ls_row from ZTAB_FMAPPROVER
    where EmployeeID = i_user.
    if sy-subrc NE 0.
    * Do nothing, there is not manager for this employee
    else.
    * Store result
    QUESTION 2: I am still got stuck on this line of code. It still *says that "T_RESULT" is not an internal table "OCCURS n" *specification is missing. I thought the line: "T_RESULT TYPE *ZTAB_FMAPPROVER" means declare internal table, T_RESULT as type of ZTAB_FMAPPROVER". Am I understand it wrongly?
    append ls_row to t_result.
    * Call recursion
    perform add_line using ls_row-ManagerID
                              changing t_result.
    endif.
    endform.
    Thanks,
    KC

  • Grouping of two rows of internal table

    Hi all,
    I am having a requirement in which I want to group two rows of an internal table and assign a pointer to the two rows.
    This pointer variable will then be passed to ALV.
    Help reqd.
    regards.

    Hi Gaurav,
    Hope the below code helps:
    TYPES :BEGIN OF TY_ITAB2,
    DATA(400),
    END OF TY_ITAB2.
    DATA: ITAB3 TYPE TY_ITAB2 OCCURS 0 WITH HEADER LINE
    Loop at itab1.
    ITAB3-DATA = ITAB1-LABEL.
    APPEND ITAB3.
    ITAB3-DATA = ITAB1-MATNR.
    APPEND ITAB3.
    endloop.
                        or
    You can create a deep internal table. You can declare one Column as an internal table and store the NOTES in that Internal table for each row.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
    you can check the example in the link
    Kindly Reward Points If You Find The Reply Helpful.
    Cheers,
    Chaitanya.

  • Get Multiple Rows into internal Table using Webdynpro Alv Display ..

    Hi guys ,
    I need to find out the logic for getting all the selected rows into the internal table.
    When i display the ALV Output on webdypro screen .
    USer Selects multiple rows for further processing ..
    Ineed to get all the rows selected by user into an internal table .
    Please let me know how to achive this ...
    Thanks in advance for quick reply
    Regards
    Saurabh Goel

    Hi,
    You need to use the method GET_SELECTED of IF_WD_CONTEXT_NODE to get the rows selected. Also ccheck for the paramters of that method, this retruns the element set.
    This meets your requirement.
    Regards,
    Lekha.

Maybe you are looking for

  • Album artwork screen saver gone

    I have done some research, but am confused.  The album artwork is no longer showing up (black screen) as my screen saver.  I am now using a new iMac Mountain Lion.  BUT, I did do a full install from my old iMac so whatever the issue is in iTunes is s

  • Hide the update power query notification

    I've recently installed Power Query for Excel 2013 Pro Plus. (not click-to-run) Power Query has been updated already and now this message is appearing on all the user's computers. Any ideas as to how I can hide this message using the registry and/or

  • Site Test

    Site test please: http://dpaweb.hss.state.ak.us/training/FSTest/ Just trying to see if it locks up or throws people out.

  • Third-Party earphones.

    I have a great pair of third-party earphones for my ipod--the Shure E2G. Unfortunately, they don't work with my new iphone. Any suggestions for good-quality in-ear earphones that have the right plug for the iphone?

  • Music wont sync onto iPhone with ios7 update

    After getting the most recent ios7 update, the music in my itunes library will not sync to my phone. It goes through all 4 steps and then freezes on the "waiting for changes to be applied" step. HELP! Itunes is updates to the 11.1 version, and the ip