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

help in message

Former Member
0 Likes
690

hallow i doing a report program that select some course from table . in the selection screen if u bring invalid course i bring a message like the course is invalid .

the problem is that i do that after select and not in at selection screen, and after the message come i have dump. my question if the user put course invalid i wont after the message he continue to write courses how can i do that?

select .....

if sy-subrc <> 0.

message i(014)

<b>leave to ?</b>

which screen or other option

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
657

You can use the option below: (assuming that you are not displaying any list in the event END-OF-SELECTION).

if sy-subrc <> 0.

message i(014)

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

endif.

7 REPLIES 7
Read only

Former Member
0 Likes
658

You can use the option below: (assuming that you are not displaying any list in the event END-OF-SELECTION).

if sy-subrc <> 0.

message i(014)

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

endif.

Read only

Former Member
0 Likes
657

Use the STOP. command.

This would skip the rest of the code in the start-of-selection and go to the first line of te end-of-selection.

Use EXIT. if you want to exit the program itself.

Regards,

Ravi

Read only

Former Member
0 Likes
657

Hi Antonio,

Apparently you don't want to use the AT SELECTION-SCREEN. A trick would be to give a S message (instead of I) and to submit the report again, so:

message S(014).

SUBMIT sy-repid.

Regards,

John.

Read only

Former Member
0 Likes
657

Hi,

You have to do SCreen Validations in the event AT SELECTION SCREEN only.

Even if you enter wrong values it will stop there itself, without going to select statements, which unnecessarily consumes time of the database.

After select statement you can check SY-SUBRC and give error Message and use STOP.

If sy-subrc <> 0.

Message ....

STOP or EXIT.

Endif.

It won't dump.

Regards,

Anji

Read only

Former Member
0 Likes
657

hi,

ONE WAY IS TO

CREATE A F4 HELP FOR UR FIELD IN SELECTION SCREEN(COURSE).

WHATS THE DUMP U ARE GETTING?

Read only

Former Member
0 Likes
657
SELECT-OPTIONS: s_matnr FOR  marc-matnr.                  "Material No
AT SELECTION-SCREEN ON s_matnr.
 
*Validate material no details
  PERFORM validate_matno.
FORM validate_matno.
DATA: v_matnr LIEK mara-matnr.
IF NOT s_matnr[] IS INITIAL.
LOOP AT s_matnr.
  SELECT SINGLE matnr INTO v_matnr
         FROM mara
         WHERE matnr = s_matnr-low.
 
  IF sy-subrc NE 0.

<b>MESSAGE i128.

LEAVE LIST-PROCESSING</b>.

ENDIF.
ENDLOOP.
ENDIF.
ENDFORM.

make sure u r using the message number available in ur message class.

Reward if u find helpful,

Read only

Former Member
0 Likes
657

hi

I think u might have given an abend msg...there should not b any problem with the ifo msg type...even if given after select...

would u like to send the code that u have written...