FM Call within Function Exit

Hi All,
is it possible to call a FM inside a function exit?
I am trying to call FM 'RV_PRICE_PRINT_ITEM' inside EXIT_SAPLEINM_002 but it doesnt work. Ive tried attaching the same logic in values in a standalone program and it runs as expected.
Again, can I callh a FM inside an exit?
Thanks.
Kenny

>>>is it possible to call a FM inside a function exit?
The reason for failure in your case may be something else. As an alternative, you can SUBMIT that Standalone program instead of a direct function call from the exit.
~Suresh

Similar Messages

  • Hr_infotype_operation errors when called within a user exit

    Hi there.
    I am doing an enhancement in userexit PBAS0001 for CE using the enhancement framework.Whenever I am trying to change the payroll area in IT0001 by PA30 it has to give a message saying that 'all the assignments will change to new payroll areas do you want to continue?'if i say yes then the payroll areas for all the assignments should be chnaged to the current payroll area which I am trying to change.So after the pop up I am looping at all the assignments and calling the function module hr_infotype_operation.It gives an error Complex Application error.I debugged and saw that when it calls the function module the user exit gets triggered again and goes to the starting within the function call and hits the function module again and keep going like this.I checked the structure and all the parameters.looks fine below is the code where I am using the function module.I am trying to update IT0001 when somebody tries to change the IT0001(is that an issue??) i tried by submitting a program by calling the function module in the program.Didnt work too.Is there any way we can do it by BDC??
    Check if the payroll areas are equal
        IF ls_i0001-abkrs NE new_p0001-abkrs.
    If the payroll areas are not equal then generate a message pop-up with 'YES' and 'NO' buttons
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar       = 'Warning'
              text_question  = 'Payroll Area specified is different with other assignments.Do you want to move all the other assignments to the same payroll area?'
              text_button_1  = 'Yes'
              icon_button_1  = ' '
              text_button_2  = 'No'
              icon_button_2  = ' '
              default_button = '1'
              start_column   = 25
              start_row      = 6
            IMPORTING
              answer         = lv_case
            EXCEPTIONS
              text_not_found = 1
              OTHERS         = 2.
          CASE lv_case.
            WHEN '2'.                                 "For 'NO' button
              LEAVE TO SCREEN '2010'.
            WHEN 'A'.                                 "For 'CANCEL' button
              LEAVE TO SCREEN '2010'.
            WHEN '1'.                                 "For 'YES' button
    Second Pop-up confirm
              CALL FUNCTION 'POPUP_TO_CONFIRM'
                EXPORTING
                  titlebar              = 'Warning'
                  text_question         = 'System will update all other assignments to the new payroll area'
                  text_button_1         = 'Yes'
                  icon_button_1         = ' '
                  text_button_2         = 'No'
                  icon_button_2         = ' '
                  default_button        = '1'
                  display_cancel_button = 'X'
                  start_column          = 25
                  start_row             = 6
                IMPORTING
                  answer                = lv_case1
                EXCEPTIONS
                  text_not_found        = 1
                  OTHERS                = 2.
              CASE  lv_case1.
                WHEN '2'.                             "For 'NO' button
                  LEAVE TO SCREEN '2010'.
                WHEN 'A'.                             "For 'CANCEL' button
                  LEAVE TO SCREEN '2010'.
                WHEN '1'.                             "For 'YES' button
    For all the assignments read the infotype 0001 and update the payroll area
                  LOOP AT lt_pernr INTO ls_pernr.
                    CLEAR:lt_i0001,ls_i0001.
                    REFRESH lt_i0001.
                    CALL FUNCTION 'HR_READ_INFOTYPE'
                      EXPORTING
                        tclas           = 'A'
                        pernr           = ls_pernr
                        infty           = '0001'
                        begda           = new_p0001-begda
                        endda           = new_p0001-endda
                        bypass_buffer   = 'X'
                      IMPORTING
                        subrc           = lv_subrc
                      TABLES
                        infty_tab       = lt_i0001
                      EXCEPTIONS
                        infty_not_found = 1
                        OTHERS          = 2.
                    SORT lt_i0001 BY endda DESCENDING.
                    READ TABLE lt_i0001 INTO ls_i0001 INDEX 1.
                    ls_i0001-abkrs = new_p0001-abkrs.
                   lv_record = ls_i0001.
    Lock the employee
                      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
                        EXPORTING
                          number = ls_i0001-pernr
                        IMPORTING
                          return = lv_return.
                      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
                        EXPORTING
                          infty         = '0001'
                          number        = ls_i0001-pernr
                          validityend   = '12302006'
                          validitybegin = '12012006'
                          record        = ls_i0001
                          operation     = 'INS'
                         IMPORTING
                          return        = return.
    *unlock the employee
                      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
                        EXPORTING
                          number = ls_i0001-pernr
                        IMPORTING
                          return = lv_return.
                   SUBMIT zhr_infotype_operation_py_area USING SELECTION-SCREEN '1000'
                   WITH p_infty  = '0001'
                   WITH p_pernr  = ls_i0001-pernr
                   WITH p_endda  = new_p0001-endda
                   WITH p_begda  = new_p0001-begda
                   WITH p_record = lv_record
                   WITH p_opera  = 'INS'
                   WITH p_tclas  = 'A'
                   AND RETURN.
                  ENDLOOP.
              ENDCASE.
          ENDCASE.
    ENDIF.

    maybe a little late, but I had found this message today (searching for different problem) but maybe the date for HR_infotype_operation might do a little problem, cause you are filling it with: DDMMYYYY but it should be YYYYMMDD so it just translate it that this is really far in the past so that might be a problem. Try sy-datum instead and for the end of validity try '99991231' dont worry, when you will update the same infotype again, the FM will end the previous infotype to previous day and the new one will get validity from sy-datum till the end ....

  • Unable to debug an exit in CALL CUSTOMER FUNCTION 003

    Hi Guys,
    I have an exit EXIT_SAPMV45A_003 that is called by CALL CUSTOMER FUNCTION 003. I had placed a break point at
    CALL CUSTOMER FUNCTION 003 and the debugger stops here but i am unable to debug inside this to reach into
    the code in EXIT_SAPMV45A_003 even after setting the system debugging on & Update debugging
    ON.
    Can someone help me with this?
    thanks
    Dan

    You have to include that Enhancement of that exit in the Project and Activate that project in the CMOD.
    The Enhancement for the exit EXIT_SAPMV45A_003 is V45A0003.
    Create a project in CMOD
    And inclue V45A0003 in the project.
    Activate the Project.
    Now, it will stop at break point.
    Regards,
    Naimesh Patel

  • Calling a function module from within a transformation routine

    I created a routine within a transformation and experience the following weird behavior now:
    When I call a function module within that routine, the load fails with the following error message:
    Exceptions in Substep: Rules
    When I click on the button next to this text, it point me to my function module call.
    What I do not understand is, that the following two scenarios work fine:
    - Having the same function call (with fake values) in a plain ABAP program works beautilfully
    - If I copy the content of my function module directly into my transformation routine, everything works fine as well
    I am now wondering whether the routine does not "see" the function module I am calling. The module resides in a different package. Is that a problem? Do I have to include something first?
    Here is the code that calls my FM (
    CALL FUNCTION 'Z_CA_CONVERT_US_COST'
         EXPORTING
            PSOURCEVAL                      = SOURCE_FIELDS-/BIC/USFRZMFC
            PSOURCEUOM                      = SOURCE_FIELDS-BASE_UOM
            PUSITM                          = SOURCE_FIELDS-/BIC/USITM
            PTARGETUOM                      = PRODUCTION_UOM
         IMPORTING
            PTARGETVAL                = RESULT
         EXCEPTIONS
           CONVERSION_NOT_MAINTAINED = 1
           PARTNO_NOT_FOUND          = 2
           OTHERS                    = 3.
    Thanks a lot for your help. Points will be assigned.
    Dennis

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Can you call a function module from within a smartform?

    I was told that yu can not call a function module from a smartform - that does not make sense to me because you can do tons of ABAP within a smartform.
    Well - can you?
    Thanks.
    Scott

    Yes, you can call function modules.

  • Can we call a function within a function??????Urgent

    Dear All,
    Like we can call a procedure from another procedure , in the same way can we call a function within a function. Please reply it's urgent.
    Regards

    > Please reply it's urgent.
    My usual soapbox response.
    Saying your posting is urgent is rude and arrogant. Why? Because you are saying that other people who have posted problems here, have less important problems than yours. That despite how complex and critical their problem may be, yours take priority.
    You're also demaning attention and a quick answer from people that provide support here - in their free time... and not getting paid a single cent for their efforts.
    So just how can you demand any urgency to your posting from them?
    Remember that this is a public forum. You cannot demand anything here. This is not Oracle Support. There are no SLA's here. Basic nettiquette applies.

  • Need Help: Using Ref Cursor in ProC to call a function within a Package

    I'm calling a function within a package that is returning a REF CURSOR.
    As per the Oracle Pro*C Programmer's Guide, I did the following:
    1) declared my cursor with a: EXEC SQL BEGIN DECLARE SECTION and declared the cursor as: SQL_CURSOR my_cursor;
    2) I allocated the cursor as: EXEC SQL ALLOCATE :my_cursor;
    3) Via a EXEC SQL.....END-EXEC begin block
    I called the package function and assign the return value to my cursor
    e.g. my_cursor := package.function(:host1, :host2);
    Now, the only difference between my code and the example given in the Pro*C Programmer's Guide is that the example calls a PROCEDURE within a package that passes back the REF CURSOR as an OUT host variable.
    Whereas, since I am calling a function, the function ASSIGNS the return REF CURSOR in the return value.
    If I say my_cursor := package.function(:host1, :host2); I get a message stating, "PLS-00201: identifier MY_CURSOR" must be declared"
    If I say :my_cursor := package.function(:host1, :host2); I get a message stating, "ORA-01480: trailing null missing from STR bind value"
    I just want to call a package function and assign the return value to a REF CURSOR variable. There must be a way of doing this. I can do this easily in standard PL/SQL. How can this be done in Pro*C ???
    Thanks for any help.

    Folks, I figured it out. For those who may face this problem in the future you may want to take note for future reference.
    Oracle does not allow you to assign the return value of a REF CURSOR from a FUNCTION ( not Procedure - - there is a difference) directly to a host variable. This is the case even if that host variable is declared a CURSOR variable.
    The trick is as follows: Declare the REF CURSOR within the PL/SQL BEGIN Block, using the TYPE statement, that will contain the call to the package function. On the call, you then assign the return REF CURSOR value that the function is returning to your REF CURSOR variable declared in the DECLARE section of the EXEC SQL .... END-EXEC PL/SQL Block.
    THEN, assign the REF CURSOR variable that was populated from the function call to your HOST cursor varaible. Then fetch this HOST Cursor variable into your Host record structure variable. Then you can deference individual fields as need be within your C or C++ code.
    I hope this will help someone facing a deadline crunch. Happy computing !

  • Calling oracle function defined within package from JPA

    Hi All,
    I am trying to call a function get_owner() defined under a package pkg_x_y.
    But I get an error when I do
    entityManager.createNativeQuery("call pkg_x_y.get_owner()");
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parenthesis
    What is the correct way to execute this function?
    Thanks in advance.

    JPA 2.1 standardized stored procedure support, and is available within EclipseLink 2.5 as described here: http://wiki.eclipse.org/EclipseLink/Release/2.5/JPA21#Stored_Procedures
    If you are unable to use JPA 2.1, you can use EclipseLink's stored procedure support as described here: http://wiki.eclipse.org/EclipseLink/Examples/JPA/StoredProcedures
    The problem you are getting with your call though might be coming from within the stored proc itself, not the native query execution.  Its hard to tell - are you able to execute the query on your database directly, such as through SQLPlus?

  • Calling a Function Within a For-Each in Powershell

    Error:
    Unexpected token 'in' in expression or statement.
    At :line:1 char:22
    + ForEach-Object ($i in  <<<< $fs_size_info) { $i.Name.Name, GetGB($i.Sum)  }
    Code:
    foreach ($i in $fs_size_info) { $i.Name.Name GetGB($i.Sum) }
    If I omit the function from inside this foreach, it works perfectly, and I can access $i.Sum within the foreach as well. The problem arises when I try to call a function from inside the foreach. GetGB simply returns a more readable format e.g. GetGB(1024)
    will return "1 K" etc...
    I don't understand what I'm doing wrong, unless you cannot call a function inside a foreach statement.... am I missing something?
    Thanks

    The code you've posted and the error message don't seem to go together, unless the line before that "foreach" keyword happens to have ended with a pipe character.  There's a difference between how you use the foreach statement (help about_Foreach)
    and the ForEach-Object cmdlet (help ForEach-Object).
    Either way, it looks like inside the loop body, you've got two statements:  ($i.Name.Name) and (GetGB($i.Sum).  Those statements need either a line break or a semicolon between them.

  • Calling a function from within a movieclip

    How do I do this, and Is it wrong to do it this way?
    I have a movieclip on the timeline and within that movieclip
    it has buttons which I've placed listeners. I'm doing it this way
    rather than putting the code in the document class because the
    buttons don't appear right away in the movieclip (not until around
    frame 10). The function is defined in the document class because it
    is used with other movieclips.
    Anyone have an idea on how to properly do this?

    Well, I'm at least not getting an error - however, nothing is
    happening when I click the button to call the function (which is
    indeed public). Inside the function is a simple trace. I've even
    added a param to the function just for fun, and there's no error
    when calling the function from the button.

  • Calling ORACLE Functions from within CF Builder report

    Hi, I have an ORACLE function that I would like to call from within my CF REPORT.
    I know there is a section in the report builder where you can write coldfusion code to perform tasks, but I would rather simply call the ORACLE function for each detail row in the report
    I do not want to call this function from within my main ORACLE query that I use for the report, so please don't suggest that.
    Thanks so much.
    -Jim

    6.0.5 is not certified against 10g database, so I suggest to upgrade to 6.0.8.26 (6i patch 17) first to see if the problem is gone.

  • 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.

  • How do i call a function within the jsp?

    Hi,
    What i am doing is now allow a user to type in comment and when the user click on "Add" button, it will call my function and write to a txt file.How can i call a custom jsp function within my jsp page or what is the correct way to do this?
    [My current codes]
    <form name="SubmitEvent" method="post" action="addComment()">
    </form>
    function addComment()
    System.out.println("Entered Add Comment function");
    Thanks for your help!

    You can define a Java Bean (I presume you know the rules to write a Java Bean) and send the read value as parameter to the Bean and then call a function in the Bean from the JSP.
    Contact me if you need more help!

  • Is is possible to call a function or method before JVM exits ??

    Hi All,
    Is is possible to call a function or method before JVM exits where System.exit() is used.
    I am calling a program where System.exit is used. i need to call a function before the JVM exits.
    Please help me.
    Thanks,
    J.Kathir

    How to call the method ? Did i have to call the shudown hooks method in my main class ?
    Is it possible to have in subclass?
    is the below code is correct ? i am calling a class before System.exit is called....
    java.lang.Runtime.getRuntime().addShutdownHook(...My Own Class()....)

  • Call a functions within a function ?

    Hi
    Is there anyway to call my functions within a function ?
    function musicPlayer() {
         trace("Music");
         function pauseMusic(){
              trace("Pause");
    if i call musicPlayer function i will get Music in output now how can i call pauseMusic from outside of parent function !?
    is this possible ?
    thanks in advance

    You can call functions within other functions, but you don't want define functions inside other functions... they will only have scope within the function if they work at all.
    function pauseMusic(){
         trace("Pause");
    function musicPlayer() {
         trace("Music");
         pauseMusic();
    musicPlayer();

Maybe you are looking for

  • Need to Merge Excel Spreadsheet data with Word Disposition Sheet

    I work for a Medical Devices manufacturer, and in order to keep track of our failures, we enter data into an Excel Spreadsheet and then print out a Disposition form containing similar information, which then gets attached to the Device folder. I woul

  • I downloaded iMovie 6.0.3 and it doesn't work!

    So I got a MacBook with Leopard and iLife '08 built in. Then I discovered I could get iMovie HD 6 for free, so I downloaded it but whn i'm installing it it says "You cannot install iMovie HD Update on this volume. This update requires iMovie HD versi

  • Where Can I redownload the program that allows me to setup my time capsule.

    I recently replaced my old computer that had the setup program. My time capsule worked fine until I had to reset it because of connection issues. Now I have no way to setup my Time Capsule because I don't have the program. Thanks.

  • Oracle/wss_saml_bearer_or_username_token_service_policy

    I have an application need to connect to UCM. it was working when : client side policy is: oracle/wss10_saml_token_client_policy and UCM side policy is: oracle/wss_saml_or_username_token_service_policy However, after change the UCM side policy to be

  • Why is my Mac's Flash Storage full?

    I have an issue on my Mac where my flash storage's free space suddenly shrank.             I am using a Macbook Air (128 GB). As the storage is pretty small, I am trying to keep my storage as efficient as possible. Last 3 days, my free space is 37 GB