READ TABLE statement in ECC 6.0

hi,
in 4.6, my statement was
READ TABLE S_XVTTS WHERE TKNUM = S_XVTTK-TKNUM
AND NOT S_XVTTS-VSTEL IS INITIAL.
This wont work in ECC 6.0, hence I need to modify this. so i write like
READ TABLE S_XVTTS INTO wa_vttsvb WITH KEY TKNUM = S_XVTTK-TKNUM ..................................
how to accomodate the check for NOT initial of S_XVTTS-VSTEL .. how will my statement look like ? thks

Hi Sdnuser1,
Try to use LOOP statement as follow.
"// This LOOP read only one line of table s_xvtt exactly as READ TABLE do.
LOOP AT s_xvtts INTO wa_vttsv WHERE tknum EQ s_xvttk-tknum AND s_xvtts-vstel IS NOT INITIAL.
  EXIT.
ENDLOOP.
IF sy-subrc IS INITIAL.
   "// You can use wa_vttsv
ELSE.
    "// Do something
ENDIF.
I hope it helps yous.
Greetings.
Marcelo Ramos

Similar Messages

  • How to get the number of hits ("returned rows") in read table statement

    Hi Experts
    I have the statement shown below, which seems not to work as I would like it to. My problem is that I would like to do two different things depending on weather or not a read table statement results in 0 hits or 1 (or more) hits.
        READ TABLE g_ship_item
            WITH KEY
         l_ztknum = DATA_PACKAGE-/bic/ztknum
         BINARY SEARCH.
          IF sy-subrc is initial.
          no hits found
            DATA_PACKAGE-/BIC/ZSTAGEERR = 1.
          ELSE.
          hits where found and we will do something else...
            DATA_PACKAGE-/BIC/ZSTAGEERR = 0.
    Hope someone can help me out of my problem...
    Thanks in advance, regards
    Torben

    Hi,
    As you are using READ statement with Binary search, check whether the internal table g_ship_item is sorted with field /bic/ztknum or not. If it is not sorted then the result of this READ statement is not correct.
    Below is the correct code.
    sort  g_ship_item by /bic/ztknum.
    READ table g_ship_item with key g_ship_item = xxx.
    Thanks,
    Satya

  • Need help regarding Dynamic Read Table statement

    Hello
    I know that the syntax for dymanic read table statement is
    READ TABLE  <ITAB> WITH KEY (KEY1) = VALUE1  (KEY2) = VALUE2 .....(KEYN) = VALUEN
    Here is my problem..
    I am dynamically creating an internal table based on parameter table entered by user.
    The key for this table can be determined only at runtime.
    The table entered might have by one field as key field or 10 key fields..
    How can I use the dynamic read in this situation ?
    Thanks for your help in advance,
    Santosh
    Edited by: Santosh Kulkarni on Jan 3, 2010 6:58 AM
    Edited by: Santosh Kulkarni on Jan 3, 2010 7:01 AM

    Hello Santosh,
    please check out the following solution. The program demonstrates how to use the dynamic read statement with three key field conditions. Additional key fields can be added in the same way.
    REPORT z_dynamic_read.
    DATA: gt_itab TYPE REF TO data,
          ge_key_field1 TYPE char30,
          ge_key_field2 TYPE char30,
          ge_key_field3 TYPE char30,
          go_descr_ref TYPE REF TO cl_abap_tabledescr.
    FIELD-SYMBOLS: <gt_itab> TYPE STANDARD TABLE,
                   <gs_key_comp> TYPE abap_keydescr,
                   <gs_result> TYPE ANY.
    PARAMETERS: pa_table TYPE tabname16 DEFAULT 'SPFLI',
                pa_cond1 TYPE string DEFAULT sy-mandt,
                pa_cond2 TYPE string DEFAULT 'LH',
                pa_cond3 TYPE string DEFAULT '0123'.
    START-OF-SELECTION.
    * Create and populate internal table
      CREATE DATA gt_itab TYPE STANDARD TABLE OF (pa_table).
      ASSIGN gt_itab->* TO <gt_itab>.
      SELECT * FROM (pa_table) INTO TABLE <gt_itab>.
    * Get the key components into the fields ge_key_field1, ...
      go_descr_ref ?= cl_abap_typedescr=>describe_by_data_ref( gt_itab ).
      LOOP AT go_descr_ref->key ASSIGNING <gs_key_comp>.
        CASE sy-tabix.
          WHEN 1.
            ge_key_field1 = <gs_key_comp>-name.
          WHEN 2.
            ge_key_field2 = <gs_key_comp>-name.
          WHEN 3.
            ge_key_field3 = <gs_key_comp>-name.
        ENDCASE.
      ENDLOOP.
    * Finally, perform the search
      READ TABLE <gt_itab> ASSIGNING <gs_result>
              WITH KEY (ge_key_field1) = pa_cond1
                       (ge_key_field2) = pa_cond2
                       (ge_key_field3) = pa_cond3.
      IF sy-subrc = 0.
        WRITE / 'Record found.'.
      ELSE.
        WRITE / 'No record found.'.
      ENDIF.
    One note: When an internal table is created dynamically like in my program above, the table key is not the key defined in the DDIC structure -- instead, the default key for the standard table is used (i.e. all non-numeric fields).
    Hope this helps,
    David

  • Doubt in read table statement.

    hi friends
    i have a doubt in read statement
    please suggest me which one i can use.
    i have one master table
    with fields like
    contract contract line wbs
    500060    10                XXX
    500070     10               XXX
    and the transaction table has
    500060     10             01              01              01
    500060      10            02              02              02
    500070       10            01              01             01
    500070       10            02              02              02
    what i am doing is like
    loop at master table into wamastertable
    read table tranintertab into tranintertab1 with key contract=wamastertable-contract                                                                               
    contractline = wamastertable-contractline.
    endloop.
    As my read query satifies multiple lines of transaction internal table i am in a posistion to do this
    but if i do like the above it is giving error that tranintertab1 is not the line type of tranintertab
    please provide me ur valuable suggestions.

    >
    janagar sundaramoorthy Nadar wrote:
    >
    contract contract line wbs
    > 500060    10                XXX
    > 500070     10               XXX
    > and the transaction table has
    > 500060     10          01              01              01
    > 500060     10          02              02              02
    > 500070     10          01              01             01
    > 500070     10          02              02              02
    >
    >
    loop at master table into wamastertable
    > read table tranintertab into tranintertab1 with key contract=wamastertable-contract
    >                                                                                contractline = wamastertable-contractline.
    > endloop.
    >
    Try it like this..........
    loop at tranintertab into tranintertab1.
    read table master table into wamastertable with key
                                                                           contract = tranintertab1-contract
                                                                      contractline = tranintertab1-contractline.
    endloop.
    Regards,
    Suneel G

  • Hello experts read table statement is not working properly

    Hello Experts.
    my code is like this.
    sort it_matnr by matnr.
    loop at itab_result.
    read table it_matnr with key matnr = itab_result-matnr  binary search.
    endloop.
    there are nearly 2000 records in it_matnr . The records which satisfy the above condition is there here in this internal table. But it is unable to read the record which matches the condition. One thing is that , there are more than one record with the same material. ie mblnr is different but material is the same. In it_matnr table i have only 1 field ie matnr ,so i need to compare only with the matnr.I also tried by sorting it_result by matnr but of no use. Then finally I used loop at where matnr = it_result-matnr , it is working fine. But due to performance reasons we should not use this. so please tell me what to do and correct the code.

    1. Make sure that the table IT_MATNR is not getting updated inside the loop. Because it will then destroy the sorting.
    2. Secondly, if there are multiple records in IT_MATNR for the same material then it will search for the first record encountered in binary algo. So it is advisable that you may provide further filter criteria if possible. check if ITAB_RESULT & IT_MATNR have any other matching field that can be put in filter criteria.
    3.Thirdly, check if your requirement can be achieved by STABLE SORT.
    <b>SORT <itab> ... STABLE BY <f1>[ASCENDING/DESCENDING].</b>
    It will allows you to perform a stable sort, that is, the relative sequence of lines that are unchanged by the sort is not changed. If you do not use the STABLE option, the sort sequence is not preserved. If you sort a table several times by the same key, the sequence of the table entries will change in each sort. However, a stable sort takes longer than an unstable sort.
    4. Lastly, you can use parallel cursor technique of multiple loops which is given below:
    LOOP AT itab_result.
      READ TABLE it_matnr
        WITH KEY matnr = itab_result-matnr
        BINARY SEARCH.
    Process record
      LOOP AT it_matnr FROM sy-tabix.
        IF it_matnr <> itab_result-matnr.
          EXIT.
        ENDIF.
    Process record based on yuor condition
      ENDLOOP.
    ENDLOOP.

  • Read table statement

    hi,
    while reading the internal table, if the subrc value is 8 .
    what does it mean.
    any help will be appreciated.

    Hi rajkumar,
    here's an example :
    *in progtab are 2 entries
    *now entry is'nt found:
    sy-subrc = <b>8</b> , sy-tabix = number of entries + 1 = <b>3</b>.
    DATA:  BEGIN OF PROGTAB OCCURS 10,
           NAME LIKE TRDIR-NAME,
           END OF PROGTAB.
    MOVE TRDIR-NAME TO PROGTAB-NAME.
    READ TABLE PROGTAB WITH KEY PROGTAB BINARY SEARCH.  
    IF SY-SUBRC <> 0.                                   
       INSERT PROGTAB INDEX SY-TABIX.                    
    ENDIF.
    regards Andreas

  • Field symbols and READ TABLE with system code 4

    Hi,
    I have a hashed table and I am using field symbols to point to it to retrieve the field content. I then use it in the READ TABLE statement in the following way:
    Loop at x_data assign <fs>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c1>.
    ASSIGN COMPONENT 'xxx' OF STRUCTURE <fs> TO <c2>.
    READ TABLE ZZZZ assign <fs> with table key a1 = <c1>
                                               a2 = <c2>.
    If sy-subrc = 0.
    endif.
    I ran the debugger and I keep getting a 4. I am not able to get the value from a1 and a2 to see what it is and why it is causing a 4 sy-subrc. I know the value from the hashed table and the values c1 and c2 are the same, so the sy-subrc should be 0.
    How would I read a hashed table using field symbols? I know that usig a standard table, I have to sort the table on the key fields() before I actually can do the READ TABLE using the binary search.
    Please advise. Thanks
    RT

    Hai Rob
    Go  through the following Code
    Field-Symbols are place holders for existing fields.
    A Field-Symbol does not physically reserve space for a field but points to a field, which is not known until run time of the program.
    Field-Symbols are like Pointers in Programming language ‘ C ‘.
    Syntax check is not effective.
    Syntax :
    Data : v1(4) value ‘abcd’.
    Field-symbols <fs>.
    Assign v1 to <fs>.
    Write:/ <fs>.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY COL1.
    FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
    DO 4 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
    APPEND LINE TO ITAB.
    ENDDO.
    READ TABLE ITAB WITH TABLE KEY COL1 = 2 ASSIGNING <FS>.
    <FS>-COL2 = 100.
    READ TABLE ITAB WITH TABLE KEY COL1 = 3 ASSIGNING <FS>.
    DELETE ITAB INDEX 3.
    IF <FS> IS ASSIGNED.
    WRITE '<FS> is assigned!'.
    ENDIF.
    LOOP AT ITAB ASSIGNING <FS>.
    WRITE: / <FS>-COL1, <FS>-COL2.
    ENDLOOP.
    The output is:
    1 1
    2 100
    4 16
    Thanks & regards
    Sreenivasulu P

  • Read   table and loop at

    Hi EXpert,
    I have an internal table say itab and I need to fetch a single record with some given conditions.
    Hence I have used READ table statement ,
    But on using this read table statement , I am unable to fetch the record :-(((( . It gives sy-subrc  =  4.
    And the same conditions when are put in Loop at itab  statement, then I am able to fetch the data .
    My requirement is only 1 record for the given conditions ( in where clause in case of loop at statement).
    I think I am probably missing out on some minor thing..
    <removed_by_moderator>
    Warm Regards,
    SUDHA
    Edited by: Julius Bussche on Feb 7, 2009 2:48 PM

    Hi,
    Test the following Code hope it will solve out your problem,
    PARAMETERS: key TYPE i .
    TYPES: BEGIN OF t_test,
      s_no TYPE i,
      name(15),
      END OF t_test.
    DATA: it_test TYPE STANDARD TABLE OF t_test WITH HEADER LINE.
    DO 10 TIMES.
      it_test-s_no = sy-index.
      it_test-name = 'SDN'.
      APPEND it_test TO it_test.
    ENDDO.
    READ TABLE it_test INTO it_test WITH KEY key.
    IF sy-subrc = 0.
      WRITE: 'sy-subrc = ' , sy-subrc,
             /1 it_test-s_no, 15 it_test-name.
    ELSE.
      WRITE: 'sy-subrc = ' , sy-subrc,
             / 'Sorry there is no Records with this Key'.
    ENDIF.
    Kind Regards,
    Faisal
    Edited by: Faisal Altaf on Feb 7, 2009 6:59 PM

  • Read Table : Error Stating mandt field is not filled.

    Dear members,
    I am get syntax error when using Read table statement saying mandt field is not filled, however if I remove the KEY field. it is working fine.
    please let me know, where I am doing mistake. thank you.
    Data : spfli_tab like STANDARD TABLE OF spfli with HEADER LINE.
    SELECT *
           FROM spfli
           INTO TABLE spfli_tab
           WHERE carrid = 'LH'.
    READ TABLE spfli_tab
               WITH TABLE KEY carrid = 'LH'
                                           connid = '2402'.
    IF sy-subrc = 0.
    ENDIF.

    Hi...
    As Eric Said there are two ways...
    For your case use WITH KEY...
    SELECT *
    FROM spfli
    INTO TABLE spfli_tab
    WHERE carrid = 'LH'.
    READ TABLE spfli_tab
    WITH KEY carrid = 'LH'
    connid = '2402'.
    IF sy-subrc = 0.
    WRITE : 'DONE'.
    ENDIF.
    If u specify WITH TABLE KEY then u will hv to pass all key fields mentioned in DDIC...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • Regarding the internal table data by using read table it_mard into wa_mard

    hi,
    i am reading the internal table it_mard with key matnr .
    my code is like this.
    *loop at it_final into wa_final.*
    *wa_second-matnr  = wa_final-matnr.*
      wa_second-bwart = wa_final-bwart.
    wa_second-bwtar = wa_final-bwtar.
    *read table it_mard into wa_mard with key matnr = wa_final-matnr*
                                                                              *binary search.*
    *if sy-subrc = 0.*
    *wa_second-labst = wa_mard-labst.*
    *endif.*
    *append wa_second to it_second.*
    clear :wa_final.
    *endloop.*
    final internal table haveing duplicate values because this table it_final having movement types
    so that i am not using delete statement .
    is there any logic for handling the duplicate values inside the loop statement
    by using read table statement.
    could u plz explain clearly  \[removed by moderator\]
    Edited by: Jan Stallkamp on Jul 11, 2008 2:11 PM

    this is my code could u plz explain  regarding duplicate material number .
    LOOP AT IT_MSEG INTO WA_MSEG.
        WA_FINAL-MBLNR = WA_MSEG-MBLNR.
        WA_FINAL-MATNR = WA_MSEG-MATNR.
        WA_FINAL-BWART = WA_MSEG-BWART.
        WA_FINAL-BWTAR = WA_MSEG-BWTAR.
        WA_FINAL-MENGE = WA_MSEG-MENGE.
        WA_FINAL-SOBKZ = WA_MSEG-SOBKZ.
        COLLECT WA_FINAL INTO IT_FINAL.
        CLEAR WA_FINAL.
      ENDLOOP.
      LOOP AT IT_FINAL INTO WA_FINAL.
        READ TABLE IT_MARD INTO WA_MARD WITH KEY MATNR = WA_FINAL-MATNR
                                                                                    BINARY SEARCH.
    this is reading the duplicate records i need to control duplicate records here .
    the   labst       value is repeating the number of times because of the meterial number duplication
    how can i restrict plz explain
        IF SY-SUBRC = 0.
          WA_FINAL-LABST = WA_MARD-LABST.
        ENDIF.
        READ TABLE IT_MKPF INTO WA_MKPF WITH KEY MBLNR = WA_FINAL-MBLNR
                                                                                    BINARY SEARCH.
        IF SY-SUBRC = 0.
          WA_FINAL-BUDAT = WA_MKPF-BUDAT.
        ENDIF.
        MODIFY IT_FINAL FROM WA_FINAL.
        CLEAR WA_FINAL.
      ENDLOOP.
      LOOP AT IT_FINAL INTO WA_FINAL.
        WA_SECOND-BWTAR = WA_FINAL-BWTAR.
        IF WA_FINAL-BWART = '101' OR WA_FINAL-BWART = '501' OR WA_FINAL-BWART = '561'.
          WA_SECOND-MENGE11 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '201'.
          WA_SECOND-MENGE12 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '541' AND WA_FINAL-SOBKZ = 'O' .
          WA_SECOND-MENGE13 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '601'.
          WA_SECOND-MENGE14 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '543'.
          WA_SECOND-MENGE15 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '702'.
          WA_SECOND-MENGE16 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '313'.
          WA_SECOND-MENGE17 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '315'.
          WA_SECOND-MENGE18 = WA_FINAL-MENGE.
        ENDIF.
        IF WA_FINAL-BWART = '122' OR WA_FINAL-BWART = '161'.
          WA_SECOND-MENGE19 = WA_FINAL-MENGE.
        ENDIF.
        COLLECT WA_SECOND INTO IT_SECOND.
        CLEAR WA_SECOND.
      ENDLOOP.

  • Read Table with condition

    Hi,
    can i write a Read table like for example,
    read table itab into wa_itab with key matnr ne '4'.
    as its giving me an error.
    can suggest any other way to write the Read Table statement.
    Thanks in advance.
    Robert

    Hi,
    it is not possible.
    try this way..
    "delete the material which is not equal to 4 ..now itab contains values matnr ne4
    delete table itab where matnr ne '4'.
    or
    loop at itab into wa_itab wher matnr ne '4'.
    "move to another table
    endloop.
    or
    loop at itab into wa_itab .
    if wa_itab-matnr ne '4'.
    continue
    "move to another table
    else.
      delete itab index sy-tabix.
    endif.
    endloop.
    prabhudas

  • Read table and checking condition in PAI

    Hi,
    I have a requirement where I need to check and compare with (Custom table) Bankn with Partner Bank`s bankn.
    I have wrote a code in PAI like this.
    MODULE CHECK_BANKN INPUT.
       Data: l_bankn like (Custom table)-bankn.
       select bankn from (Custom Table) into l_bankn
           where recno = g_recno.
       IF NOT g_head-bankn IS INITIAL.
      Read table i_bvtyp with key bankn = i_bvtyp-bankn .
         IF l_bankn <> i_bvtyp-bankn.--------->" Comparison of (custom table) Bankn with internal table I_BVTYP-BANKN
           MESSAGE w022 WITH text-w06.
         ENDIF.
       ENDIF.
    ENDMODULE.
    My Read Table statement is seems to be wrong and my checking condition is also wrong.
    So, how to resolve this?
    regards,
    Kiran

    Hi Kiran,
    If you observe your read statement, you are comparing the field with it's own table field.
       Read table i_bvtyp with key bankn = i_bvtyp-bankn .
    Untill unless you read I_BVTYP, i_bvtyp-bankn will be initial and you cannot find the matching record with Null-Value.
    So, I think you need compare with l_bankn.
       Read table i_bvtyp with key bankn = i_bankn .
    Then you can directly raise a message using SY-SUBRC value.
       Read table i_bvtyp with key bankn = i_bankn
          if SY-SUBRC <> 0 .
              <MESSAGE>    
         endif.
    Regards,
    Vijay

  • PROBLEM IN MOVE STATEMENT IN ECC 6.0

    hi EXPERTS,
    THE FOLLOWING CODE WORKS FINE IN 4.6C BUT IN ECC 6.0 THE MOVE STATEMENT AT THE END THROWS ERROR.
    ""INNNN" and "I0008" are not mutually convertible. In Unicode systems, "INNNN" must have the same structure layout (fragment view) as"I0008", regardless of the length of the Unicode character."
    DATA: i0001 LIKE p0001 OCCURS 0 WITH HEADER LINE,
          i0008 LIKE p0008 ,
          innnn like PRELP.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE i0001
          FROM pa0001
          WHERE begda <= 20061201
          AND endda >= 20061201
          AND pernr = 00014442 .
    READ TABLE i0001 INDEX 1.
          i0008-trfgr = i0001-persk.
          CASE i0001-persg.
            WHEN '4'.
              i0008-trfst = i0001-persg.
            WHEN '7'.
              i0008-trfst = i0001-persg.
            WHEN '8'.
              i0008-trfst = i0001-persg.
            WHEN OTHERS.
              i0008-trfst = '1' .
          ENDCASE.
          MOVE i0008 TO innnn.
    I'VE ALSO CHECKED THE SAME PROGRAM IN DEBUGGER IN 4.6C.
    I'VE FOUND THAT THE VALUES FOR i0008-trfgr i0008-trfst ARE TOGETHER STORED IN THE FIELD DATA1 OF INNNN. BUT THIS DOES NOT HAPPEN IN ECC 6.0.
    PLEASE HELP.
    ITS URGENT.

    Hi priya,
    DATA: i0001 LIKE p0001 OCCURS 0 WITH HEADER LINE,
    i0008 LIKE p0008 ,
    declare innnn like this and check
    innnn like p008.
    regards,
    Nagaraj

  • Replacemnt for read table with key binary search

    as read table with
    READ TABLE gt_INT_CURR_VALUE into gs_int_curr_value
               WITH KEY gs_FS_EINA_KEY  BINARY SEARCH.
    the statement read tabel with key is absolute in ecc 6 so how to replace it .

    Hi subratt,
    internal tables with header lines are obsolete and in oo context (CLASS / METHOD code) forbidden.
    OK, you'd better use SORTED TABLE and FIELD-SYMBOLS to gt optimal code::
    READ TABLE gt_INT_CURR_VALUE into gs_int_curr_value
    WITH KEY gs_FS_EINA_KEY BINARY SEARCH.
    may be replaced with
    DATA:
      gt_INT_CURR_VALUE_SORTED LIKE SORTED TABLE OF  gs_int_curr_value
        WITH [NON-]UNIQUE KEY <fields of  gs_FS_EINA_KEY>.
    FIELD-SYMBOLS:
      <nt_curr_value> LIKE gs_int_curr_value.
    gt_INT_CURR_VALUE_SORTED = gt_INT_CURR_VALUE.
      READ TABLE gt_INT_CURR_VALUE_SORTED ASSIGNING <nt_curr_value>
        WITH TABLE KEY <key1> = gs_FS_EINA_KEY-<key1> ..  <keyn> = gs_FS_EINA_KEY-<keyn>.
    Regards,
    Clemens

  • Sy-tabix in relation to LOOP AT and READ TABLE

    Hi All,
    As per SAP documentation,
    1) While looping through an internal table (LOOP AT), sy-tabix contains the index number of current row(for standard and sorted tables)
    2)When successfully reading from an internal table(READ TABLE), sy-tabix is set to the index of the result row.
    But what happens when READ TABLE is used while looping through another internal table?
    i.e. Loop at TAB1...
    write sy-tabix.
    READ TABLE TAB2...
    write sy-tabix.
    endloop.
    If we are looping through 1st row of TAB1 and the result of read statement is found in 3rd row of TAB2, I expected that sy-tabix before READ would be 1 and after the READ be 3.
    But, I found that sy-tabix remains unchanged at 1. Can someone expalin why?
    Thanks,
    Jagan

    Hi
    If after reading the table TAB2 the system variable SY-TABIX has still the previous value, that menas the READ TABLE fails or it was read the first record of TAB2.
    After READ TABLE TAB2 try to check the SY-SUBRC:
    LOOP AT TAB1.
       WRITE: / 'TAB1 index:', SY-TABIX.
       READ TABLE TAB2 .........
       IF SY-SUBRC = 0.
         WRITE: 'TAB2 index:', SY-TABIX.
    Try this:
    DATA: BEGIN OF ITAB OCCURS 0,
            FIELD1,
          END   OF ITAB.
    DATA: BEGIN OF ITAB2 OCCURS 0,
            FIELD1,
          END   OF ITAB2.
    DATA: INDEX TYPE I.
    DO 10 TIMES.
      APPEND ITAB.
    ENDDO.
    DO 10 TIMES.
      APPEND ITAB2.
    ENDDO.
    LOOP AT ITAB.
      WRITE: / 'ITAB:', SY-TABIX.
      INDEX = SY-TABIX + 2.
      READ TABLE ITAB2 INDEX INDEX.
      IF SY-SUBRC = 0.
        WRITE:  'ITAB2:', SY-TABIX.
      ENDIF.
    ENDLOOP.
    Max

Maybe you are looking for

  • Pass dynamic values to search-query in wlp-syndication-config for RSS

    Hi All, I want to pass dynamic values to the <search-query> element for the <syndication-feed> node in the wlp-syndication-config.xml file for implementing RSS feeds. Here's a sample <syndication-feed>           <name>RSSFeed</name>           <search

  • Whether any closing procedure for Special Purpose ledger

    Whether in SPL you can do the annual closing activities separately, like carry forward, closing the P & L Accounts and taking the balance to retained earnings etc? If so, how do you do that?

  • Loading data including Smart Lists data using ODI Planning KM

    Hi all, a question regarding ODI loading Smart Lists Data... Can somebody confirm if we can load data from a source file which has the smart lists labels, instead of the smart list values id (ex: YES instead of 1)? i suppose Planning will do the conv

  • Tutorial from 9i to 11g

    Dear All, Does anyone has course material in pdf or ppt for course from 9i to 11g. or can anyone give the proper web site link for the same Thanks in advance. Regards, Mathew

  • What actually RMAN "backup validate database" does?

    OS: AIX 5.3L; DB: Oracle 10g R2 According to the RMAN doc, the validate actually run an integrity check on all datafiles and the archive logs if includes the "archivelog all" without creating any backupset. But I want to know what exact process Oracl