Skip to Content
author's profile photo Former Member
Former Member

help in OO

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 03:12 PM

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

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 05:56 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.