0% found this document useful (0 votes)
776 views4 pages

Back To Selection Screen After Error - SCN

The document discusses different ways to return to the selection screen after an error occurs in an ABAP report. It provides sample code snippets using MESSAGE, STOP, LEAVE LIST-PROCESSING and EXIT to return control to the selection screen from within a routine triggered by an error condition.

Uploaded by

Sameer Salam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
776 views4 pages

Back To Selection Screen After Error - SCN

The document discusses different ways to return to the selection screen after an error occurs in an ABAP report. It provides sample code snippets using MESSAGE, STOP, LEAVE LIST-PROCESSING and EXIT to return control to the selection screen from within a routine triggered by an error condition.

Uploaded by

Sameer Salam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2/11/2016

Backtoselectionscreenaftererror|SCN

GettingStarted Newsletters

Hi,Guest

LogOn

JoinUs

Store

SearchtheCommunity

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

Communications

Actions

10Replies Latestreply:Dec29,20155:15PMbyAleksandraPatrzalek

Share

Tweet

Like

CharlesKennedySchulzOliveira

Feb29,20121:34PM

Backtoselectionscreenaftererror
ThisquestionhasbeenAnswered.
HelloABAPers,

Ihaveaexecutableprogram(REPORT)todosomeprocessing(e.g.readastandardtablewiththe
parametersandselectoptionsandsavethedatainaZtable).

Whenoccursanerror(e.g.whensysubrc<>0afterselect)andamessageoftypeEisshowed,the
programshowthemessageina"clean"screenwithtitleSAP.Then,afterENTERorESC,itleavesto
initialscreenofSAP(SAPEasyAccess).

ThemessageoftypeEistriggeredfromaroutine(FORM)calledfromSTARTOFSELECTIONevent.
Andtheprogramdontwritenothinginlist(onlyreturnastatusmessageifeverithingisok).

HowcanIforcetheprogramtobacktoselectionscreenaftersomeerror?

Thanksinadvance.

Bestregards,
CharlesOliveira

CorrectAnswer
bySharathPanugantionMar13,20093:47PM
hi,

Dothefollowingforyourrequirement.

inthemessagegivethefollowing

startofselection.
Perform<routine>.
.
.
.
.
.
.
Form<routine>.
if<condition>.
message'xxxx'type'S'displaylike'E'.
exit.
endif.
endform.

Thiswaythecontrolreturnstoselectionscreenevenafterthemessageistriggered.

Thanks
Sharath

HelpfulAnswerbyMeesalaRajaramana

2597Views

AverageUserRating
(1rating)

https://scn.sap.com/thread/1270341

1/4

2/11/2016

Backtoselectionscreenaftererror|SCN

SharathPanuganti Mar13,20093:47PM (inresponsetoCharlesKennedySchulzOliveira)

CorrectAnswer Re:Backtoselectionscreenaftererror
hi,

Dothefollowingforyourrequirement.

inthemessagegivethefollowing

startofselection.
Perform<routine>.
.
.
.
.
.
.
Form<routine>.
if<condition>.
message'xxxx'type'S'displaylike'E'.
exit.
endif.
endform.

Thiswaythecontrolreturnstoselectionscreenevenafterthemessageistriggered.

Thanks
Sharath

Like(1)

CharlesKennedySchulzOliveira Feb29,20121:34PM (inresponsetoSharathPanuganti)

Re:Backtoselectionscreenaftererror
HiSharath,

Yoursolutionworked.ButIusedSTOPintheplaceofEXIT,becausetheresotherformbeing
calledafterthefirst.

Thankyou.

Like(0)

AleksandraPatrzalek Dec29,20155:15PM (inresponsetoSharathPanuganti)

Re:Backtoselectionscreenaftererror
Thanks@

SharathPanuganti.Thatworked!ItoothinkweshoulduseSTOPinsteadofEXIT

likeothershavementioned....EXITshouldbeusedforexitingloopsonly.

Like(0)

JacobMammen Mar13,20093:46PM (inresponsetoCharlesKennedySchulzOliveira)

Re:Backtoselectionscreenaftererror
try
MessageSXXXdisplaylike'E'.
Exit.

Mathews

Like(0)

MeesalaRajaramana Mar13,20093:55PM (inresponsetoCharlesKennedySchulzOliveira)

HelpfulAnswer Re:Backtoselectionscreenaftererror
HI,

insteadof'exit'use'stop'.

https://scn.sap.com/thread/1270341

2/4

2/11/2016

Backtoselectionscreenaftererror|SCN

if<condition>.
message'xxxx'type'S'displaylike'E'.
STOP.
endif.

Like(0)

GurpreetSingh Mar13,20094:10PM (inresponsetoCharlesKennedySchulzOliveira)

Re:Backtoselectionscreenaftererror
STARTOFSELECTION.
IF<LOGICALEXP>.
Message'XXX'TYPE'S'DisplayLike'E'.
LeaveLISTPROCESSING.
ENDIF.

OR

STARTOFSELECTION.
IF<LOGICALEXP>.
Message'XXX'TYPE'S'DisplayLike'E'.
EXIT.
ENDIF.

Regards,
Gurpreet

Like(0)

NarendranMuthukumaran Mar13,20094:09PM (inresponsetoCharlesKennedySchulzOliveira)

Re:Backtoselectionscreenaftererror
Hi,

Trythis..

MESSAGEI208(00)WITH'NODATAFOUND'.
LEAVELISTPROCESSING.

Thanks
Naren

Like(0)

JumpJeelani Mar13,20094:18PM (inresponsetoCharlesKennedySchulzOliveira)

Re:Backtoselectionscreenaftererror
izitsupposedtobeerrormessage?ifitcanbeinformativewhensometHingfailedandgobackto
selectionscreen

Trythis:

IFSYSUBRC=0.
messagei<id>with'NODATAFOUND'.
EXIT.
ENDIF.

Editedby:BrightSideonMar13,20093:17PM

Like(0)

NarendranMuthukumaran Mar13,20096:26PM (inresponsetoCharlesKennedySchulzOliveira)

Re:Backtoselectionscreenaftererror
Hi,

Thestopwillworkaslongasyoudon'thaveENDOFSELECTION...

https://scn.sap.com/thread/1270341

3/4

2/11/2016

Backtoselectionscreenaftererror|SCN
IfyouhaveENDOFSELECTIONevent...thenthestopwillgotothatevent...

Thanks
Naren

Like(1)

CharlesKennedySchulzOliveira Mar13,20097:41PM (inresponsetoNarendranMuthukumaran)

Re:Backtoselectionscreenaftererror
Yeah,Iknowthat.

Thankyouanyway.

Like(0)

Share

SiteIndex
Privacy

Tweet

ContactUs
TermsofUse

https://scn.sap.com/thread/1270341

Like

SAPHelpPortal
LegalDisclosure

Copyright

FollowSCN

4/4

You might also like