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: 

Moving to previous screen in report program in start-of-selection event

Former Member
0 Kudos
143

hi experts,

my task is to take values for VKORG(Sales Organization) and VBELN(Billing document) as parameter.

After selecting P_VKORG from f4 help ,then corresponding VBELN should come in  ie P_VBELN f4 help.

Then executing it should show the result.

But if we enter P_VBELN first and den go to P_VKORG and enter VKORG which doesnot contain that VBELN it should show a error.

Till dis my program is correct.

for error i have defined a msg class and used in my report in start-of-selection event.

but after showing the msg the control should come to the initial screen .How to do dis?

i have tried ,leave to screen 0.but it is not working...

Thanks in advance.

1 ACCEPTED SOLUTION

former_member184569
Active Contributor
0 Kudos
102

Hi,

Leave list processing will work fine.

START-OF-SELECTION.

   SELECT * FROM --- " Validate  selection screen parameter value

   IF sy-subrc NE 0.
           
MESSAGE i208(class) WITH text-014  . (Type I or S)

            LEAVE LIST-PROCESSING.
    ENDIF.
  

11 REPLIES 11

Former Member
0 Kudos
102

Hello MUNU,

       write LEAVE LIST-PROCESSING after message.

Regards

Animesh Sundriyal

Former Member
0 Kudos
102

   Hi ,

         you can try CALL SCREEN statment also , but  before that display the error message like status message.

Regards,

Aditya.

VijayaKrishnaG
Active Contributor
0 Kudos
102

Hi Munu,

Write your message statement in AT SELECTION SCREEN event. Then your control will in Selection Screen only.

Or else,

You can use statement LEAVE TO LIST PROCESSING after displaying message. And in this case message should be type S and display like Error.

Thanks & Regards

Vijay

former_member184569
Active Contributor
0 Kudos
103

Hi,

Leave list processing will work fine.

START-OF-SELECTION.

   SELECT * FROM --- " Validate  selection screen parameter value

   IF sy-subrc NE 0.
           
MESSAGE i208(class) WITH text-014  . (Type I or S)

            LEAVE LIST-PROCESSING.
    ENDIF.
  

0 Kudos
102

Hi,

Agreed with susmitha....the control will be back on selection screen if you go as per her suggestion!

arindam_m
Active Contributor
0 Kudos
102

Hi,

Why did you not do it all in AT SELECTION-SCREEN event. You can to LEAVE TO CURRENT TRANSACTION.

Cheers,

Arindam

Former Member
0 Kudos
102

Here you should not show an error message if you are not using any message log.

If you use message log you can given an error message.

Give an information message and then use EXIT statement after the message statement.

This should work.

raymond_giuseppi
Active Contributor
0 Kudos
102

Raising an error message outside of AT SELECTION-SCREEN event may disable every select fields. So you could put your selection of data in this event and only select data which doesn't raise error in the START-OF-SELECTION event.

Sample :

TABLES: sscrfields.

SELECTION-SCREEN BEGIN OF BLOCK dft. " Wrap full selection-screen
* Here definition of selection-screen ...
SELECTION-SCREEN END OF BLOCK dft.

AT SELECTION-SCREEN ON BLOCK dft.
   CASE sscrfields.
     WHEN 'ONLI' OR 'PRIN'.
       PERFORM read_database CHANGING r_code.
       IF r_code NE 0.
         MESSAGE e005(02).
       ENDIF.
   ENDCASE.

Else you could try to raise a message with a syntax like MESSAGE TYPE 'I' ... DISPLAY LIKE 'E'. followed by a LEAVE LISt-PROCESSING or a LEAVE TO CURRENT TRANSACTION ?

Regards,

Raymond

Former Member
0 Kudos
102

Hi

Please check the following code. Modify as per your need

REPORT  ZSMTEST MESSAGE-ID sabapdemos.

  

START-OF-SELECTION.

SELECTION-SCREEN BEGIN OF BLOCK b1

                           WITH FRAME TITLE title.

PARAMETERS: p1 type c,

             p2 type c.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN.

"Put your own logic here

   if not ( p1 = 'A' and p2 = 'AA' ).

     MESSAGE e888 WITH 'Please enter correct value'.

endif.

START-OF-SELECTION.

WRITE: 'value' , p1 , p2.

Hope this solve your query.

Happy Coding

Sandeep

rambabu_k3
Active Participant
0 Kudos
102

Hello Munu,

For validations, it is better to use AT SELCTION-SCREEN ON <FIELD> to validate field and AT SELECTION_SCREEN ON BLOCK <BLK>.

if you raise error meesage in 'ON FIELD' then only that field is input enable and remaining fields in selection screen would be input disable.

if you raise error meesage in 'ON BLOCK' then only fields in block are input enable and remaining fields in selection screen would be input disable.

for your requirement ON BLOCK is idle.

Thanks

Rambabu

Former Member
0 Kudos
102

Hi,

Try like this:-

Message 'Not Valid' Type 'S' Display Like 'E'.

Call Screen <screeen no>

Regards,

Abdul