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

Need idea if i write This code

Former Member
0 Likes
264

Hi,

i Do This Code and i Wont To have idea How to do it Better.

i have to do the select for every month for 13 month before today.

Regards

&----


*& Form ap

&----


  • text

----


  • -->P_L_BEGDA13 text

  • -->P_L_BEGDA12 text

  • -->P_CATS_TAB text

----


FORM ap TABLES p_cats_tab USING p_l_begda13

p_l_begda12.

SELECT *

FROM catsdb

APPENDING CORRESPONDING FIELDS OF TABLE p_c_tab

WHERE workdate BETWEEN p_l_begda1 AND p_l_begda2.

ENDFORM. " ap

PERFORM: ap TABLES cats_tab1 USING l_begda13 l_begda12 ,

ap TABLES cats_tab2 USING l_begda12 l_begda11 ,

ap TABLES cats_tab3 USING l_begda11 l_begda10 ,

ap TABLES cats_tab4 USING l_begda10 l_begda9 ,

ap TABLES cats_tab5 USING l_begda9 l_begda8 ,

ap TABLES cats_tab6 USING l_begda8 l_begda7 ,

ap TABLES cats_tab7 USING l_begda7 l_begda6 ,

ap TABLES cats_tab8 USING l_begda6 l_begda5 ,

ap TABLES cats_tab9 USING l_begda5 l_begda4 ,

ap TABLES cats_tab10 USING l_begda4 l_begda3 ,

ap TABLES cats_tab11 USING l_begda3 l_begda2 ,

ap TABLES cats_tab12 USING l_begda2 l_begda1 ,

ap TABLES cats_tab13 USING l_begda1 sy-datum .

1 REPLY 1
Read only

andreas_mann3
Active Contributor
0 Likes
246

select all of catsdb

and move data to an itab with period as key-field

hope that helps

Andreas