Update Function Module

hi all,
i had a requirement in which i had to send a custom idoc from one application server to another. i did it but now i task is the generated idoc from sender should be updaetd to database tables of receiver . for this we have to code some thing in receiver function modules . how to do it. in this issue i 'm having some doubts
      1. the Fm at receiver side should be a updated FM or Remote-enabled FM
       2. how to code this FM so that the data in idoc which is send from sender to reciver should be updated to databse tables of receiver.
please help me............ its very urgent..........
Thanks in advance,
Suresh Aluri.

Hi,
1.
Function module will be normal
2.
DATA: i_e1axxxx LIKE e1xxxx1.
LOOP AT int_edidd.
CASE int_edidd-segnam.
WHEN '...'.
WHEN 'E1xxx'.
MOVE int_edidd-sdata TO i_e1adrm1.
append i_e1adrm1.
ENDCASE.
ENDLOOP.
loop at i_e1adrm1
  <<< write your code to update tables
endloop
aRs

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • 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 to exit from an update Function Module

    Hi Friends,
    I am using an Update Function Module in my program.The Program also has various other logics implemented in it. The Update Function Module gets triggered only when it finds COMMIT WORK statement. Now, I want that when the FM gets triggered and inside it, sy-subrc <> 0 at any stage, it should exit the complete processing and come to my main screen.
    I tried to use Exit, STOP commands in the FM, but they only make the processing to exit from the FM.
    Please suggest what shud I do.
    Helpful suggestions will be surely rewarded.
    Thanks in advance.
    Regards,
    Himanshu

    hi hemansu,
    after coming out from function module check value of sy-subrc
    and
    if sy-subrc ne 0
      exit.  or leave to screen 0 [module pool progarm] or stop.
    endif.
    if helpful reward some points.
    with regards,
    suresh babu aluri.

  • 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

  • Does Update function module gets executed after Commit Work?

    Hi Gurus,
    I have a BAPI with a Commit work. Does update function module V1 , V2 - i need mainly about the sequence of V2, gets executed after Commit work or before Commit work.
    Thanks

    Pl refer to SAP help on the same as follows.
    https://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/content.htm
    Regards,
    Naveen Vishal

  • Authorization Object for Update Function Module

    Hi
    I have a Update Function Module and that FM should be executed based on the Authorization Object .
    I had created a Auth Object with Proper roled assigned to user and i also  did the following
    AUTHORITY-CHECK OBJECT <Obj Name>
               ID 'ACTVT' FIELD '38'.
    If Sy-subrc EQ 0.
    <Process the following>
    End IF.
    But the Auth Object is not working correctly like in the ebugging eventhough my role is not assigned to this Auth Object
    it is giving me sy-subrc as 0 (but in my case it must be not be zero.)
    Is it anything like Auth Object wont work on Update function Module or else is there any different approach we need to follow
    to acheive the functionality .
    Kindly share the inputs
    K.Nadesh Kumar

    Hi
    The issue is resolved
    K.Nadesh Kumar

  • 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 module - How to provide detailed messages in case of errors

    Hello everyone,
    I am using update function modules. When there is a error, the Message i provide goes to inbox and i get a express message.
    I am looking for ways to provide detailed messages (multiple lines) and i also need to add the error message returned by the BAPI
    Providing a long text for the MESSAGE also does not work.
    How can i achieve this ?
    Thanks

    Hi,
    The express message is because the update functions executes in background.
    You can view the detail messages of updates [Error Information from Update Management|http://help.sap.com/saphelp_nw04/helpdata/en/e5/de874735cd11d3acb00000e83539c3/content.htm]
    For your requirement have alook at [Application Log and Application-Specific Error Tables|http://help.sap.com/saphelp_nw04/helpdata/en/a5/3ec9f74ac011d1894e0000e829fbbd/content.htm]
    There are some functions avaibale for this and is mentioned in the document.
    Keshav

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

  • 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

  • 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

Maybe you are looking for

  • Maybe there is an error in calendarPopup.jsp?

    Hi, I think there is en error in the calendarPopup.jsp. You declare a script variable "format" and use it to call js function calendarPopup. But, if you include the page calendarPopup.jsp several times in the same page, then it will redefine the same

  • ITunes won't connect to iPod due to an unknown error (0xE800000A)

    Hello all, I have had my iPod touch for more than a year and I really love it, having had no problems whatsoever. However, a few days ago, I realized that it wouldn't mount in iPhoto or QuickCapture. I did several tests and decided to do a restore. B

  • DOWN key of the keyboard in a JTABLE

    I want that the DOWN key of the keyboard doesn't provoke the passage of a line to another in a JTABLE, I want that she executes something else.

  • Safari slow in admin. account but runs normally in guest account

    Hello, I am new here but I really need help with this problem. Recently Safari has been acting weird while signed in to the admin. account. I will constantly get the spinning beach ball and it will slow the entire computer. Works fine in guest accoun

  • Installing J2SE & J2EE

    I'm running Apache Tomcat and J2SE to run JSP pages and from what I've read I need to also have J2EE installed to do certain "enterprise" things. Is this true and how do I install both to run on the same machine?