Skip to Content

Converting a Report to a Function Group

Hello,

Our customer have a big and old ABAP report which includes many useful subroutine forms and classes about their business, now they need some functionalities and screens to be used in other programs and also in RFC functions,
so I started to work on converting this report to a new Function Group.

The old ABAP report starts with a selection screen for data filtering and continues with START-OF-SELECTION event an other dialog screen calls in END-OF-SELECTION event. I started by moving all routines and local classes to top include of new Function Group now.

My question is :

I want the transaction code of this program to work as before in new Function Group, without changing anything.
I just want to be able to use form subroutines and local classes in some new Function Modules to call from other programs.

But selection screen 1000 (default sel. screen) is not allowed in Function Group and also report events START-OF-SELECTION , END-OF-SELECTION is not being triggered.


Is there any quick way to make the transaction code work in new Function Group
without manually calling selection the screen and re-arranging the queue of events ?

Thank you

Add a comment
10|10000 characters needed characters exceeded

  • you could simple create one function module per subroutine, or if it possible group those subroutine to one function module depend on it purpose.

    for selection screen, you cant create it in function group, create a dynpro instead. then in SE93, place the function group main program + that screen.

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Oct 30, 2019 at 11:06 AM

    For those interested in the solution ,

    It was easy to solve :

    1- I've collected all the ABAP code in report events into FORM routines, "initialization", "start_of_selection" and "end_of_selection"

    2- I've a created a copy of Selection Screen of Report in function group with number 1001
    by using " selection-screen begin of screen ..." and " selection-screen end of screen .." statements

    3- In a Function Module I've called everything in a loop as below :

      DO.
    
        PERFORM initialization.
    
        CALL SELECTION-SCREEN 1001.
    
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
    
        PERFORM start_of_selection.
    
        if gv_hata EQ 'X'.
          CONTINUE.
        ENDIF.
    
        PERFORM end_of_selection.
    
      ENDDO.
    
    
    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.