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

Issue with the message type E

Former Member
0 Likes
2,537

Hello,

In the event STAR-OF-SELECTION, i put an error message like mentioned below:

But, when this error message occurs, it bolcks all of the process and i will leave the program.

Even though, i want that when the error message occurs, i return to the selection screen and the

message will be displayed at the bottom like an error message in the event AT SELECTION-SCREEN.

SELECT GUID_PRCTSC "Primary Key as GUID in "RAW" Format

GUID_PR "Primary Key as GUID in "RAW" Format

STCTS "Numbering Scheme for Customs Tariff System

GUID_CTSNUMC "Primary Key as GUID in "RAW" Format

FROM /SAPSLL/PRCTSC

INTO TABLE T_PRCTSC

WHERE STCTS IN S_STCTS.

IF T_PRCTSC IS INITIAL.

MESSAGE : E007(ZMSSG) WITH 'Data not available for this entry'.

  • LEAVE TO LIST-PROCESSING.

  • CALL SCREEN 1000.

ENDIF.

I even tried with message types W, S...etc..but it will letting me to reach the Output screen.

Any suggestions will be appreciated!

Regards,

Kittu

Edited by: Kittu on Jan 15, 2009 8:42 AM

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,902

Hello Kittu

I would add the following check at event AT SELECTION-SCREEN:


AT SELECTION-SCREEN.

" Check if we can find at least a single entry
SELECT SINGLE *
FROM /SAPSLL/PRCTSC
WHERE STCTS IN S_STCTS.

IF ( syst-dbcnt = 0 ).
  MESSAGE : E007(ZMSSG) WITH 'Data not available for this entry'.
ENDIF.

Then the error message will throw the user back onto the selection screen.

Regards

Uwe

9 REPLIES 9
Read only

Former Member
0 Likes
1,902

Hi Kittu,

Try this:

IF T_PRCTSC IS INITIAL.

MESSAGE : E007(ZMSSG) WITH 'Data not available for this entry'.

  • LEAVE TO LIST-PROCESSING.

  • CALL SCREEN 1000.

ELSE. --> Add this

Put the rest of your code here (under else).

ENDIF.

Read only

Former Member
0 Likes
1,902

Hi,

Try this :

Give an information message, then set the screen to 0 and leave the screen. This should take you to the selection screen.


SELECT GUID_PRCTSC "Primary Key as GUID in "RAW" Format
GUID_PR "Primary Key as GUID in "RAW" Format
STCTS "Numbering Scheme for Customs Tariff System
GUID_CTSNUMC "Primary Key as GUID in "RAW" Format
FROM /SAPSLL/PRCTSC
INTO TABLE T_PRCTSC
WHERE STCTS IN S_STCTS.


IF T_PRCTSC IS INITIAL.
MESSAGE : I007(ZMSSG) WITH 'Data not available for this entry'.
SET SCREEN 0.
LEAVE SCREEN. 
ENDIF.

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,903

Hello Kittu

I would add the following check at event AT SELECTION-SCREEN:


AT SELECTION-SCREEN.

" Check if we can find at least a single entry
SELECT SINGLE *
FROM /SAPSLL/PRCTSC
WHERE STCTS IN S_STCTS.

IF ( syst-dbcnt = 0 ).
  MESSAGE : E007(ZMSSG) WITH 'Data not available for this entry'.
ENDIF.

Then the error message will throw the user back onto the selection screen.

Regards

Uwe

Read only

0 Likes
1,902

I agree with Uwe, since you are using the select option from the selection screen in the where condition , you can control this at the selection screen processing itself.

regards,

Advait

Read only

Former Member
0 Likes
1,902

Hi...

AT SELECTION-SCREEN. 
if sy-subrc eq 0. 
              * write the code to be processed on success retrieval 
else. 
message 'selection not successful'  type 'E'. 
endif.

Hope this helps you.......

Thanks and regards

Bhuvana

Read only

Former Member
0 Likes
1,902

AT SELECTION-SCREEN on S_STCTS.

" Check if we can find at least a single entry

SELECT *

FROM /SAPSLL/PRCTSC

into table itab

WHERE STCTS IN S_STCTS.

IF itab[] is initial .

MESSAGE : E007(ZMSSG) WITH 'Data not available for this entry'.

ENDIF.

start-of-selection..

Read only

Former Member
0 Likes
1,902

Hi Kittu,

You can display the error message like information message by using the syntax,

MESSAGE e002 DISPLAY LIKE 'I'

In your case, write like

IF T_PRCTSC IS INITIAL.

MESSAGE : E007(ZMSSG) display like u2018Iu2019.

u2022 LEAVE TO LIST-PROCESSING.

u2022 CALL SCREEN 1000.

ENDIF.

Now double click on E007 and Enter your message as Data not available for this entry and save it.

Hope above solution will help you.

Best Regards,

Deepa Kulkarni

Read only

0 Likes
1,902

You are right Deepa

Display Error Message as Information Message or Warning Message Kittu

Read only

Former Member
0 Likes
1,902

Hi,

I am sorry for the late response!

Thank you for all your suggestions!

I had used in the followng way and it resolved my issue.

SELECT GUID_PRGEN  "Primary Key as GUID in "RAW" Format
         GUID_PR     "Primary Key as GUID in "RAW" Format
         ATTR20A     "SUBSTANCE ID
         ATTR05A     "Materail Type
         ATTR10A     "Materail Group
         ATTR05B     "Sub-Family
         FROM /SAPSLL/PRGEN
         INTO TABLE T_PRGEN
         WHERE ATTR20A IN S_AT20A.

  IF T_PRGEN IS INITIAL.
    MESSAGE : I007(ZMSSG) WITH 'Data not available for this entry'.
    STOP.
  ENDIF.

Regards,

Kittu