Application Development 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: 

How to return to selection screen after error message

Former Member
0 Kudos
6,050

Hello everyone!

When the error message in the code below is raised, it shows the message then completely terminates the program.


  IF len_bankl NE 8 AND len_bankl NE 11.
    MESSAGE E001 WITH 'Error message'.
  ENDIF.

How can I show the message but will still return to the previous selection screen?

Thank you!

1 ACCEPTED SOLUTION

Former Member
284

Assuming this is a basic report, once you leave the screen I don't think you can return.

Either code your validation in the AT SELECTION SCREEN event or change the error message

15 REPLIES 15

Former Member
0 Kudos
284

Change the error message to information message and

use the statement

LEAVE LIST-PROCESSING.

IF len_bankl NE 8 AND len_bankl NE 11.

MESSAGE <b>i</b>001 WITH 'Error message'.

<b>LEAVE LIST-PROCESSING.</b>

ENDIF.

0 Kudos
284

> Change the error message to information message and

> use the statement

> EAVE LIST-PROCESSING.

>

> F len_bankl NE 8 AND len_bankl NE 11.

> MESSAGE <b>i</b>001 WITH 'Error message'.

> <b>LEAVE LIST-PROCESSING.</b>

> ENDIF.

I think this the most useful answer.

This does go back to the selection screen.. But I think I need the flashing 'X' produced by the message type E...

Because if I use S, it will give a flashing check mark, if type I, it will open a dialog box..

0 Kudos
284

Hi Ricardo,

Instead of the MESSAGE statement, u can use the function modules to popup a message, check these fm's

popupdisplay

popupconfirm

popupmessage

0 Kudos
284

> Hi Ricardo,

> Instead of the MESSAGE statement, u can use the

> function modules to popup a message, check these

> fm's

>

> popupdisplay

> popupconfirm

> popupmessage

Hello again.

I tried some the functions and I think they are only dialog boxes.. Is there any functions for status bar messages only? Thanks!

Also, does the LEAVE LIST-PROCESSING command clear the selected data inside the internal tables (setting the internal tables to no data)?

Thanks a lot!

Former Member
285

Assuming this is a basic report, once you leave the screen I don't think you can return.

Either code your validation in the AT SELECTION SCREEN event or change the error message

0 Kudos
284

> Assuming this is a basic report, once you leave the

> screen I don't think you can return.

>

> Either code your validation in the AT SELECTION

> SCREEN event or change the error message

I just put the error message inside AT SELECTION SCREEN and it is ok.

Thanks!

Former Member
0 Kudos
284

Hi Ricardo,

Write the code like,

message 'Error Message' type ' w '.

Thanks.

Reward If Helpful.

former_member196299
Active Contributor
0 Kudos
284

hi ,

here is the addition :

IF len_bankl NE 8 AND len_bankl NE 11.

MESSAGE E001 WITH 'Error message'.

leave to list processing .

ENDIF.

Former Member
0 Kudos
284

Hi,

IF len_bankl NE 8 AND len_bankl NE 11.

MESSAGE E001 WITH 'Error message'.

<b>stop.</b>

ENDIF.

Then it will be on the Selection screen to correct the values.

Reward, if useful.

Regards,

U. Uma

sharadendu_agrawal
Active Participant
0 Kudos
284

U cannot come back to the selection screen after the error message(message type is type E) because it stops the further processing . For that u have to give the message either as the information message(type I) or the status message(type S).

Reward if useful

Cheers

Sharadendu

Former Member
0 Kudos
284

Use following code......

IF len_bankl NE 8 AND len_bankl NE 11.

MESSAGE E001 WITH 'Error message'.

leave to screnn 0.

ENDIF.

Former Member
0 Kudos
284

reward some points if useful.

Regards,

Padmakar

Former Member
0 Kudos
284

hi

raise the error in At Selection-screen event...it will stay in the selection screen and will enable the input again to accept correct values

if helpful, reward

Sathish. R

Former Member
0 Kudos
284

Hi RC ,

how can u check 2 conditions at a time ?

 IF len_bankl NE 8 <b>OR</b> len_bankl NE 11.
    MESSAGE E001 WITH 'Error message'.
  ENDIF.

.

When u raise error message , y it is terminating u? paste ur complete code over here ?

Regards

Peram

0 Kudos
284

> Hi RC ,

>

> how can u check 2 conditions at a time ?

>

>

 IF len_bankl NE 8 <b>OR</b> len_bankl NE 11.
>    MESSAGE E001 WITH 'Error message'.
> NDIF.

.

>

> When u raise error message , y it is terminating u?

> paste ur complete code over here ?

>

> Regards

> Peram

Hello.

Don't worry about the logical expression. It just looks confusing but it is correct. _

len_bankl should only be equal to 8 or 11, so the error will be raised if other values is in len_bankl.