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: 

help in OO

Former Member
0 Kudos

Hi,

i have this code and i have to use it in many FM (same function group) there is a way to use it in object oriented ?

i new to abap object.

PERFORM qua TABLES periods USING sy-datum.
  READ TABLE periods INTO wa_periods INDEX 1.
  PERFORM quar TABLES periods USING wa_periods-low.
  READ TABLE periods INTO wa_periods INDEX 8.
  PERFORM quar TABLES periods USING wa_periods-low.
  SORT periods BY low.
  DELETE ADJACENT DUPLICATES FROM periods.


  LOOP AT periods ASSIGNING <fs_periods>.
    IF sy-tabix < 8.
      APPEND : <fs_periods> TO periods1.
    ENDIF.
    IF sy-tabix > 9.
      APPEND : <fs_periods> TO periods2.
    ENDIF.
  ENDLOOP.

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

you can create method with internal table periods as your input parameter

Do you just want to convert this bit alone into OO?

3 REPLIES 3

Former Member
0 Kudos

you can create method with internal table periods as your input parameter

Do you just want to convert this bit alone into OO?

0 Kudos

Hi Sriram Chandran ,

yes this is what i wont,

to convert this bit alone into OO.

.

Regards

Former Member
0 Kudos

i wouldn't bother with all that.

I would just create a new function module with that code. Add the appropriate IMPORTING/EXPORTING/TABLES parameters and you're ready to go.

Otherwise, you can just create a new INCLUDE program and store the code there. Then, whenever you need to call that code, just put


INCLUDE zyour_include_name

it doesn't have to be difficult.