Equipmen dismantle, change plant, install does not work

Hello experts,
I have developed a function module which should execute the following steps:
- dismantle an equipment from a functional location
- change the plant of the equipment
- install the equipment into a new functional location
I therefor tried to use these three existing function modules:
- Dismantle -> EQUIPMENT_DISMANTLE
- Change Plant -> BAPI_EQUI_CHANGE
- Install -> EQUIPMENT_INSTALL
Now the problem occurs that the call of the BAPI_EQUI_CHANGE does not execute a commit so the changes are not directly written to the database and the following call of EQUIPMENT_INSTALL is not able to install the equipment into the new functional location.
I tried to execute a BAPI_TRANSACTION_COMMIT after the BAPI_EQUI_CHANGE but still it does not work. In my dev system I can insert a "WAIT UP TO 1 SECONDS." call which work but this does not work in the testing env. Also this is a very bad approach.
The curious thing is that everytime I debug my FM everything is working fine. So I bet there is a problem in the direct following call after the BAPI_EQUI_CHANGE and EQIPMENT_INSTALL.
Here are the relevant calls:
CALL FUNCTION 'EQUIPMENT_DISMANTLE'
    EXPORTING
*     READ_SOBJ             = 'X'
*     READ_ROBJ             = 'X'
*     LOCK_SOBJ             = 'X'
*     I_DATE                = SY-DATUM
*     I_TIME                = SY-UZEIT
      i_inherit_flags       = p_i_inheritance_flags
      old_sequi             = p_i_ls_equi
*     EXEC_MEAS             = ' '
      transmit_new          = 'X'
      direct_new            = 'X'
      commit_new            = 'S'
    CHANGING
      s_equi                = p_i_ls_equi
*     R_EQUI                =
*     R_IFLO                =
    EXCEPTIONS
      err_dismantle         = 1
      OTHERS                = 2
  p_rc = sy-subrc.
  IF sy-subrc NE 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait   = 'X'
      IMPORTING
        return = bapiret2.
  ENDIF.
  itob-maintplant   = p_target_swerk.
  itob-planplant    = p_target_iwerk.
  itobx-maintplant  = 'X'.
  itobx-planplant   = 'X'.
  CALL FUNCTION 'BAPI_EQUI_CHANGE'
    EXPORTING
      equipment               = p_ls_equi-equnr
      data_general            = itob
      data_generalx           = itobx
      data_specific           = itob_eq
      data_specificx          = itob_eqx
*     VALID_DATE              = SY-DATUM
*     VALID_TIME              = SY-UZEIT
    IMPORTING
*     DATA_GENERAL_EXP        =
*     DATA_SPECIFIC_EXP       =
      return                  = bapiret2
  IF bapiret2 IS INITIAL.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait   = 'X'
      IMPORTING
        return = bapiret2.
  ENDIF.
  CALL FUNCTION 'EQUIPMENT_INSTALL'
    EXPORTING
      read_sobj             = 'X'
*     READ_ROBJ             = 'X'
*     LOCK_SOBJ             = 'X'
*     POSEQUI               =
*     I_DATE                = SY-DATUM
*     I_TIME                = SY-UZEIT
      i_inherit_flags       = p_i_inheritance_flags
*     OLD_SEQUI             =
*     EXEC_MEAS             = ' '
*     CALL_EXIT             = ' '
*     CHECK_NEW             = 'X'
      transmit_new          = 'X'
      direct_new            = ' '
      commit_new            = 'X'
    CHANGING
      s_equi                = p_ls_equi
      r_equi                = p_ls_equi_target
      r_iflo                = s_iflo
    EXCEPTIONS
      err_install           = 1
      OTHERS                = 2
How can I enable this inside one function module?
Please, any hints are welcome!
Regards,
Andreas

So, what I have done now is the following:
IF bapiret2-type EQ 'S'.
    COMMIT WORK AND WAIT.
*   now check if changes are written to db
    DO.
      l_iwerk = 0.
      " get the latest item entry
      SELECT SINGLE iwerk FROM equz
        INTO l_iwerk
        WHERE equnr EQ p_ls_equi-equnr AND
              datbi EQ '99991231'.
      IF l_iwerk EQ equitime-planplant.
        p_rc = 0.
        EXIT.                 " data written to db -> exit
      ELSE.
        WAIT UP TO 2 SECONDS. " wait and check in next loop
      ENDIF.
      IF sy-index EQ 10.
        p_rc = 1.             " set returncode to 1
        EXIT.                 " after 10 times -> exit
      ENDIF.
    ENDDO.
  ENDIF.
This code checks if the respective entry in the db is already written and if not retry to read it with a delay of 2 seconds.
Looks a little bit ugly but does the job.
If anyone could get me to a "better" solution I would be happy to hear!

Similar Messages

  • CS4 Design Standard Silent Install does not work

    I've concluded CS4 Design Standard silent install for Macs does not work correctly. I've got the program to install sucessfully with an Exit Code: 0 and the programs still do not work. The whole suite says the licensing has stopped working. I've tried the License Repair utility from Adobe, no go. It looks like the program does not fully install. I noticed within each application directory, it should have an Uninstall application when installed correctly. When this application isn't there, which occurs with silent installs, the whole suite doesn't work.
    Its funny how Adobe wont help me with "enterprise installations". I haven't tried the Creative Suite Deployment Toolkit but I've read other threads where that doesn't work either.
    If someone would like to prove me wrong about the silent installs for CS4, please do so. I've gotten CS3 to install perfectly, and the setup is very similar for both.

    Jimmy,
    As one of the volunteer Forum Hosts, I've requested appropriate help.
    You can also get help via the support portal: http://www.adobe.com/go/supportportal
    Or via the phone: 800-642-3623, Monday-Friday 6am-5pm (Pacific time). BTW, the enterprise number you post isnt a valid number for support.
    Your email address (from your account info) was used to log a CCRT to get Tier 2 to email you, given that you've already tried tier 1 with no solution.
    Please post back and let us know how this works out for you. Thanks!
    Neil

  • Lion Install does not work, says "This disk is used for Time Machine backups"

    I'm having trouble installing Lion onto my macbook pro intel core 2 duo. 
    I am backing up my computer with an external drive using TimeMachine, but i've disconnected it.  Also i'm running SL 10.6.8  
    I have a windows 7 partition that was created with boot camp.
    I've tried to make sure everything is all ready for lion but when I go to install lion it says "This disk is used for Time Machine backups" and the hard drive is grayed out.
    Same problem as this guy: https://discussions.apple.com/thread/3190321?start=0&tstart=0
    I'm hearing that a file called "Backups.backupdb" is on the top level of the hard drive, but I see no such file.  I've looked at the invisible files and I cant find it.
    I've also created a bootable flash copy of the lion install but that does not work It gives me the same message "This disk is used for time Machine backups".

    "Backups.backupdb" if the file in Time Machine.  As the discussion says, you have to find that file and trash it.  Try spotlight to locate it.  If that does not work, down load OmniDiskSweeper from the Internet (free) and go through an organized search to find "Backups.backupdb".  If that takes too long or is too tedious, then if you have everything backed up, erase the HDD and start from square one.
    Ciao.

  • Silent install does not work using /S argument

    I am trying to perform a silent install of the Flash Player using the EXE.  I prefer not to use the MSI.  I am trying this command:
    install_flash_player_10.exe /s
    or
    install_flash_player_ax.exe /s
    Both commands produce this error:
    Invalid argument or invalid use of argument '/s'
    Has anyone encountered this before?  Thanks!

    When we build SMS packages for deployment we also build uninstall packages in the event that we need to rollback. The silet uninstall command for Flash 10.1 is
    install_flash_player_10.exe -uninstall
    It also seems to remove both the ActiveX and Plugin version if both are installed as in our environment. The uninstall string the registry:
    C:\WINDOWS\system32\Macromed\Flash\FlashUtil10h_ActiveX.exe -maintain activex
    does not work.
    Thanks for posting the -install tip. I was having trouble with that.
    Cheers!

  • Problem - SCSM Change status workflow does not work, shows huge "minutes behind" in SQL, but do not appear as failed.

    There is a workflow "Change request status changed" which periodically fails to run, and it does not show up in "All instances" tab. For instance when I cancel a CR, all activities remain as-is in their respective statuses.
    SQL - "SubscriptionStatus" from
    http://blogs.technet.com/b/servicemanager/archive/2013/01/14/troubleshooting-workflow-performance-and-delays.aspx
    shows increasing number of "minutes by" each minute for this particular workflow. 
    Restarting "Management service" does not give enything. As well as "UpdateSubscriptionWatermark" SQL from the link above (except resetting the "minutes behind" counter)
    Please help!
    Egils Zonde from Technet

    Take it to an apple store and see if you can get an out of warranty replacement. It won't be free, I think the fee for an Air replacement is $299, but it sounds like the insides are broken.

  • Changing JInternalFrame color does not work

    UIManager.put("InternalFrame.activeTitleForeground", new ColorUIResource(Color.red));
    UIManager.put("InternalFrame.activeTitleBackground", new ColorUIResource(Color.red));
    UIManager.put("InternalFrame.borderColor", new ColorUIResource(Color.red));This code does not make anything appear red on my JInternalFrames .. the header etc. still looks purple when selecting one ... why is this?

    That is because the internal frame isn't using those settings for setting the color of the internal frames. If you look at the code in javax.swing.plaf.metal.MetalInternalFrameTitlePane you can see that the title pane is drawn using:
    MetalLookAndFeel.getPrimaryControlHighlight() MetalLookAndFeel.getPrimaryControlDarkShadow()
    MetalLookAndFeel.getPrimaryControl()
    MetalLookAndFeel.getControlHighlight()
    MetalLookAndFeel.getControlDarkShadow()
    MetalLookAndFeel.getControl()
    If you wish to change the color of internal frames, you have to either change those settings L&F wide, or create your own internal frame title bar UI classes (not a small task you will find).
    Why doesn't it use those settings? No idea, it should use something like that.

  • Adobe elements photo shop full install does not work. How do I get it to work?

      It worked before and now it doesn't. For some reason the computer is treating the full install as if it were a demo. I already registered the product when I first installed...... Only the organizer works now. I uninstalled and re installed but still doesn't work. How do I get it to work...I have windows 8.1...Please help...Thank you.
    Somehow the Adobe Manager is not recognizing the full install. Is that possible? There are 2 selections during installation ....trial or product key....
    I selected product key since I have the product key. The installation accepts the product key acts like it is installing but then it doesn't run...then I tried the demo installation without the key since I can't enter it in the box in demo mode....that doesn't run either.....Is the Adobe Manager the problem? How do I fix this?
    Once again, any help or tips will do...Thank you....

    The password prompt is supplied by the operating system, and is intended to protect you from accidentally installing software.  You will get this prompt for any installation outside the App Store context.
    If you do not need to enter a username or password when starting your computer, you can probably just leave the password field blank when acknowledging this prompt.

  • Changing icons & Controls does not work- Help needed

    When changing the theme in "theme preferences" only the window borders change... The icons and window controls remains as the same boring default.
    Does anybody have a solution to the problem?

    kapelrud wrote:
    Oh, sorry... I just had to forget that
    I use gnome 2.8 as my DE
    Update: A nice little reboot fixed the problem. It may have been because I added fam to the startup...
    i always use ... "switch" and "switch2" from pacman.  they're small programs to switch gtk/gtk2 themes... I don't have the whole gnome package so that works well for me.

  • After upgrading to version 10.0.2, the pinch and close to change font size does not work

    I'm using Mac OS X version 10.6.8. The pinch and close works with Safari but not Firefox 10.0.2

    Some gestures have been removed in Firefox 4+ versions.
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    * browser.gesture.pinch.in -> <b>cmd_fullZoomReduce</b>
    * browser.gesture.pinch.in.shift -> <b>cmd_fullZoomReset</b>
    * browser.gesture.pinch.out -> <b>cmd_fullZoomEnlarge</b>
    * browser.gesture.pinch.out.shift -> <b>cmd_fullZoomReset</b>
    * browser.gesture.pinch.latched -> <b>false</b>
    *http://kb.mozillazine.org/about:config
    *https://addons.mozilla.org/firefox/addon/pinchy/

  • Adobe AIR Error - Uninstalling and Re-installing does not work?

    I keep getting this error everytime I turn n my laptop.  I have uninstalled and re-installed Adobe AIR several times and still keep getting this error after it tells me it has been installed successfully.  "This installation of this application is damage.  Try re-installing or contacting the publisher for assistance."  What is wrong with this program?  I cannot keep uninstalling and re-installing  this program and it is not installing properly.

    Pat has a great point and asks a good question.  In addition to identifying the AIR application that is causing you problems you may also want to review Troubleshoot AIR installation | Windows - http://helpx.adobe.com/air/kb/troubleshoot-air-installation-windows.html.

  • Batch change to description does not work

    I have a IMac27" Intel i7 using IPhoto 09
    I am trying to batch update the description on multiple photos.
    I shift click on a series of photos then go to batch update> change description.
    It appears to start with a message and blue line that says " updating photos ", but then after the initial blue line nothing advances and nothing happens to the photos

    This will end my contributions to this topic. I have done my best to describe the symptoms I encountered, how I had created this problem, and a solution to it.
    I have no special knowledge to how or where metadata is stored with a file, nor the permissions associated with the file and its storage in iPhoto. Unless someone can correct me, I had believed that capture date, camera, format, lens, EXIF, TIFF, CANON, or any other descriptor are part of the metadata and that Canon stored all of this information together with the image in a single file. It did not matter to me whether IPTC data was part of any image file that I imported into iPhoto or not. I am presuming there is metadata attached to image files that can be properly parsed to give what can be loosely described as capture date, time, EXIF, TIFF, CANON, IPTC or any other descriptor that might be present. Because I had used batch change to write data to RAW images in iPhoto in the past, I expected I would be able to do so again. I wasn't trying to trick iPhoto or any readers into confusion about how or where that data may be stored. I simply noted that I had some RAW files that iPhoto could not write to and some that it could.
    I hope that I have given an adequate description of how I encountered this problem. If others should encounter a similar effect, they may try the solution I found (namely, export the original file and re-importing it).
    If someone wishes to explain why the solutions suggested by Old Toad were incorrect for photos imported from another computer, be my guest.
    Message was edited by: Peter Wepplo

  • HT5655 Feb 2013 Adobe Flash Player Upgrade Install Does not work - metafile issue

    I tried uploading the Feb 2013 update without success. Adobe troubleshooting suggested uninstalling existing version of AFP - which I did - still get "Metafile Instalation failed" - now have NO AFP. Adobe says they are aware of the issue and working on it. Any ideas as to how to reupload my old AFP version??

    That's great to hear that you were able to find a solution.
    I've been trying to fix this issue with Adobe for 5 days now and no one is coming back to me (tried the terminal cd solution and it doesn't work).
    Luigi could you expand on where you were directed to find a solution? Running  
    sudo ./Install\ Adobe\ Flash\ Player.app/Contents/MacOS/Install\ Adobe\ Flash\ Player 
    has only given me a "command no found" message.
    Thanks

  • Recently changed documents command does not work

    Using DW CS5. German version.
    When I want to access all the files that have been changed recently, I get an error message
    " when OnClick in SelectRecentlymodified.html , following Javaccript-Errors occured:
    In Line 370 of the file "C:Programme/Adobe/Adobe DReamweaver C5/Configuration/Menus/MM/SelectRecentModified.js":
    DWfile.getAttributes (listItem) has no properties.
    This is the german thread, which did not get any answers yet:
    http://forums.adobe.com/thread/718535?tstart=30
    Anybody has any suggestions what to do?
    Thank you.

    Now I realized that this problem occurs only with one site definition.
    Anyone has any more suggestions? Could reinstalling DWCS5 help?
    Try this -
    1.  Open DW's SiteManager, select this site's name, and export the site definition (make sure you do a full site definition export including the FTP information).  Save the resulting *.ste file in a place where you can find it again.
    2.  With the site's name still selected in SiteManager, REMOVE the site from DW by clicking the REMOVE button.
    3.  Now Click on IMPORT and import the *.ste file you just exported.
    Is the error still with you now?

  • On Mac OS X, multitouch with Firefox 4 RC does not work.

    Multitouch support (such as changing text sizes) does not work on Mac OS X when using Firefox 4 RC

    Some gestures have been removed in Firefox 4.<br />
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    browser.gesture.pinch.in cmd_fullZoomReduce
    browser.gesture.pinch.in.shift cmd_fullZoomReset
    browser.gesture.pinch.out cmd_fullZoomEnlarge
    browser.gesture.pinch.out.shift cmd_fullZoomReset
    * http://kb.mozillazine.org/about%3Aconfig

  • Hello! I have installed Photoshop on PC WIN 7 64bit. When I store first time a Photoshop docuument, it works fine - after re-opening and doing changes I trying again to store it - it does not work anymore! First it does not accept the name (message "It ca

    Hello! I have installed Photoshop on PC WIN 7 64bit. When I store first time a Photoshop docuument, it works fine - after re-opening and doing changes I trying again to store it - it does not work anymore! First it does not accept the name (message "It can not be stored because the nam is invalid" With 2. trial it tells me that the data is blocked and I don't have the rights - and I should chenge them. But I am working as the Admin on my PC - and each trial to change the rights of the data is as well not possible because of missing rights - even I am Admin! I must always store the data with a new name, then it works, but I also cannot remove the old datas or shift them into the waste paper - because of no rights! -- sorry for not perfect english, I am German native speaker! Tahnks a lot for help!

    Hi,
    I am using a Nvidia 4200M adapter in my Laptop, Driver 266.96, Direct X 11
    In my desktop I am using an ATI XFX 6950, latest revision drivers (I am not at home right now so I cant get that info).
    The issue I did describe above, but it was a long explanation.
    In some flash games the game files load initially and get as far as the "click to start" button. Then the flash area usually goes either all white or all black (usually depending on the falsh game default background color) and then it stays that color. Cant see anything after hitting start (usually most games have an intro video or animation before the game starts, but I cant see any of it.
    For the very few games that do start, the flash game or application does not seem to work correctly in that when the rare game starts, it wont save any game files or save files to the pc and so if I exit the game (navigate away to another page or close browser) and then later come back, even though I click the option to save games (and ensure that the flash application slider shows it can save files and lots of space) it does not save and I have to start from the beginning all the time.
    More explanation I gave above.

Maybe you are looking for