Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Validation issue.

former_member225134
Participant
0 Likes
496

Hi ,

             Am having 3 internal tables.Each table contains constant texts ,Suppose  if the table having different text means i want to display error.

For example,

itab =  'abc-year'

           'bcd-year' 


these are two constant texts,suppose if the internal table contains'



itab =  'xxx-year'

          'bcd-year'     means i have to display error text is wrongly maintained..




Anyone suggest please how to do this.

2 REPLIES 2
Read only

Former Member
0 Likes
470

Loop at Itab INTO wa_tab.

     IF wa_tab-value NE constant_text.

           WRITE 'Invalid Text'.

     ENDIF.

Endloop.

Read only

Hvshal4u
Active Participant
0 Likes
470

Hi,

If you want to compare the constants from all 3 tables then you can do it in following manner .

LOOP AT ITAB1 INTO WA1.

     READ TABLE ITAB2 INTO WA2 WITH KEY TEXT = WA1-TEXT.

     READ TABLE ITAB3 INTO WA3 WITH KEY TEXT = WA1-TEXT.

         IF WA1-TEXT <> WA2-TEXT OR WA1-TEXT <> WA3-TEXT.

               WRITE : 'ERROR'.

       ENDIF.

ENDLOOP.

Regards,

Vishal