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

replacement statement for ONCHANGE OF

tarangini_katta
Active Contributor
0 Likes
2,128

HI All,

I am writing the coding in user exit.

I want to use the statement ON CHANGE OF .But this statement is obsolete statement.IT is not supporting in my code.It is not showing any systax error but it is not working properly.

What els ei can use for the statement ON CHANGE OF.

Thanks,

1 ACCEPTED SOLUTION
Read only

tarangini_katta
Active Contributor
0 Likes
1,346

Hi,

I am not looping the any import parameters of exit.

In the Exit i have 2 internal table with the fields

I have

Example.

Loop at itab into wa_itab.

Reading the table itab1 into wa_itab1 .

g_filed1 = wa_itab1-field1.

On CHNAGE OF wa_itab1-field1.

g_field1 = g_field1 + 1.

endon.

endloop.

This is i have.

But here on change of is not working.

Thanks,

HI All,

I am writing the coding in user exit.

I want to use the statement ON CHANGE OF .But this statement is obsolete statement.IT is not supporting in my code.It is not showing any systax error but it is not working properly.

What els ei can use for the statement ON CHANGE OF.

Thanks,

6 REPLIES 6
Read only

Former Member
0 Likes
1,346

Hi,

Use IF statement

Regards,

Dwaraka.S

Read only

tarangini_katta
Active Contributor
1,346

NO,

I can'use if statement.I have to use if the wa value changes only i need to add the two values:

Thanks

Read only

0 Likes
1,346

Hi,

R u looping on any table parameter in user exit.

For example or assume if you are getting PO items in say it_items.

loop at it_items into wa.

if sy-tabix eq 1 or wa-ebeln ne gv_ebeln.

******************************

for same ebeln 's this logic will not be executed.

executed only when ebeln changes.

******************************

endif.

gv_ebeln = wa-ebeln.

endloop.

If this does not meet ur requirement, clearly explain the same.

Regards,

Dwaraka.S

Edited by: Dwarakanath Sankarayogi on Feb 10, 2009 2:34 PM

Read only

tarangini_katta
Active Contributor
0 Likes
1,347

Hi,

I am not looping the any import parameters of exit.

In the Exit i have 2 internal table with the fields

I have

Example.

Loop at itab into wa_itab.

Reading the table itab1 into wa_itab1 .

g_filed1 = wa_itab1-field1.

On CHNAGE OF wa_itab1-field1.

g_field1 = g_field1 + 1.

endon.

endloop.

This is i have.

But here on change of is not working.

Thanks,

Read only

1,346

Hi,

Here ON CHANGE works for the loop at ITAB (to check for any field value change in ITAB) but not for ITAB1

go through the F1 help for ON CHANGE OF

In your logic u can use ON CHANGE OF if u are using LOOP AT ITAB1.

Modify the statements and try the below logic.

data gv_temp type sytabix value 1.

Loop at itab into wa_itab.

Reading the table itab1 into wa_itab1 .

if gv_temp = 1 or g_field1 ne wa_itab1-field1.

g_field1 = g_field1 + 1.

endif.

g_filed1 = wa_itab1-field1.

endloop.

Regards,

Dwaraka.S

Read only

0 Likes
1,346

Hi Tarangini,

Try it this way:

data:
  w_index type i value 1,
  w_lines  type i.
 
describe table itab lines w_lines.

while w_index le w_lines.

  read table itab into wa_itab index w_index.

*Loop at itab into wa_itab.
*  Reading the table itab1 into wa_itab1 .

  loop at itab1 into wa_itab1.

    g_filed1 = wa_itab1-field1.
    
    at new field1.
      g_field1 = g_field1 + 1.
    endat.
  endloop.
  w_index = w_index + 1.
endwhile.

With luck,

Pritam.