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

Retrieve Data

Former Member
0 Likes
710

Can i Retrieve Data after END_OF_SELECTION

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
685

Hi!

Yes you can retrieve the data in END-OF-SELECTION event.

Have a look at this sample code.


REPORT z_sdn.

DATA:
  fs_tab TYPE scarr.

DATA:
  t_tab TYPE TABLE OF scarr.


END-OF-SELECTION.

  SELECT *
    FROM scarr
    INTO TABLE t_tab.


 LOOP AT t_tab INTO fs_tab.
   WRITE: / fs_tab-carrid.
 ENDLOOP.

Regards

Abhijeet

6 REPLIES 6
Read only

Former Member
0 Likes
685

Hi Vijaya,

END_OF_SELECTION is the last event. You cannot process data after this event.

This event is triggered after the START-OF-SELECTION is completed.

This statement tells the server that all the database reading is completed and no more data reading is going to take place. END-OF-SELECTION is generally used for the summary/results of reports. In an executable program without logical data base, there is no need to implement the event block END-OF-SELECTION.

After a program is executed by the user, the database is locked when it encounters a START-OF-SELECTION statement and the lock is released when an END-OF-SELECTION statement is encountered (to maintain the consistency). Data selection is done between START-OF-SELECTION and END-OF-SELECTION. Now if we donu2019t write the END-OF-SELECTION statement, the database will remain locked till the programs get terminated. Hence, the performance will be reduced. So it is always good practice to write END-OF-SELECTION statement after finishing the data selection from database.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
685

yes you can retrieve data anywhere in your program, after

end-of-selection, before that, in initialization also but i dont think any requirement of this type will ever come....right it does nt make any sense.

end-of-selection is the last event of the list and it is triggered after geting all the data for the database. the end-of-selection event is used for taking appropriate actions the programmer wants to take before the list is displayed. its mainly used to formatt the data before displaying

With all the luck,

Pritam.

Read only

Former Member
0 Likes
686

Hi!

Yes you can retrieve the data in END-OF-SELECTION event.

Have a look at this sample code.


REPORT z_sdn.

DATA:
  fs_tab TYPE scarr.

DATA:
  t_tab TYPE TABLE OF scarr.


END-OF-SELECTION.

  SELECT *
    FROM scarr
    INTO TABLE t_tab.


 LOOP AT t_tab INTO fs_tab.
   WRITE: / fs_tab-carrid.
 ENDLOOP.

Regards

Abhijeet

Read only

Former Member
0 Likes
685

Hi Vijaya,

Please Refer to these links:

Regards,

Shailaja

Read only

Former Member
0 Likes
685

Hi vijay,

You can retreve data in END-OF_SELECTION.

to be frank, this event is mainly for list processing and has no point for which you can't retreve data in it.

Regards,

Anirban

Read only

Former Member
0 Likes
685

no u cannot retrieve the data after END OF SELECTION

check this report and put a break point after end of selection check what happens

data: begin of it_data occurs 0,
           matnr type mara-matnr,
           mbrsh type mara-mbrsh,
           mtart  type mara-mtart,
       end it_data.
data: begin of it_makt occurs 0,
           matnr type makt-matnr,
           maktx type makt-maktx,
      end of it_makt.

parameter: p_matnr type mara-matnr.

initialization.

start-of-selection.

select matnr
         mbrsh
         mtart 
   from mara into table it_data where matnr eq p_matnr.

end-of-selection.

select matnr
         maktx
         from maktx into table it_makt 
         for all entries in it_data
         where matnr eq it_data-matnr.