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

With Error message - Back to selection screen.

Former Member
0 Likes
7,937

Hi,

I am calling a Function module in the Start-of selection, If the FM is giving the subrc value other that 0 (Zero) I need to throw the Error message and need to be back to selection screen.

this I can do it by Sucess messame with LEAVE LIST-PROCESSING. But my requirement is to show the same with error message.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,403

Hi

Please try the below piece of code, it should work the way you want.


message s000 with 'test' DISPLAY LIKE 'E'.
leave LIST-PROCESSING

Regards

Ranganath

18 REPLIES 18
Read only

Former Member
0 Likes
4,403

after FM, if sy-subrc <> 0.

leave list processing.

message S001 with 'some message' display like 'E'.

Ashok

Edited by: Ashoky on Mar 21, 2011 12:54 PM

Read only

Former Member
0 Likes
4,404

Hi

Please try the below piece of code, it should work the way you want.


message s000 with 'test' DISPLAY LIKE 'E'.
leave LIST-PROCESSING

Regards

Ranganath

Read only

0 Likes
4,403

Hi Ranganath,

I tries with the below statement

MESSAGE S398 WITH 'Table' TABNAME 'does not exists' 'please check' DISPLAY LIKE 'E'.

leave LIST-PROCESSING'.

I am seeing syntax error saying the field DISPLAY is unknown.

Read only

0 Likes
4,403

You've probably exceeded the number of placeholders in the message.

Concatenate 'Table' TABNAME 'does not exists' 'please check' into a string variable e.g. LV_MESSAGE and then retype your syntax as:

MESSAGE S398 WITH LV_MESSAGE DISPLAY LIKE 'E'.

Read only

0 Likes
4,403

Hi Dude.

Try like this,

PARAMETERS : p_test TYPE char10.

START-OF-SELECTION.

WRITE : / p_test.

IF p_test = 'AA'.

MESSAGE s001(ziam) DISPLAY LIKE 'E'.

LEAVE LIST-PROCESSING.

ENDIF.

END-OF-SELECTION.

Enjoy!!

Aahbha

Read only

0 Likes
4,403

How u r able to activate the code.

I wrote the same MESSAGE S398 WITH L_MESSAGE DISPLAY LIKE 'E'.

but I still see the same syntax error message the field

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
4,403

Hello,

Which version of SAP are you in?

BR,

Suhas

Read only

0 Likes
4,403

it's 4.6c

Read only

0 Likes
4,403

I can't go with write statement.

Read only

0 Likes
4,403

Hi,

Check whether the message has a place holder in it. I

Regards,

Rahul Muraleedharan.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
4,403

>

> it's 4.6c

That's the problem. DISPLAY LIKE addition is available from Release 610 onwards.

Alternatively you can try something like this:

PARAMETERS: p_tab TYPE tabname OBLIGATORY.

AT SELECTION-SCREEN.

  IF sy-ucomm = 'ONLI' OR sy-ucomm = 'PRIN'.
*   Check if the table exists in DDIC
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        tabname   = p_tab
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
    IF sy-subrc <> 0.
      MESSAGE e007(e2) WITH p_tab.
    ENDIF.
  ENDIF.

@Other posters: Please read the responses carefully before posting. The OP has already mentioned he is in 46C, so no point in proposing the DISPLAY LIKE addition.

Cheers,

Suhas

Read only

0 Likes
4,403
MESSAGE S398 WITH L_MESSAGE DISPLAY LIKE 'E'.

HI,

Does your message 398 have a placeholder (&) ..

If not just use

MESSAGE S398 DISPLAY LIKE 'E'.

And is you want to add custom text to teh message use a message no with placeholders.

Suzie

Read only

0 Likes
4,403

Hi,

Thanks, it was helpfull.

actually our requirement is to create Custom SE16 by skipping all the chnage options of standard SE16.

if the user enters the table I can manage it with the FM u provided in the even At Selection screen.

No issues I got the complete logic that to be added in the At Selection screen.

I will be adding the logic of FM RS_TABLE_LIST_CREATE of Perform DATABASE_EXIST_CHECK.

Ok thx to all the Supporters.

I am closing the issue...

Read only

0 Likes
4,403

Hi Ranganath,

Thanks for Answer, it worked!!

Read only

Former Member
0 Likes
4,403

Hi

I think this is not possibe, because even when you call screen, leave screen or List procesing. i will not display the message in Selection screen.

Try to do it, below the end of the selection.

All the Best.

With regards,

Aahbha

Read only

Former Member
0 Likes
4,403

Hi,

you can try the following :

IF p_test = 'AA'.

MESSAGE i007 (Error) with ': message required'

stop.

ENDIF.

thanks,

reagrds,

akshay ruia.

Read only

Former Member
0 Likes
4,403

Hi there,

PARAMETERS : p_test TYPE char10.

DATA : LV_MESSAGE TYPE STRING.

START-OF-SELECTION.

WRITE : / p_test.

lv_message = 'HAI'.

IF p_test = 'AA'.

MESSAGE s001(zhcm) WITH LV_MESSAGE DISPLAY LIKE 'E'.

LEAVE LIST-PROCESSING.

ENDIF.

END-OF-SELECTION.

it is working fine.

Read only

Former Member
0 Likes
4,403

Hi friend,

Please try the same with Leave to Screen 0.

Thanks and Regards,

Sri Hari Anand Kumar