Skip to Content
author's profile photo
Former Member

Generate an function module

Hi,

is it able to generate an function module by using an other function module or an ABAP statement?

I've already have the function group and want to add an function module in it.

The new function module will have about 50 lines. It needs 4 importing, 3 exporting and 1 table parameter. It have to be an RFC function module.

So how to generate an function module?

Thanks for helping me!!!

Matthias

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Aug 18, 2004 at 09:09 AM

    Go to the object navigator (SE80), select your functions group, right-click at function modules and select create...

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Aug 18, 2004 at 09:21 AM

    Hi Matthias,

    It helps answer your question better if you are a little more specific.

    You want to add a function module to an already existing Function Group. If it is in the customer namespace (Z-objects) you can add another function module. You can also change the code for any of the existing function modules.

    But if it is a standard SAP Function Group, then I'm afraid you cannot do anything about it.

    When you go to SE38 and give the Program of the Function Group, you can see all the function modules in it. You can generate the Function Group from here, which will also generate all the component Function Modules. Let's say you have a Function Group called ABCD, The Function Group Program will usually be called SAPLABCD.

    But as Vic had suggested, SE80 is the best place to do that.

    Hope this inormation is enough to resolve your problem.

    Regards,

    Anand Mandalika.

    Add comment
    10|10000 characters needed characters exceeded

    • Now you left me in the darkness...

      I read what you said, and now my headhache is bigger than before 😊

      I can create functions dinamically, and must store them in internal tables... and then?

      If the app. server crashes... all this functions will be lost? Or it saves them somewhere... where? how?

      I have more doubts than when I read the post for first time...

      "Knowledge is what we know... wisdom is what we know we don't know."

      (some chinese philosopher... or not :P)

      Will try to get more light from here, thanks to make my life funnier 😊

      (is not ironny)

  • Aug 18, 2004 at 03:33 PM

    It sounds to me like maybe you want to dynamically generate some code and expose it as RFC. If that is case, read on.

    You can of course dynamically generate ABAP code at runtime. The use of the generate keyword has been discussed on this forum before and can be researched via the on-line help. However I don't know of any way to make this generated program a RFC.

    If the need for doing this dynamic is that you aren't sure what you interface parameters are, you might think about using XML for input and output. That way your interface can be dynamic even in RFC.

    I guess I won't go into any more deatil in case I am way off base as to what you are looking for. If this is something you want, post back with more details.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Aug 18, 2004 at 03:51 PM

    Hello Matthias,

    I don't think you can dynamically create a RFC function module. My suggestion is for you to create a generic RFC function module that will dynamically create a program.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Serdar Simsekler

      Thanks for your help, but the creating of a FM with the FMs you told me doesn't run in my tests.

      I also deside to use XML. I think it's the best way to get a completly generic exporting interface.

      With this way I only need one FM witch can be used for every DocSpace.

      Thanks and good bye!

      Matthias