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

Problem in warning message.

Former Member
0 Likes
1,832

Hello,

Is there any method to continue the program execution in PAI after displaying a warning message.

I will elaborate the sitution with an example below

loop at itab into wa_area.

if wa_area-fieldvalue is initial.

MESSAGE ID 'ZMSG' TYPE 'W' NUMBER 001. " display warning message if fieldvalue is initial

endif.

screen element = wa_area-fieldvalue. " assigning field value into screen fields.

endloop.

the problem is after displaying warning message the execution is started again from top. It does not continue execution from the line where it displayed warning message.

Any pointers to overcome this problem????

13 REPLIES 13
Read only

sridhar_meesala
Active Contributor
0 Likes
1,625

Hi,

Use SET CURSOR after displaying the warning message so that it remains at the same line.

Thanks,

Sri.

Read only

0 Likes
1,625

hi Sri,

I think set cursor keyword is used to set the cursor on a particular screen element.

will it be possible for the program execution as mentioned in my post????

thanks

Read only

0 Likes
1,625

Apologies.

I misunderstood your question. I thought you want the cursor to be placed in the field where you rise the warning message.

Read only

p604431
Active Participant
0 Likes
1,625

Hi,

try by using EXIT syntax in the loop statement.

Read only

Former Member
0 Likes
1,625

but the exit statement wont be executed here.

Read only

former_member195383
Active Contributor
0 Likes
1,625

Use information message(Type 'I') instead .

Read only

0 Likes
1,625

ya right now i am using information message but it needs to be changed to warning message

Read only

Former Member
0 Likes
1,625

hi,

loop at itab into wa_area.

if wa_area-fieldvalue is initial.

MESSAGE ID 'ZMSG' TYPE 'W' NUMBER 001. " display warning message if fieldvalue is initial

endif.

screen element = wa_area-fieldvalue. " assigning field value into screen fields.

endloop.

in this code if u want to run some code after the warning message then write it under the warning message , so that after the warning message if u press enter the code below the warning message gets executed .

regards

Read only

0 Likes
1,625

the code written after warning message is not executed. once i press enter , the whole program is executed once more and the execution stops at the same warning message

Read only

0 Likes
1,625

I dont think there should be any restriction for using Information message as an warning to the user .

If it is not at all agreeable to use Information Message , then try to use Pop ups to show warning. This may solve your purpose.

Read only

Former Member
0 Likes
1,625

Hi,

i think the error message type is not continue u r current loop so u can use


message ' msg no ' type 'S' display like 'E'.

i think its work ...

Regards,

Abhilash

Read only

Former Member
0 Likes
1,625

Hi,

Is wa_area-fieldvalue is screen field. In case

Write your code in Module -- Mod1 .. This should solve your problem.

LOOP Itab..

FIELD <> MODULE <mod1>.

ENDLOOP.

Nag

Read only

Former Member
0 Likes
1,625

You can use Success Message Display Like Warning.

This will work .