Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: Compare Values of two coloumns in the same internal table

$
0
0

HI Marina,

 

Try like this

 

TYPES : BEGIN OF ty_table,
         f1  TYPE i,
         f2  TYPE i,
         END OF ty_table.

DATA : it_table TYPE TABLE OF ty_table,
        wa_table TYPE ty_table,
        it_table_1 TYPE TABLE OF ty_table,
        wa_table_1 TYPE ty_table,
        var TYPE i.


wa_table-f1 = '9000032'.
wa_table-f2 = '9000045'.
APPEND wa_table TO it_table.
CLEAR wa_table.

wa_table-f1 = '9000033'.
wa_table-f2 = ' '.
APPEND wa_table TO it_table.
CLEAR wa_table.

wa_table-f1 = '9000034'.
wa_table-f2 = ''.
APPEND wa_table TO it_table.
CLEAR wa_table.

wa_table-f1 = '9000035'.
wa_table-f2 = ''.
APPEND wa_table TO it_table.
CLEAR wa_table.

it_table_1 = it_table.

LOOP AT it_table INTO wa_table.
   READ TABLE it_table INTO wa_table WITH KEY f1 = wa_table-f2.
   IF sy-subrc = 0.
     DELETE it_table.
   ENDIF.
ENDLOOP.

DELETE it_table WHERE f2 IS NOT INITIAL.


Loop at it_table into wa_table.
  
   write : / wa_table-f1, wa_table-f2.

endloop.

 



Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>