Commit Work for just one function module

Hi experts,
i have one question;
I need one solutions for commit work but just one function module. If i set commit work in function module then everything is taking the commit. But i dont like this. I need just for FM. This is impossible ?
Thak you, regards.

Hi,
The only way I know involves creating a nested LUW - opening a new internal session by calling ABAP program using SUBMIT ... AND RETURN or a CALL transaction code.
Meaning, you'd have to code your logic in a report program/transaction, use the function module to merely call that report/transaction and, if necessary, use EXPORT/IMPORT or SHARED MEMORY to exchange data between the sessions. It's quite "ugly" solution IMO, and it involves session handling overhead, which can make it unsuitable for time-critical mass processing.
Cheers,
Janis

Similar Messages

  • 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

  • Invalid COMMIT WORK in an update function module.

    Hi,Experts,
         Currently We got a problem for posting PO's GR with t-code MIGO. Our requirement is that can create Delivery by automaitcly after PO's GR is saving. Then I have tailored a program for creating delivery.The program will be triggered in an output type when saving action is done.
    Error info is as below
    "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."
    Any help will be appreciated
    Thanks in advance
    Richard Zhou

    Hi Richard,
    First create an implementation for the BADI in se19,
    then in any of the methods put break point and run MIGO
    You can clearly see in the debugger what all values come
    Please note that u have 2 methods
    one works in update task and another as normal function module..to view the documentation of the BADI->go to se18 -> enter the name of the BADI -> Display -> click on documentation to View the purpose and use of the BADI you have mentioned,Please note that all BADIs may not have documentations.............
    Also if u feel that the replies are helping you out please reward points....this way the SDN members will be willing to do a bit more homework for you and help you out...
    To proceed with the BADI
    Please check the documentation below
    Business add-ins when creating a material document
    The enhancement MB_DOCUMENT_BADI has two methods that are called up by the same interface, though at different times. All material document data from the following tables is transferred to this business add-in:
    MKPF (material document header)
    MSEG (material document items)
    VM07M (update data)
    This data can be used in other programs, but cannot be changed.
    The methods differ according to the time at which they are called up:
    The method MB_DOCUMENT_BEFORE_UPDATE is called up before the FI document is created. This means that it is called up even if the program is terminated by an error during the subsequent processing. The update of data in separate tables should always be contained in function modules that are called up with the addition 'in update task'. This ensures that all the data is updated consistently.
    The method MB_DOCUMENT_UPDATE is not carried out until update. This means that all updates are carried out immediately in their own tables and do not have to be contained in 'update task' in function modules. For performance reasons, you should not re-read the tables or carry out any time-consuming routines at this point.
    You should always call up MB_DOCUMENT_BEFORE_UPDATE before MB_DOCUMENT_UPDATE, particularly if time is a critical factor when posting the material documents. The method MB_DOCUMENT_UPDATE is processed after the FI document numbers are called. As a result, no other FI documents can be posted until this document is completely updated.
    Even if the two methods are in the same class, you cannot access the same global fields, as the methods are called up at different times and are therefore carried out in another roll area.
    From the business add-in display, you can go to coding examples for both methods by choosing Goto -> Example coding -> Display
    Note
    The enhancement does not transfer any data to the material document, that is, you cannot change material document data before it is updated.
    If this business add-in is not set up properly, it may result in an inconsistency between the documents and the stocks and between the material documents and the accounting documents. Inconsistencies like these may be caused by the following elements in the business add-in:
    COMMIT WORK
    Remote function call (CALL FUNCTION ... DESTINATION)
    Own updates in document tables or stock tables (for example, update in tables MBEW, MARD, MSEG)
    The unlocking of data (for example, via DEQUEUE_ALL)
    Before the two business add-ins are called up, data is already flagged for the UPDATE. If a COMMIT WORK or a Remote Function Call is transmitted in the enhancement, these are written in the database. If another error occurs after the business add-ins are processed, you cannot carry out a complete ROLL BACK, as the data up to the COMMIT or Remote Function Call has already been written in the database. This can result in an inconsistent status (for example, material document without accounting document), which can only be repaired with considerable cost and effort.
    The business add-ins are not suitable for customer-specific updates in the stock tables, as updates like these destroy the standard stock update.
    Unlocking the data (for example, via DEQUEUE_ALL) is also critical, as the data that is to be updated is no longer protected from updates from external systems, and inconsistencies can result from parallel updates.
    Before you activate an enhancement, check carefully that the business add-in does not contain any critical coding places.
    If data inconsistencies have already occurred in your system as a result of the business add-in, remove the critical coding so that it does not cause any further inconsistencies.
    Regards
    Byju

  • Why wont my imessage work for just one contact

    For some reason my iPhone wont let me imessage with just one of my contacts... it works with all the other ones but that contact stays regular sms text! Tried rebooting the phone and turning my imessage on and off... dont get it!

    I have the same problem as SWatson12, and the person I'm texting has an iPhone 4S like me and is in my house - so there isn't a question of coverage area or type of phone.
    But iMessage still works with this person if I text via my Mac or iPad.
    This has been a problem since last night. At first, when I updated to 10.8.2, it worked great!

  • Imessaging not working for just one person.

    I have an Iphone 4S and my friend jst got an Iphone 5. She still has her iphone 4s and Imessaging works just fine with that.  But once she got her Iphone 5 we haven't been able to send Imessaging back and forth.  But it still works on the 4S.  Anyone know how to fix that?  I reset the settings on my phone, but that just made it so i couldn't imessage her at all, just sends as a regular text.

    She should log out of iMessage, then log in again.  That usually fixes these types of problems.

  • My imessage wont work for just one contact

    Hi,
    I have been searching on this forum & the Internet for a solution to no avail so maybe someone can help me.
    I have a friend who has the iPhone 5 with latest update (iOS 6.0.1).    She can iMessage her husband no problem. I have iPhone 4 with same software version but when we iMessage each other the messages are going through as SMS messages. I can iMessage other friends with iPhones no problem.
    Yes we both have iMessage switched on.  Yes I have tried re-booting my phone, switching my iMessage on/off, switching airplane mode on/off &
    still no joy.
    Any ideas?

    I have the same problem as SWatson12, and the person I'm texting has an iPhone 4S like me and is in my house - so there isn't a question of coverage area or type of phone.
    But iMessage still works with this person if I text via my Mac or iPad.
    This has been a problem since last night. At first, when I updated to 10.8.2, it worked great!

  • How to execute Update Module FM after final commit work for a T-code.

    Hello Folks,
    I have a bit complex issue with my current object.
    We have modified MM41/MM42 transactions and added a subscreen to fulfill the requirement.
    We have designed the subscreen and embedded the same to MM41/MM42 through SPRO configuration.
    Now for update business logic,i am trying to execute one Function module(Update Module) in update Task...so that it will be executed once after the final commit work will be done for MM41/MM42.
    But its not executing.
    To fulfill my requirement i need to execute the FM only after Final Commit work for MM41/MM42.
    Please suggest in this regard.
    Even i can see few BADI's which are triggering through MM01/MM02 but not through MM41/MM42.
    BADI_ARTICLE_REF_RT
    BADI_MATERIAL_CHECK
    BADI_MAT_F_SPEC_SEL
    Code with which i am trying is given below.
    After PAI event of the subscreen---
    1:        MODULE USER_COMMAND_9001.
    2:       MODULE user_command_9001 INPUT.
                        PERFORM sub_save_mara ON COMMIT.
              ENDMODULE.
    3:       FORM sub_save_mara.
                         CALL FUNCTION 'ZMMUPDATE_MARA_APPEND_STRUCT' "IN UPDATE TASK
                                        EXPORTING
                                                 materialno = gv_matnr
                                                 appendmara = ty_zzmara.
             ENDFORM.                    "sub_save_mara
    4:                FUNCTION zmmupdate_mara_append_struct.
                      ""Update Function Module:
                       ""Local Interface:
                      *"  IMPORTING
                   *"     VALUE(MATERIALNO) TYPE  MATNR
                   *"     VALUE(APPENDMARA) TYPE  ZZMARA
    Data Declaration for Local use
      DATA : w_mara TYPE mara.
    Selecting the latest values for the material.
      SELECT SINGLE * FROM mara INTO w_mara WHERE matnr = materialno.
      IF sy-subrc = 0.
      Move the ZZMARA values to structure MARA
        MOVE-CORRESPONDING appendmara TO w_mara.
      Update the values in table MARA.
        MODIFY mara FROM w_mara.
      ENDIF.
    ENDFUNCTION.
    Kindly suggest.Thanks in advance.
    Regards
    Ansumesh

    Hi..
    The code given by me will work fine provided the Final commit should happen.
    Because to execute FM with update task,final commit work should happen which is mandatory and after that it will call the update task.
    In my case final commit work was not happeneing because..SAP standard program was not able to detect wether there is any change in my sub-screen or not as the standard program & my custom program,subscreens are different.
    As it was not able to detect the change,so final commit was not happening and hence update task also.
    To provide the reference of change in my subscreen to standard program ,i set a flag as per the change in the subscreen
    And exported the same to memory.
    Then Implemented one enhacement spot in MATERIAL_CHANGE_CHECK_RETAIL Fm where i have Imported the flag value.
    Based on my custom flag value,i have set one standard flag FLG_AENDERUNG_GES which tells SAP standard program for MM42 wether any change has happened or not.
    The above solved my purpose.
    Regards
    Ansumesh

  • How to give only one function module execution Auth for a User ?

    Dear Experts
    I have reviewed S_DEVELOP auth object. It is not ful filling my requirement
    Any Ideas !!
    Rgds

    Rakesh...Firstly thanks for reply.
    As i said i reviewed these and found it is not meeting my requirement.
    As we aware We can control auth to Function modules thru object type
    Filed OBJTYPE----
    FUGR --> 1st control
    and with Function Group Name
    Field OBJNAME----
    <Function Group Name>  --> 2nd control
    In my scenario - I have given the authroizations as below
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    ACTVT            Activity                                                 Display, Execute
    DEVCLAS       Package                                               *
    OBJNAME      Object name                                         ZECC_FG
    OBJTYPE       Object type                                           FUGR
    P_GROUP       Authorization group ABAP/4 pro              *
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    The above authroization is giving all Function modules authrozation under ZECC_FG Function Group.
    My Requirement
    I shoudl be able to give only one Function Module of a Function group where multiple function modules exist under the same Function Group.
    How can i acheiveit. Any Custom Control can be place to acheive this.
    I am sure S_DEVELOP will not solve my requirement (I Beleive)
    Regards

  • EAM ID based or Role based? Why settle for just one?

    G'Day All,
    I've raised a question in the following blog, however I would like to open it up to other people as well so they might get something out of it and in the process might share their own thoughts on the matter at hand.
    ID-Based Firefighting vs. Role-Based Firefighting
    So this is where I am at this point:
    From what I can gather so far, my understanding of EAM ID/ROLE based is as follows:
    - Id Based: Logs in using own U.ID and through GRAC_SPM accesess FFID from the GRC Server and logs into the system assigned to them (ECC, SRM, CRM etc)
    Only one user at a time can use a FFID.
    Firefighter need not exist in every system assigned to them due to central logon however they need to exist in the GRC system
    Knows exactly when FFID is being used as he/she has to login so has a psychological effect (good thing)
    Better tracking of FF tasks - Specific log reports with Reason Codes. Bonus point from Auditors!
    Two Log ins so potential to commit fraud. (1 action using own UserID and 1 action using FFID)
    Could be hard to track and find out when a fraud has been committed so can be a problem with auditors.
          ID Based -> GRAC_SPM : TCode for Centralised FFighting -> You will see FFIDs assigned to you
          ID Based -> /n/GRCPI/GRIA_EAM : TCode for DCentralised FFighting -> You can see  the FFIDs assigned to you
    - Role Based: Logs into the remote system only using U.ID, so everything gets logged against that one ID. 
    Multiple users can use the FFROLE at once.
    Firefighter has to exist in every system assigned to them - so multiple logons.
    Hard to differentiate between FF tasks and normal tasks as no login required  So easy to slip up
    Time consuming to track FF tasks - No Specific log reports. No Reason Codes
         R.Based -> GRAC_SPM : TCode for Centralised FFighting -> You will see FFROLEs
         R.Based -> /n/GRCPI/GRIA_EAM : TCode for DCentralised FFighting -> Not applicable so wont work
    So based on this there are pros and cons in both however according to SAP only one can be used. To me personally,  it makes more sense to get the best of both the worlds right? So here is my question why can’t we just use both?
        . Really critical tasks -> FFID
        . Normal EAM tasks -> FFRole
    Alessandaro from the original post pointed this out:
    "Per design it isn't possible to achieve both types of firefighting at the same time. It's a system limitation and hence to configurable."
    Well this is what I can't seem to get my head around. For a FFID, there is a logon session so it has to be enabled and as far as I can tell there is no way around it.
    However for FFRole, there isn't such limitations/restrictions like starting a separate session. FFRole is just assigned to an end user for him/her to perform those tasks using their own user ID.
    So in what way is it different from any of their other tasks/roles, other than the fact that they've got an Owner/Controller assigned to the FFRole? and
    What is stopping us from using it when ID based is the default?
    If I were to do the following does it mean I can use both ?
        . Config Parameter: 4000 = 1 (GRC System) -> ID Based
        . Config Parameter: 4000 = 2 (Plug-In)  - > Role Based
    Please excuse me if my logic is a bit silly, Role Based firefighting is only done on Plug-in systems so the following should work just fine:
       . Config Parameter: 4000 = 2 (Plug-In)  - > Role Based
    However for ID based, it is a Central Logon, so the following is a must:
        . Config Parameter: 4000 = 1 (GRC System) -> ID Based
    Which means both ID/Role based can be used at the same time, which seems to be working just fine on my system. Either way I leave it you experts and I hope you will shed some light on it.
    Cheers
    Leo..

    Gretchen,
    Thank you for thoughts on this.
    Looks like I'm failing to articulate my thoughts properly as the conversation seems to be going in a different direction from what I am after. I'll try once more!
    My query/issue is not in regards to if/what SAP needs to do about this or why there isn't more support from Companies/Organizations and not even, which one is a better option.
    My query is what is stopping us(as in the end users ) from using both ID/Role based at the same time?
    Now before people start referencing SAP documentation and about parameter 4000, humour me with the following scenario please. Again I would like to reiterate that I am still in the learning phase so my logic might be all wrong/misguided, so please do point out to me where I am going wrong in my thought process as I sincerely would like to know why I am the odd one out in regards to this.
    Scenario
    I've created the following:
    FFID
    FFROLE
    Assigned them to, two end users
    John Doe
    Jane Doe
    I set the Configuration Parameters as follows: 
    IMG-> GRC-> AC-> Maintain Configuration Settings -> 4000:1 - ID Based
    IMG-> GRC (Plug-in)-> AC-> Maintain Plug-In Configuration Settings-> 4000:2 - Role Based
    User1
    John Doe logs into his regular backend system (ECCPROD001)-> executes GRAC_SPM-> Enters the GRC system (GRCPROD001)-> Because the parameter is set to ID based in the GRC Box, so he will be able to see the FFID assigned to him-> and will be presented with the logon screen-> Logs in -> Enters the assigned system (lets say CRMPROD001) At this point the firefighting session is under progress
    User2
    Jane Doe logs into her regular backend system (ECCPROD001) -> (can execute GRAC_SPM to check which FF Role has been assigned to her but she can see that in her regular menu, so there is no point) -> Executes the transactions assigned in FFROLEThis is done at the same time while FFID session is in progress
    So all I want to know is if this scenario is possible? if the answer is No, then why not?
    I physically carried out this scenario in my system and I had no problems(unless I am really missing the plot here), which brings me back to my original question: Why settle for just one?
    Again to reiterate I am not getting into the efficacy or merits of this or even if one should use this. Just want to know if it is possible/feasible or not.
    So there you have it. That's the whole enchilada(as they say there in Texas). I tried to word my thoughts as concisely as I can, if there are still any clarifications, more information you or anyone else reading this would like, please do let me know.
    Regards,
    Leo..

  • How to know the changes done in one function module??

    Hi All,
    Could you please let me know how can I know the changes done in one function module?
    I am not a technical expert..I can just jump into SE37 to access the function module.. but would like to know if there are any logs for the function module screen which tells us about the versions and changes done from time to time?
    Thanks,
    Ramya

    Hi Ramya,
    There are ways to look at the modification overview for a function module
    1) In se37, after selecting the function module, click on Ctrl + Shift + F2
    2) Other way is the menupath ie Edit > Modification operations > Modification overview.
    Hope this helps you.
    Please confirm
    Regards
    R. Senthil Mareeswaran.

  • What is the exact syntax for calling remote function module.

    Hi to all
    1.....what is the exact syntax for calling remote function module.?
    Thanks and regards,
    k.swaminath reddy

    hi
    good
    Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.
    Do the following steps for creating RFC in server A.
    1. log on to server A
    2. go to se37
    3. Edit -> function groups-> create function group and give the function group name (say ZGRP).
    4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.
    5. go to attribute tab -> choose remote-enabled module from processing type.
    so that your FM will become RFC.
    6. provide the import parameter in import tab.
    we will provide only two import parameters.
    - parameter name : P_NUM1, typing: TYPE, associated type : I & check the pass value (all the parameters of RFC must pass by value).
    - parameter name : P_NUM2, typing: TYPE, associated type : I & check the pass value
    7. provide the export parameter in export tab.
    parameter name : P_SUM, typing: TYPE, associated type : I & check the pass value
    8. write the given simple code in source code tab.
    FUNCTION Z_TEST_RFC.
    P_TOT = P_NUM1 + P_NUM2.
    ENDFUNCTION.
    Do the following steps for creating ABAP program which will call the RFC in server B.
    1. se38 - > creat a program.
    2. write the given simple code.
    data tot type i.
    call function 'Z_TEST_RFC' destination 'XXXXXX'
    exporting
    p_num1 = 10
    p_num2 = 15
    importing
    p_tot = tot.
    write tot.
    please note that XXXXXX is RFC connection which is avialable in sm59 transaction in server A.
    -go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of XXXXXX in the code.
    finally you can execute the normal abap program that will call the RFC and display the result.
    reward point if helpful.
    thanks
    mrutyun^

  • Can i use fp_job_open, fp_job close in one function module to get hex pdf

    Hello All,
    Can anyone help me here.
    I am trying to use function modules FP_JOB_OPEN, FP_JOB_CLOSE,FP_FUNCTION_MODULE_NAME and call generated function modules in one function module and try ing to get hex string of pdf.
    But hex string of pdf is not coming.Should i do any setting in any of the parameter so that the function module using all these function module gets the pdf hex string.
    Regards,
    Menaka.H.B

    Hello,
    do you want to get the PDF out of the printing program to use it elsewhere? (Portal, GOS etc.)
    You need to work with the CALL FUNCTION fm_name part where the output parameter of the generated function module is XSTRING type (if i remember well) and that´s a place to start. You can convert from xstring to binary and back using SCMS_XSTRING_TO_BINARY and BIN_2_SCMS.
    Also do not forget to set fp_outputparams-GETPDF = 'X'. to get the hex.
    Regards, Otto

  • How do I make a transpose/octave button for just one instrument in a split?

    I work in mainstage 2.2.2 with patches that are using splits, and I want to make an octave button for just one instruments in a patch. Suggestions? (If I press the octave button in my keyboard, the whole split point moves, no good...)
    Benny

    An octave button for just one instrument will work for some instruments. EVB3, ESX24, ESM and a few others can be assigned. However I was unable to make it work with EVP88 and ES2. Try this example: in layout mode set up a button(or buttons) on your controller keyboard for changing octaves. In edit mode add a channel strip and select an ESX24 instrument. Select the screen control button you want to assign in the workspace. In the screen control inspector, select the mappings tab. The list below will say unmapped. Double-click on it. Select the instrument in the list. Another list to the right will appear. Select ESX24 (Sampler). In the column to the right, select the pitch folder, then select transpose. To the right, you'll see saved value, button on and button off values. This should get you started. Some of the instruments have different menus, so they'll be a little different. Have fun with it.

  • How can I turn off imessage for just one of my contacts? Me and my husband just upgraded (both had iphone 4), I got the iphone 5s and he got he note 3. All my text to him automatically send as a imessage. Ive tried to delete his contact and then went back

    How can I turn off imessage for just one of my contacts? Me and my husband just upgraded (both had iphone 4), I got the iphone 5s and he got he note 3. All my text to him automatically send as a imessage. Ive tried to delete his contact and then went back in and reentered it but that doesnt work.

    Have your husband text the word "stop" to 48369. This should take his number out of the iMessage system.
    Go into your settings under messaging and make sure the box to send as an SMS if iMessage is unavailable is checked.
    Hopefully this will get your messages sending/receiving to each other.

  • How do I make a transpose button for just one instrument in a split? (mainstage)

    I work in mainstage 2.2.2 with patches using splits and I want to make an octave button for just one instruments in a patch. Suggestions?
    Benny

    Depending on your virtual instrument you can assign octave to a MIDI control. If you assign all of them to the same control on every track then that would be the effect, but like I said before, it really depends on which instruments you use.

Maybe you are looking for

  • Solution to problems of "Double NAT" or until to Back to My Mac (BTMM)

    Folks, Here is a couple of easy steps to try to resolve these problems, at least with Qwest ISP / using the ActionTec M1000 aDSL modems / routers. I struggle for a while on this one and finally found the right information that made this easy. Typical

  • Intermittent MousePressed Events

    I am having trouble with mouse pressed events. I have a JFrame with 2 images in JPanels, with a separate JComponent sindow that will display one or the other image with a delay. It flickers between the 2 images using a thread. The JPanel responds to

  • How do I take bold off of the desktop icon font on my MacBook Pro?

    I thought I did it in the past, but I can't figure it out now.  I am looking at the desktop icons on my MacBook Pro, and the font is bothering my eyes.  I am trying to take the bold off, but I cannot figure out how to do it.  I saw where to change th

  • Time machine restore incomplete on new hard drive?

    My seagate hard drive started to fail on my 2010 27" iMac (S.M.A.R.T fault, unfortunately not covered by the recall) and I have Best Buy geek squad warranty. I also have a 2T Time Capsule with backups, so I wasnt worried about losing any data (lots o

  • Error creating new Customer Equipment Cards

    Dear experts, I am getting the following error when creating a new Customer Equipment Card: This entry already exists in the following tables  'Customer Equipment Card' (OINS) (ODBC -2035)  [Message 131-183] I cannot find out what is causing this! SA