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

selection screen flow

k_gjergja
Participant
0 Likes
1,316

Hello ,

I have an issue with  program flow in selection screen rapport. In my perform "get _data i have several checks after select statements .

At the last one ( below) when sy-subrc = 4 i have  pop up ( info ) saying that  data was not found. After change of select criteria  hiting the enter  "at select  screen" event  is trigered  and  program executes performs below  end-of selection ( jumping over start of selection ) .

I do not understand why  perform get data is not executed after the  message were displayed.

please advice

Chris

   IF sy-subrc = 0.
    SELECT changenr udate FROM cdhdr
      INTO CORRESPONDING FIELDS OF TABLE i_change
      FOR ALL ENTRIES IN i_cdpos
      WHERE objectid   EQ i_cdpos-objectid   AND
            objectclas EQ i_cdpos-objectclas AND
            changenr   EQ i_cdpos-changenr.
  ELSE.
    MESSAGE ID '/BDL/TASKMANAGER' TYPE 'I' NUMBER '102'.
    CALL SELECTION-SCREEN 1000 .

   INITIALIZATION.
  PERFORM clear.
  PERFORM set_up_doc_type.
  PERFORM set_ranges.
  g_repid = sy-repid.
  PERFORM fld_cat USING it_fcat.
  PERFORM build_eve.  " hot spot detail tbl
  PERFORM built_eve1. " call trx

  at selection-screen.
perform validate_fy.

START-OF-SELECTION.
  PERFORM get_data.
END-OF-SELECTION.

  PERFORM calculate_no_of_days.
  PERFORM build_layout.
  PERFORM display_data.

1 ACCEPTED SOLUTION
Read only

SharathYaralkattimath
Contributor
0 Likes
1,270

HI,

Instead of using the statement call selection screen 1000.

try using LEAVE TO SCREEN 0 & try, let me know...

8 REPLIES 8
Read only

laurent_fournier2
Contributor
0 Likes
1,270

Hi,

When the user press enter on selection screen, the events at selection-screen & at selection-screen output are triggered.Statements between start-of-selection and end-of-selection are executed when user press F8 to execute the report.

I'm not very sure If I have understand correctly your problem.

Read only

0 Likes
1,270

Hi ,

The problem comes when  after one of selectst data were not found and the error message is displayed. ( please see the firs part of the code .This query is in perform grt data )

So data were not found ,  Info pop up is displayed  and user hits enter ( upon  message display) , changes data on selection screen and than flow goes on again trough at- selection screen ( which is ok ) but when start of selectio has to be executed , program jumps over it and goes directly to performs below end of selection.

I would expect,  after mesage ( no data selected) was displayed and user has change entry on selection screen , that program goes to get_data perform and try to retrieve data with once more with new criteria.

Thanks

Read only

SharathYaralkattimath
Contributor
0 Likes
1,271

HI,

Instead of using the statement call selection screen 1000.

try using LEAVE TO SCREEN 0 & try, let me know...

Read only

0 Likes
1,270

Hi ,

The statement leave to screen 0 exits the program. This is not what I am looking for . After eror message displays tah dat were not found , i need to get back to select screen where user will change

criteria hit F8 and the program executes again.

Read only

0 Likes
1,270

Hi again,

Let me propose you something.

Change the get_data routine and add a changing parameter.

Mark the parameter with X if selection is succesfull or space if selection is invalid.

Then, check the parameters value to see if you will go on on the display of the records or issue the message.

Call selection screen is not needed in this case.

Try it and let me know.

Regards.

perform get_data changing success.

END-OF-SELECTION.
if success = 'X'.
  PERFORM calculate_no_of_days.
  PERFORM build_layout.
  PERFORM display_data.

else.

message i999(xx) with......

endif.


Read only

0 Likes
1,270

Use LEAVE LIST-PROCESSING after the message and check.

Thanks,

Shambu

Read only

0 Likes
1,270

thanks

Read only

Aashish28
Contributor
0 Likes
1,270

Hiiii,

          Just write - leave to current transaction after your message.