‎2009 Jan 15 7:42 AM
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
‎2009 Jan 15 7:50 AM
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
‎2009 Jan 15 7:46 AM
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.
‎2009 Jan 15 7:50 AM
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.
‎2009 Jan 15 7:50 AM
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
‎2009 Jan 15 10:23 AM
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
‎2009 Jan 15 9:38 AM
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
‎2009 Jan 15 9:58 AM
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..
‎2009 Jan 15 10:05 AM
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
‎2009 Jan 15 10:08 AM
You are right Deepa
Display Error Message as Information Message or Warning Message Kittu
‎2009 Jan 22 6:53 AM
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