Calling subroutine in another function group

Hi all,
I want to include a call to subroutine TKKA1000_FUELLEN in function group kkag in my custom program. Can I do that? I come from a C/JAVA baclground in which I could INCLUDE the class or set of programs with a simple statement. can i do the smae here?
regards,
Mat

HI,
  Check the below code....
<b>PERFORM form IN PROGRAM prog.</b>
Additions:
1. ... USING    p1 p2 p3 ...
2. ... CHANGING p1 p2 p3 ...
3. ... TABLES   itab1 itab2 ...
4. ... IF FOUND
In an ABAP Objects context, a more severe syntaxcheck is performed that in other ABAP areas. See Passsing SY-REPID not allowedand Receiving SY-SUBRC not allowed.
Effect
This variant is similar to variant 2 (externalperform). However, here you can specify the names of both thesubroutine and the program in which it occurs dynamically at runtime.If you do this, you should place the variables form and prog in parentheses. The names in form and prog must beentered in uppercase, otherwise a runtime error occurs. If you do notspecify any additions (such as USING) you do not need to specifythe program after IN PROGRAM. In this case, the system looks forthe subroutine in the current program.
Example
DATA: RNAME(30) VALUE 'WRITE_STATISTIC',   "Form and program
                                           "names must
      PNAME(8)  VALUE 'ZYX_STAT'.          "be written in
                                           "upper case
PERFORM (RNAME)         IN PROGRAM ZYX_STAT.
PERFORM WRITE_STATISTIC IN PROGRAM (PNAME).
PERFORM (RNAME)         IN PROGRAM (PNAME).
All three PERFORM statements have the same effect, that is,they call the subroutine 'WRITE_STATISTIC', which is defined inthe program 'ZYX_STAT'.
Notes
Dynamic PERFORM statements require more CPU time, since the system has to locate the subroutine each time.
Regards,
Vara

Similar Messages

  • How to organize function modules & subroutines in a function group?

    Hi,
    There are several function modules and subroutines in a function group. And the subroutines will be called by severel modules.
    Originally:
    1. I put subroutine forms in an Include.
    2. and in the function modules which will use the forms, I include the Include before the function definition.
    3. While when activating the functin modules, it's reported that the forms had already been defined. Only if one function module includes the Include, it's OK.
    How should the forms and function modules be organized?
    Thanks!
    Sayid

    Hi Atish
    Yes, you are right.
    It works.
    Thank you.
    Regards,
    Sayid

  • Can I call a selection-screen that is in another function group?

    I am writing a function module in function group ZFG_A.
    There exists a Dypro 9001 that exists in function group ZFG_B.
    How can I call the dynpro 9001 from my function in ZFG_A?
    This is not OO so I am not sure how to qualify the 9001?  Such as ZFG_B=>9001
      call selection-screen 9001 starting at 5 5
                                 ending   at 70 15.
    I get compile errors on the selection-screen variables because they are not found.
    Thank you,
    Olivier

    Its not at all possible to call a screen of different program from other program.
    But u can copy the screen using a FM called 'RS_SCRP_COPY' or 'RS_SCREEN_COPY'. In the former u can copy the screen with out popup but u have to specify the SOURCE program name and screen number and TARGET program name and screen no.
    In the later u ll get the popup similar to when u copy a screen in SE51.In the popup as u know u have to enter source name and screen no. and target program name and screen no.
    Thanks & Regards
    Santhosh

  • Call screen of a function group

    Hi experts,
    How can I call a screen of a function group from another function and then return to the place of call?
    I have my own function and I need to call the screen of a certain function group.

    Hi.
    If there is function module A, which calls screen N assigned to function group B,
    so to call screen N,
    you should call function module A within your function module.

  • Calling Subroutine of a Function Module

    Hi friends,
    I need to call a routine which exists in a function module from anopther function module.
    The routine is in a include program (ie type I).
    is there any way....

    PERFORM add_relations  in program L2012F03.

  • Function Group and Subroutines

    Hi all,
    I have two Function Groups.
    I have a subroutine defined in one Function Group and want to use same subroutine in another Function Group.
    Is there any way to do it, <u><b>without redefining same Subroutine in another Function Group?</b></u>

    Hi,
        either define subroutines in include
        and inlude in function group
         include ztest.
          perform abc .
          perfrom add.
    Function group ZFG
         include ztest.
    Function group ZFG1
         include ztest.
    <b>    or</b>   
    perform test(prog1).
    Regards
    amole

  • Can a function module call another function module

    Can a function module call another function module:-
      within the same function group
    (ii)  within different function  groups

    Hi,
    We can call function from another function. If there is a function which is like a calculator and all the operations are from different functions then we have to call the functions from the calculator function for different functions.
    If all the function are from same function group, Then the data is globally available to all the functions with in the group.
    Otherwise we have to declare the data definitions for each of the functions if they are in different function groups.  
    Yes it is possible to call a function module from another function module:-
    within the same function group
    (ii) within different function groups
    Reward.

  • Acces to Object  of calling Function-Group

    Hello ,
    in Functiongroup IQS0 I have a Textedit-control. This Function-group calls a FM from another Fuction-group(XQQm).
    From XQQM I want to manipulate the Textedit-Control like I can manipulate Data from a calling program.
    see:
    data:fieldname '(Sapliqs0)Field
    ' --> can this be the textedit-control
    Fieldsymbols: <fs>.
    Assign <fs> to (fieldname)
    <fs> = 'Manipulated'
    Is it possible ?
    Best regards
    Simone

    Hello Simone
    You may have a look at the following documentation:
    [SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
    Regards
      Uwe

  • Copying function module from one function group to another

    What is the efficient way to copy a module from one group to other so that all its subroutines and any dependencies with in the FM can also be copied?

    Hello,
    Tcode:SE37
    Menu: FunctionModule->OtherFunctions->Copy in that there are different option give a new name of the function group this should work
    regards
    suresh nair

  • CCME Call Forward from one Hunt Group to another Hunt Group Failure

    Hi I have a couple of hungroups in Cisco Call Manager Express. I am trying to configure a Call Forward no answer from one hunt group to another. Does anybody know if this is possible? If so, is there a config available? Here is my config, but it is not working.
    Thanks,
    Derek
    voice hunt-group 20 parallel
    final 2290
    list 2201,2251,2252
    timeout 30
    pilot 2209

    Hi Derek,
    This is supported with the restriction shown below;
    final number
    Router(config-voice-hunt-group)# final 8888
    Defines the last extension in a voice hunt group.
    If a final number in one hunt group is configured as a pilot number of another hunt group, the pilot number of the first hunt group cannot be configured as a final number in any other hunt group.
    From;
    http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucme/admin/configuration/guide/cmeadm/cmecover.html#72373
    Cheers!
    Rob 

  • Exporting data from one function group to another

    Dear all,
    can you pls provide the solution for the below.
    in my requirement two function groups are there. one is standard function group & other is user specific function grp.
    in the standard FGRP i have one SAP standard screen xxx, & one user created screen yyy. from xxx screen call goes to the yyy screen. then from yyy  call goes to the screen zzz which is in user specific FGRP.
    how to export the data (i.e from structure) from screen yyy which is in one FGRP to screen zzz which is in some other FGRP.
    Regards
    Venkat

    Venkata,
    The receiving FM should have a parameter under TABLES for your structure.  You have to put the structure data in an internal table, and then read table ... index 1 to retrieve it both in the FM, and in the calling program.  Upon return to the calling program you wil again need to read table ... index 1 to retreive it and restore it to the structure you process in your calling program.

  • Calling another function if upate statement fails

    Hi there,
    I have written an update procedure and insert procedure. Is there a way of calling another function if the update statement fails? Thanks a lot for your help.
    Chris
    procedure update_costing(in_period in DATE,
                   in_project_id IN VARCHAR2,
                   in_user_id IN VARCHAR2,
                   in_thu IN VARCHAR2,
                   in_fri IN VARCHAR2,
                   in_sat IN VARCHAR2,
                   in_sun IN VARCHAR2,
                   in_mon IN VARCHAR2,
                   in_tue IN VARCHAR2,
                   in_wed IN VARCHAR2)
         UPDATE TBL_COSTING
              SET
                   HOURS_THU = to_date (in_thu, 'HH24:MI'),
                   HOURS_FRI = to_date (in_fri, 'HH24:MI'),
                   HOURS_SAT = to_date (in_sat, 'HH24:MI'),
                   HOURS_SUN = to_date (in_sun, 'HH24:MI'),
                   HOURS_MON = to_date (in_mon, 'HH24:MI'),
                   HOURS_TUE = to_date (in_tue, 'HH24:MI'),
                   HOURS_WED = to_date (in_wed, 'HH24:MI'),
                   WHERE PERIOD = in_period
         AND PROJECT_ID = in_project_id
         AND USER_ID = in_user_id;
    EXCEPTION
    --CALLL HERE THE INSERT FUNCTION WITH SAME DATAMEMBERS
    SOMETHING LIKE THIS---
    WHEN others then
         insert_costing(in_period, in_project_id, in_user_id ,in_thu,in_fri,in_sat,in_sun,in_mon,in_tue,in_wed ,in_submit);
    COMMIT;
    END update_costing;

    begin
    UPDATE statement
    IF SQL%ROWCOUNT =0
    then
    INSERT statement|procedure
    end if;
    end;
    /Hi,
    i have a simple doubt over here, i read somewhere that cursor attributes can be used only as long as the cursor is open, then in the above case whiel doing the update operation, oracle implicitly will open an cursor and will do the operation and then will close the cursor, then how does SQL%ROWcount works???please revert...
    cheere

  • Calling one function in another function

    Hi,
    How to call one function in another function?
    regards,
    Kishore.

    example:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    function bob(x number) return number is
      3    begin
      4      return x*x;
      5    end;
      6    function fred(x number) return number is
      7    begin
      8      return x+bob(x);
      9    end;
    10  begin
    11    dbms_output.put_line('Value: '||to_char(fred(5),'fm9999'));
    12* end;
    SQL> /
    Value: 30
    PL/SQL procedure successfully completed.
    SQL>

  • Calling an OA Function from another function

    Hi,
    I need to create a link in a function that calls another function.
    I've created a new Item 'Static Styled Text' writing in the destination URL 'OA.jsp?OAFunc=FUNCTION_NAME&pPersonID=&pFromMenu=Y'.
    I am able to connect to the Function but the person_id parameter passed is not the right one.
    To be clear I'll write down an example. I am a super user and in FUNCTION A I query an employee and enter in the function. Subsequently I click on the link I've created to view this employees information in FUNCTION B. Instead it queries my information, passing my person_id.
    Can someone help?
    thanks

    You would need to get hold of the person id of the employee you queried, this may be a VO attribute
    Once you get the person Id, you would need to set the URLs parameter value to this value.
    so the URL when you are in the next pahe would look like
    http://<server:port>/../OA.jsp?OAFunc=FUNCTION_NAME&pPersonID=<the value you passed>&pFromMenu=Y
    Thanks
    Tapash

  • Calling a Function from another Function within CFC

    Hi all,
    I have many functions in my CFC that do various things, but
    one query is a query that selects absolutely every record from a
    table.
    The thing is, I need to do a query like this in another
    function to obtain only a recordcount of the same table used in
    both separate functions. Instead of writing the query out again,
    how can I utilise the function already written?
    My question is, how can I invoke and use the results of a
    query in one cffunction for another cffunction in the same CFC
    component?
    An example may look like the code attached...
    Many thanks for your patience and help!
    Mikey.

    quote:
    Originally posted by:
    Dan Bracuk
    Generally, to call a function from within a cfc, you do
    exactly what you do outside a cfc.
    For your specific case, if your requirements permit it, you
    might consider caching the big query for a couple of seconds. Then
    you can continously call the function and not have to wait for it
    to run and bring back the data each time.
    Do you mean to say that within a CFC function I can execute
    the same cfinvoke tags I use in normal CFM pages?
    Mikey.

Maybe you are looking for