CALL TRANSACTION in Update Function module

Hi all
AFIK, it is not possible to trigger a CALL TRANSACTION for BDC update in an update function module. Yet, i jus wanna to confirm it with the xperts. what are other options for posting a BDC data in an update function module?
thkx
Prabhu

Hi,
Try this..
Create a new RFC function module and in the function module do all the coding for the BDC and CALL TRANSACTION..
Inside the update module call the RFC function module IN BACKGROUND TASK.
I believe this should work..
Thanks
Naren

Similar Messages

  • Problem with Call transaction method in function module

    Dear Frndz,
               I am converting its services into webdynpro.
               I developed a rfc[function module] for travel management [TRIP] . In that rfc i used call transaction method[BDC] to upload the data. The same rfc will be called from the frontend[portal].It is working fine in development for whome se37 execution authorization was assigned. It is not working for other users.  I hope it is something relevant to authorization .If suppose can i create a authorization  object for this rfc and assign it to the profile.
            Normally  users can be given authorization to run the tcode.
    similarly i want to give the authorization to be given users to execuste this funtion module.
    huv can i do it ?? any suggestion.
    Rgds.
    siva

    Use ST01 transaction to start authorization trace, you will then see what authorizations are missing (if your assumption is right of course, i.e. if it's really an authorization problem)

  • Multiple call of update function module

    Hi Everybody,
    I have made implementation to the definition MB_DOCUMENT_BADI( material Document creation).
    While executing this BADI I am getting short dum with this error  Multiple call of update function module.
    Here is the short dump--
    In the FORM routine Buchen_Ausfuehren (program SAPMM07M), an error
    message was issued by a Business Add-In (BAdI) or function module.
    This is not permitted, because it could lead to data             
    inconsistencies. For this reason, the update of the material     
    document was also terminated with a termination message (dump).  
    Note that this message (M7 372) is not the responsible error     
    message.                                                         
    Please any body suggest the way forward.
    Regards,
    Sandeep.

    Hi Kiran,
    Thanks for the reply.
    I have created one implementation to the BADI MB_DOCUMENT_BADI. This badi will hit while creation of material document.I have write the code in method MB_DOCUMENT_BEFORE_UPDATE such that it will act only for certain movement types specially for t-codeMb1a and MB31.
    What problem I am facing i have used a error message "MB_DOCUMENT_BEFORE_UPDATE" in this method.If we got the erroe message then we dont need to post the material dcoument,but here problem is that if the material document could not posted then it corrupt the material and when we performing 261/101 we got error message like " Inconsistency between MM and ML for material and plant"
    I have used following things like-
    1-while updating the customized table using " Commit Work".
    2-Call function vb_change_batch for updating the batch and not in update task.
    3. Dequeue the table after updating the table.
    Will thos things can create any inconsistency to  the MM and ML.
    Please suggest me uor thoughts.
    Thanks
    sandeep.
    Thanks ,
    sandeep.

  • Update function modules/transaction service?

    Hi experts,
    Is it possible to use the transaction service (if_os_transaction and if_os_transaction_manager) to bundle updates in the same way as using update function modules?
    I've looked at SAP documentation and although it talks about mixing the two it's not clear how this can be accomplished.
    Any help would be much appreciated.
    Cheers,
    JB

    Hello!
    if I execute these step:
    TRANSACTION_BEGIN
    do processing of BAPI(1)...
    do processing commit bapi(1)
    do processing of BAPI(2) connected to BAPI(1)
    if something wrong
    TRANSACTION_abrot
    else.
    TRANSACTION_END
    does the transaction_abort execute the rollack of bapi(1) and bapi(2)?
    P.S. the commit between bapi(1) and bapi(2) is mandatory.
    thanks

  • Doubt in update function module

    dear friends..
    i have created an UPDATE function module with Processing type- Update Module, Start Immediate. i have handled the exceptions using Raise statement in the function module..
    the call function looks as..
      CALL FUNCTION 'ZFI_LCTXN_TABLES_UPDATE'
        in update task
        EXPORTING
          ZLCTMB1  = p_lctmb1
          NU_ENTRY = p_global-ins_zlctmb1
        TABLES
          UPD_PO   = UPD_PO
          UPD_SH   = UPD_SH
        EXCEPTIONS
          ERROR    = 1
          OTHERS   = 2.
      p_subrc = sy-subrc.
      commit work.
    but if the update fails, and even though the RAISE ERROR works, and update termination message is registered in SM13, i dont get the value for sy-subrc as 1 .
    is it the right way..if yes please tell me how to generate an error message within the transaction..so that the user knows the update has failed..
    thank you for your time
    Nivin

    Hi,
    Maybe it's usefull  for you.
    <b>
      IF sy-subrc EQ 4.
        MESSAGE e001 RAISING not_found.
      ELSEIF sy-subrc EQ 8.
        MESSAGE e002 RAISING not_found.
      ELSE.
      ENDIF.</b>
    Using this to create a message and raise in the same time !
    Regards.
    Marcelo Ramos

  • Call transaction inside Update task

    <b>Is it possible to use call transaction inside an update function module?</b>
    My requirement is like this.
    When I execute LB10 storage units will be created..then we have to go to lt09 and then create a TO's there for all these Storage units..
    Now, when I try to call a bdc session from an exit, the storage units are not  updated there. so the BDC is getting failed..
    To resolve this, I kept all the BDC code in to a Zfunction module and made it an update funtion module. I am calling this function module form the exit IN UPDATE TASK.
    But the call transaction is not working....
    I have tried with L_TO_CREATE_MOVE_SU inside the Z function module..Still no use..
    is there any other way that I can solve this?

    Hi,
       Calling a FM in Update Task is one of the bundling techniques used in ABAP to avail functionality provided by SAP Update System. Here all database updates are processed at the end of the SAP LUW in contrast to normal FM call where the database updates are done and commited at the time of call (Database LUW). It is necessary to bundle all your database updates in an SAP LUW e.g. all database updates in a transaction (like VA01) should be bundled. Almost all standard SAP transactions use bundling techniques.
    This technique separates the dialog process and update process. The dialog part of the transaction can span more than one screen(one dialog step) and can be processsed by more than one dialog work process. A work process is released when the dialog step changes (screen changes) and the work process sends a database commit (called Implicit Database LUW). So with each screen change there is a database commit and database remains in consistent state.
    Now when using bundling technique, when a COMMIT WORK is encountered, system ends the dialog process with a dialog work porcess and starts the update process using an update work process.
    The dialog step containing the COMMIT WORK is considerd as the last dialog step of the transaction and all the update function modules are processed now in the last dialog step by the update work process though they were called earlier during the earlier dialog steps.
    It is necessary to create update FMs to take advantage of this technique. The update FM is created FM by setting the Update moduleradiobutton in the Attributes tab in SE37.
    In a normal FM call, if there are database updates (UPDATE, INSERT, MODIFY, DELETE) than database is commited after the FM processing is over as the FM starts its own Database LUW and ends it too.
    <b>Reward Points</b>
    Regards

  • Checking the contents of update function module log table

    Dear experts,
    I created several CALL FUNCTION ... IN UPDATE TASK lines and is curious about the contents of the update function module log table. How can I see its contents?
    Thanks in advance.
    Regards,
    Haris

    Hi Hari,
    Use transaction SM13. This gives all the details
    To view the details in SM13 switch on Update debugging before you call your update function module.
    In debugger Settings --> Display / change Debugger settings --> Use the check box "Update Debugging" --> Press save button
    So after COMMIT WORK statement, debugging will start with the update function module
    During this time check the entries in SM13
    Once the update is complete the entries will be removed from SM13 (Unless there is a failure)
    I am not sure if there is option to view records in SM13 for which update is complete (No authorization to change settings in SM13). So i cannot check this
    Regards
    Rajvansh
    Edited by: Rajvansh Ravi on Jul 24, 2011 3:52 PM

  • WHAT ARE THE UPDATED FUNCTION MODULES

    Hi Friends,
    Can anybody explain me about UPDATED FUNCTION MODULES (types of function modules)

    Hi
    Update Function Module
    Unlike transactions and executable programs, dialog modules do not start a new SAP LUW. Calls to update-task function modules from a dialog module use the same update key as the ones in the calling program. The result is that calls to update function modules from a dialog module are executed only if a COMMIT WORK statement occurs in the calling program.
    If you place a COMMIT WORK in a dialog module, it does commit changes to the database (for example, with UPDATE).However, it does not start the update task. The function modules are not actually executed until a COMMIT WORK statement occurs in the calling program.
    If you use dialog modules, try to avoid including calls to update function modules in subroutines called with PERFORM ON COMMIT. In general, any occurrence of PERFORM ON COMMIT(with or without update-task function calls) in a dialog module can be problematic.
    This is because dialog modules have their own roll area, which disappears when the module finishes. Consequently, all local data (including data used for parameter values when calling an update function module) disappears as soon as the commit in the main program is reached.
    If you must use this method in a dialog module (i.e. include the call to an update-task function in a subroutine), you must ensure that the values of the actual parameters still exist when the update-task function actually runs. To do this, you can store the required values with EXPORT TO MEMORY and then import them back into the main program (IMPORT FROM MEMORY) before the COMMIT WORK statement
    Creating Update Function Modules
    To create a function module, you first need to start the Function Builder. Choose Tools ® ABAP Workbench, Function Builder. For more information about creating function modules, refer to the ABAP Workbench Tools documentation.
    To be able to call a function module in an update work process, you must flag it in the Function Builder. When you create the function module, set the Process Type attribute to one of the following values:
    Update with immediate start
    Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions can be restarted by the update task in case of errors.
    Update w. imm. start, no restart
    Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions may not be restarted by the update task.
    Update with delayed start
    Set this option for low priority ("V2") functions that run in their own update transactions. These functions can be restarted by the update task in case of errors.
    To display the attributes screen in the Function Builder, choose Goto ® Administration.
    Defining the Interface
    Function modules that run in the update task have a limited interface:
    Result parameters or exceptions are not allowed since update-task function modules cannot report on their results.
    You must specify input parameters and tables with reference fields or reference structures defined in the ABAP Dictionary.
    http://help.sap.com/saphelp_nw70/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
    Regards,
    Harish

  • Short dump for update function module

    Hi Folks,
       If I try to raise exception in Update Task function module which is in turn called in Custom BAPI function module. When I test the BAPI stand-alone using explicit COMMIT WORK (For testing)I can see the error in SM13 and it processes further in BAPI. Now when I am using this BAPI for ALE Inbound processing function module to SAP, when I test using testing tool WE19 it crashes when it passes the update FM inside BAPI, and encounteres BAPI_TRANSACTION_COMMIT, the update Function module is executed as encountered and gives me dump at the raised exception and does not show error in SM13. Please suggest how I could overcome this dump.
    Regards,
    Tim

    Hi there,
    Yes. I know that I can details from ST22 Analysis. And I did go through that.
    Here's the Section that explains:
    How to correct the error
        Try to find out why the number of decimal places of the field should be
        2.
        There are various possible options:
        1. The number of decimal places of the imported field has changed in the
           Data Dictionary. Make sure that the number of decimal places of the
           imported field matches the number of decimal places of the field in
           the Data Dictionary.
           If the data cannot be restored from another source, the data of the
           'old' structure must be read by the 'old' structure, converted und
           again eported with the new structure, so that future IMPORTs will
           always function with the new structure.
        2. A new program version is active, which no longer fits the dataset.
           Try to solve the error generating the program
         "ZFI_FM_GET_STD_COSTS==========FT" again. This
           works as follows: Select transaction SE38 in the SAP system. Enter
           the program name "Z_GET_COSTS==========FT". Then activate the
         function 'Generate'.
    1. I made sure that the decimal places matches.
    2. I did re-generate the program.
    But still got the same dump. Interestingly, the program where I am using this FM is working absolutely fine.
    Thanks.

  • Is it possible to call custom designed RFC function module, apart from BAPI

    Hi Friends,
    1.     Is it possible to call custom designed RFC function module, apart from BAPI.
    2.     Why we call it Adaptive RFC layer, Since every time the JCO layer updated with SAP, Why can’t be dynamic.
    Thanx for Ur time.
    Cheers,
    Sam

    Also check <a href="http://help.sap.com/saphelp_nw04/helpdata/en/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm">here</a> for more information on aRFC. Here you can find why it is called adaptive.
    Regards,
    Christophe

  • Questions regarding update function module

    Hello experts,
    I am on customer site to help them investigate one issue: they have a background job which runs periodically.
    In the report database table A is changed firstly ( new entries are inserted ), then a update function module is called via keyword CALL FUNCTION ... IN UPDATE TASK.
    Inside the function module database table B is updated. ( existing entries are updated )
    Customer issue:
    sometimes they find A is updated as expected, however B remains unchanged at the same time.
    customer could not find exact steps to reproduce the issue. However the issue does exist there and occur from time to time.
    the issue could only be reproduced in their production system, but works perfectly well in dev & Q system. It is difficult to debug in their production system for trouble shooting.
    After analyzing related code, I have one doubt: according to ABAP help on CALL FUNCTION aaa IN UPDATE TASK, I know the function module aaa is called in a new update work process. I wonder whether there is any possibility there this issue might be caused because the update function module fails to get called at all? ( perhaps due to heavy system load so no free update function module could serve the table B update ? )
    If update function module fails to execute, is there any system utility to record this? That is to say, will it be recorded in such as SM13 or SM21?
    Looking forward to your expertise on this topic!
    Best regards,
    Jerry

    Hello friends,
    Thanks a lot for your interests on this issue. I update all my findings:
    1. issue background: this issue occurs in SAP CRM Channel manageement Solution, software component CRM-CHM-POS.
    2. due to some limitations, the table CMSD_CI_HISTORY and history table are not updated in the same LUW. Instead the first one is updated in normal work process while the other is done in update work process. Since I am not the original developer I didn't know the whole complex scenario ( I did see this is done delibrately in note 1764006 - CMS:Sell In Release creating PB with zero available quantity ).
    So for the moment we have to accept this design.
    3. during our testing ,we ensure COMMIT WORK is always called.
    4. So why sometimes the first table update fails, however there is no hint at all for this failure in the system like ST22 and SM21 ?? ( forget SM13, since it is updated in normal work process ).
    The root cause is the flaw of SAP code below.
    The code has planned to raise exception if insertion failed due to duplicate records to be inserted.
    Unfortunately, the fact is if we use "INSERT db FROM TABLE xxx" to insert records into database and some record already exists with the same key, it will result in a termination but SY-SUBRC is STILL 0; Just compare it with single insertion using "INSERT db FROM <work area>", in the same error situation, processing does not terminate, and SY-SUBRC is set to 4.
    As a result in this case even the insertion fails, line 29 will never be executed as sy-subrc is always 0. Since the insertion fails and the exception is caught without any notification, so customer sufferred because they do not know what has happened.
    Best regards,
    Jerry

  • Regarding update function module

    Hi all,
    This is regrding update function module
    How to handle errors in update function module
    Can exception be used in Update function modules
    while calling in update Task
    if we can use please let me know how to do so while calling in Update task.
    Regards,
    siva chalasani.

    Hi Vinod,
    Just wanted to say...
    your answer solved my problem.
    I needed to pass my error records into a internal table and from there to notepad using GUI_DOWNLOAD.
    The following is my function module....
    RHPP_Q_PROFILE_WRITE
    It has under  TABLES-- 'err_profile' to capture error records.
    So, I passed a internal table in " err_profile" to capture the errors.
    And then passed this internal table in GUI_DOWNLOAD.
    Regards,
    Hari Kiran
    Edited by: HARI KIRAN REDDY on Aug 12, 2008 12:20 PM

  • Invalid COMMIT WORK in an update function module. in VKM1 Tcode

    Hi All,
    I am getting the short dump with message "Invalid COMMIT WORK in an update function module. "
    Calling a COMMIT WORK in an update process is not allowed
    because the function modules triggered in a Logical Unit
    of Work cannot then be processed correctly.
    in FM : SO_DOCUMENT_SEND_API1
    Prev. it was giving error in one of my driver program where I had written the commi Work after calling FM for sending fax :
    "CONVERT_OTF_AND_FAX" .
    call function 'CONVERT_OTF_AND_FAX'
        exporting
          FAXOPTIONS = W_ITCPP
          USER       = NAST-USNAM
        importing
          MSGID      = W_MSGID
          MSGNO      = W_MSGNO
          MSGV1      = W_MSGV1
          MSGV2      = W_MSGV2
          MSGV3      = W_MSGV3
          MSGV4      = W_MSGV4
        tables
          OTF        = IT_OTF.
    if sy-subrc eq 0.
      commit work.
      submit RSCONN01 with MODE = 'FAX' and return.
    endif.
    Please explain me where and how I can change my code so that this error should not come?
    Rgds.
    MAdhuri

    Hello, Suhas!
    I am getting the short dump with message "Invalid COMMIT WORK in a COMMIT WORK or ROLLBACK WORK."
    Short text
        Invalid COMMIT WORK in a COMMIT WORK or ROLLBACK WORK.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "CL_FDT_CC_SERVICES============CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        The call of a COMMIT WORK in a FORM, that will not be executed until
        the commit or rollback point of the caller using the variant
        PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK is not permitted.
    etc.
    Could you help me to solve the issue?
    Regards,
    Kseniya Tsyganchuk

  • How two create UPDATE FUNCTION MODULE

    Hi,
    I have 2 tables to update one after the other...
    I have geard it is advisable to use update function module for this..
    can any1 tell me how to create and work with update function modules...
    Answers will be rewarded....

    Abhay,
    How an update function module works is, the execution of the FM is delayed to until when a COMMIT WORK statement is executed.
    Hence if you have the data available for updating the two DB tables at the time of calling the FM, you can pass the tables to the same FM and program the DB update for both in the same FM.
    However the COMMIT WORK should be outside the FM further down in the calling program.
    This link is very good and easy to follow
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
    Hope it helps
    Aditya[url=http://help.sap.com/saphelp_erp2005vp/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm]
    Message was edited by:
            Aditya

  • Add entries to database tables using update function module

    Hi All,
    I have a small requirement, in which I need to update Z-tables usimg update function module in update task. In the calling program, I have gathered the data in a field symbol value of type any. I need to pass the same to that function module to update the data which is in the field symbol.
    Please guide me how to achieve this technically.
    Thanks in advance,
    Pradipta .

    Hi,
    I believe you already have evrything with you.....Start Coding the same and come back with any Coding issue.
    I believe you will not be able to pass the Field Symbol in FM Interface.....You need to pass the Variable which Field Symbol is referring....

Maybe you are looking for