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

message problem

Former Member
0 Likes
462

hi masters,

i have TC where i have 5 records...

if user enters the same records i should tel the user that record already exists.

i have given the logic it identifies the existing reocrd but as am in loop it goes 5 times and issues 5 times the message .

is it not possible to give the message only once if so how can i get it pls.

this is my code :

it is in a loop.... if the loop has 5 records it issues 5times how can i avoid it.

read table lt_t7ehs00_srv_prot with key pnumber = p1..

if sy-subrc = 0.

MESSAGE 'Record already exits' type 'W'.

endif.

Moderator message: please use more descriptive subject lines from now on.

Edited by: Thomas Zloch on Jul 6, 2010 5:22 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
424

Hi,

I am not well cleared with the qn.

May be you can set a flag inside the loop. And after the loop just chk whether the flag is set or not. If it is set, then display the message and clear the flag.

Also, hope, p1 is the new input and inside the loop you can directly check with the work area u2013 u2018lt_t7ehs00_srv_prot-pnumberu2019. Why you are reading again inside the loop. Hope, you have some reason for that and it will be helpful if you can brief that.

Regards,

Selva K.

3 REPLIES 3
Read only

Former Member
0 Likes
425

Hi,

I am not well cleared with the qn.

May be you can set a flag inside the loop. And after the loop just chk whether the flag is set or not. If it is set, then display the message and clear the flag.

Also, hope, p1 is the new input and inside the loop you can directly check with the work area u2013 u2018lt_t7ehs00_srv_prot-pnumberu2019. Why you are reading again inside the loop. Hope, you have some reason for that and it will be helpful if you can brief that.

Regards,

Selva K.

Read only

Former Member
0 Likes
424

Hi Pasalabasker,

this is my code :

it is in a loop.... if the loop has 5 records it issues 5times how can i avoid it.

read table lt_t7ehs00_srv_prot with key pnumber = p1..

if sy-subrc = 0.

MESSAGE 'Record already exits' type 'W'.

exit. **<----


write this to exit from the loop.

endif.

Regards,

Md Ziauddin.

Read only

Former Member
0 Likes
424

thank you and appriciated for the replies...

sorted with the message below.

MESSAGE i055(zfiex) WITH p1(4).