Application Development 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: 

Return to selection screen

Former Member
0 Kudos
147

Hello,

In the program i am writing now, I intended to have the program return back to the selection screen whenever I encountered an error and the user pressed the green tick on the pop up box for the error message. However, what happens to me right now is that all I have is a blank screen with SAP on the title area if I do, for example,

MESSAGE e161(q6) WITH wa_defn-fieldname 'System'.

May I know how can I accomplish that? Thanks!

Regards,

Anyi

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
109

Call this message in the AT SELECION-SCREEN event.

at selection-screen.

MESSAGE e161(q6) WITH wa_defn-fieldname 'System'.

Regards,

Rich Heilman

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
110

Call this message in the AT SELECION-SCREEN event.

at selection-screen.

MESSAGE e161(q6) WITH wa_defn-fieldname 'System'.

Regards,

Rich Heilman

0 Kudos
109

But I thought an Error message would immediately stop the entire program and the part to exit loop does not even exit. Furthermore, I do not want to generate the report, I want it to go back to selection screen without actually generate the report. Is that possible? Thanks a lot!

Anyi

0 Kudos
109

Then you must do your validation with the message in the AT SELECTION-SCREEN event.

Is this not working for you?

Regards,

Rich Heilman

0 Kudos
109

Hi,

check this :

in that case raise your error message with STOP statement like below, then system will stop the further processing and it will come back to selection screen.

MESSAGE s161(q6) WITH wa_defn-fieldname 'System'.

STOP.

Regards

Appana

Message was edited by: L Appana

0 Kudos
109

if it is in the start-of-selection event...

message i000(fb) with 'Error'.

exit.

-


if it is inside of a form...

message i000(fb) with 'Error'.

gv_error = 'X'.

exit.

then in the calling form and/or start-of-selection...

check gv_error is initial.

0 Kudos
109

> Then you must do your validation with the message in

> the AT SELECTION-SCREEN event.

>

> Is this not working for you?

>

> Regards,

> Rich Heilman

I did put that in the At Selection-Screen event, but all it threw to me was a blank screen with title 'SAP'...

Anyi

0 Kudos
109

Use LEAVE LIST-PROCESSING.

AT SELECTION-SCREEN.

Check for sy-ucomm eq 'ONLI'.

*Select Data.

And If you want to give any status message give the status message and mark a flag eq X.

Check for this flag and use LEAVE LIST-PROCESSING.

Regards,

Prakash

0 Kudos
109

Can you please post your code?

Regards,

Rich Heilman

0 Kudos
109

REPORT ysample.

SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_cust FOR but000-partner OBLIGATORY, "Business Partner

s_status FOR zspa_supstat-zzsptstatus " Status

NO INTERVALS NO-EXTENSION

MATCHCODE OBJECT zs_supstat_es.

SELECTION-SCREEN END OF BLOCK a1.

***********************************************************************

  • AT SELECTION SCREEN

***********************************************************************

AT SELECTION-SCREEN.

PERFORM check_selection_screen_data.

*Select Installation.

CHECK sy-ucomm EQ c_onli.

PERFORM select_data.

**********************************************************

  • START OF SELECTION

**********************************************************

START-OF-SELECTION.

*-- Display Installation List

IF ws_execute EQ c_x AND NOT i_final[] IS INITIAL.

CALL SCREEN 9000.

ELSE.

MESSAGE s001(zmmm) WITH 'No data found'.

LEAVE LIST-PROCESSING.

ENDIF.

*&----


*& Form select_data

*&----


  • Select Installation from Business partner

*----


Select Installation from EANL Table

SELECT a~anlage

a~anlart

a~zzkunnr

a~zzsptstatus

b~str_erg2

b~haus

INTO TABLE i_installation

FROM eanl AS a INNER JOIN evbs AS b

ON avstelle EQ bvstelle

WHERE a~zzkunnr IN s_cust

AND a~zzsptstatus IN s_status

AND a~sparte EQ c_sparte.

IF sy-subrc NE 0.

MESSAGE s001(zesspa) WITH text-004.

EXIT.

ELSE.

ws_execute = c_x.

ENDIF.

ENDFORM. " select_data

Former Member
0 Kudos
109

hi,

do this

MESSAGE e161(q6) WITH wa_defn-fieldname 'System'<b> display like 'S'</b>.

EXIT.

dont use write statement in the report before error message.

<b>Please Reward Points & Mark Helpful Answers</b>

To mark Helpful Answers ;click radio Button next to the post.

RadioButtons

<b>o</b> Helpful Answer

<b>o</b> Very helpful Answer

<b>o</b> Problem Solved.

Click any of the above button next to the post; as per the anwers

<b>To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers</b>