XVBAP has the new line item but does not update Sales Order

Hi
I need to update the sales order with a new line item when the line item has a base unit of measure as the sales unit. I need to then convert the base unit to sales unit with a whole figure and the rest can be in the base unit.
I am able to see the update in the xvbap but the line item doesn't get updated.
I am puting this code in a perform within
MV45AFZB  within   Form  USEREXIT_CHECK_VBAP
But I guess I am doing something wrong can someone please take a look at it and tell me what is wrong with the coding.
*&  Include       ZSD_CREATE_NEW_LINE_ITEM              *
*&      Form  create_new_line_item
      text
-->  p1        text
<--  p2        text
FORM CREATE_NEW_LINE_ITEM .
  CONSTANTS: C_MEINH LIKE MARM-MEINH VALUE 'CSE'.
Variables Used
  DATA: WS_WMENG LIKE VBEP-WMENG.
  DATA: INPUT  LIKE VBAP-KWMENG,
        WS_EA  LIKE VBAP-KWMENG,
        WS_CSE LIKE VBAP-KWMENG.
  DATA: WS_MVKE_VRKME LIKE MVKE-VRKME.
Internal Tables and Structures
  DATA: WS_XVBAP LIKE XVBAP.
DATA:
it_vbap  LIKE vbap OCCURS 0 WITH HEADER LINE,
it_vbep  LIKE vbep OCCURS 0 WITH HEADER LINE,
it_xvbap LIKE vbapvb OCCURS 0 WITH HEADER LINE.
  DATA: BEGIN OF WS_MARM,
          MEINH LIKE MARM-MEINH,
          UMREZ LIKE MARM-UMREZ,
          UMREN LIKE MARM-UMREN,
        END OF WS_MARM.
  CLEAR WS_MVKE_VRKME.
  SELECT SINGLE VRKME INTO WS_MVKE_VRKME
    FROM MVKE
    WHERE MATNR EQ XVBAP-MATNR
    AND   VKORG EQ XVBAK-VKORG
    AND   VTWEG EQ XVBAK-VTWEG.
  IF VBAP-VRKME <> WS_MVKE_VRKME.
   LOOP AT XVBAP.
      SELECT SINGLE MEINH UMREZ UMREN
        FROM MARM
        INTO WS_MARM
        WHERE MATNR = VBAP-MATNR
        AND   MEINH = WS_MVKE_VRKME.
      IF XVBAP-MEINS <> WS_MVKE_VRKME.
        IF NOT XVBAP-KWMENG = 0.
          WS_WMENG = XVBAP-KWMENG / WS_MARM-UMREZ.
          IF WS_WMENG > 1.
This means that the line item needs to be split into CSE & EA
              INPUT  = XVBAP-KWMENG.
              WS_EA  = INPUT / WS_MARM-UMREZ.
              WS_CSE = WS_EA.
              WS_EA  = WS_CSE * WS_MARM-UMREZ.
              WS_EA  = INPUT - WS_EA.
Now we have the qty. split into EA & CSE. Now to
assign it to xvbap
              XVBAP-KWMENG = WS_EA.
              XVBAP-VRKME  = WS_MVKE_VRKME.
          READ TABLE XVBAP WITH KEY POSNR = XVBAP-POSNR.
            MODIFY XVBAP INDEX SY-TABIX.
              WS_XVBAP = XVBAP.
              WS_XVBAP-KWMENG = WS_CSE.
            MOVE-CORRESPONDING WS_XVBAP TO XVBAP.
            INSERT XVBAP INDEX SY-TABIX.
          ENDIF.
        ENDIF.
      ENDIF.
  ENDIF.     " IF xvbap-vrkme 'EA'.
ENDFORM.    " create_new_line_item

Hi Clark,
Pls check the Include MV45AFZZ instead of the one which you are using . Here in this include MV45AFZZ you can have access to the Header and Line items data .
Here in this include
      FORM USEREXIT_SAVE_DOCUMENT                                   *
      This userexit can be used to save data in additional tables   *
      when a document is saved.                                     *
      If field T180-TRTYP contents 'H', the document will be        *
      created, else it will be changed.                             *
      This form is called at from form BELEG_SICHERN, before COMMIT *
form userexit_save_document.
Endform.
Either you can write the code you want to update the XVABP table here or you can use the form .
      FORM USEREXIT_MOVE_FIELD_TO_VBAP                              *
      This userexit can be used to move some fields into the sales  *
      dokument item workaerea VBAP                                  *
      SVBAP-TABIX = 0:  Create item                                 *
      SVBAP-TABIX > 0:  Change item                                 *
      This form is called at the end of form VBAP_FUELLEN.          *
form userexit_move_field_to_vbap.
endform.
This are the 2 performs in this include where you can do you code and it will defnitely solve your problem.
Good Luck to you . Let me know if your problem get solved.
Thanks & Regards,
Naidu.

Similar Messages

  • I recently purchased a new mac computer and would like to sync the music off my iPhone to my new mac.However, my phone and my new mac have different apple Ids.The PC which my phone is synced and has the same apple ID but does not let me transfer the music

    Hi I recently purchased a new mac computer and would like to sync the music off my iPhone to my new mac.However, my phone and my new mac have different apple Ids.The PC which my phone is synced and has the same apple ID but does not let me transfer the music. Home sharing is not working. How do I successfully transfer and sync the music off my ipone 4 to my mac book pro if they have different Apple IDs? Thanks!

    What do you mean the PC won't let you transfer the music? Save your entire iTunes folder (this is assuming that you have all your music stored in your iTunes folder) to an external hard drive. Connect that hard drive to your Mac. Copy the iTunes folder to your computer. Hold down the option key while launching iTunes on your Mac. Select the library you just copied when it ask you to select which library you want to open.

  • TS2313 Recently downloaded the new podcast app, but does not play offline. Can anyone help.

    Recently downloaded the new podcast app, but does not play offline. Can anyone help? Thank you.

    Hey Karenfromanamosa,
    I fixed this problem by turning off the ipad and then turning it back on after 5-10 minutes.
    Hopefully then when you play a video it will start playing.

  • New Line Item to be created in sale order

    Hi,
    Client requires a new line item to be created in sale order for particular regions only..
    Scenario 1 :
    For a particular region Additional Tax shud be calculated on Basic Price .
    Scenario 2 :
    For a particular region Cess on Vat need to incorporated.
    Client wants to maintain condition records in Cond Type :UTXJ and also the client shall maintain a 2 different Tax Codes for above each scenarios,  In future in case Additional Tax or Cess on Vat is applicable to other regions it shud get posted in their respective G/L's
    Plz suggest...
    Thanx...

    It would be wonderful had you shared your suggestion in this forum itself rather sending to personal mail ids which is against the rules and regulations of this forum.
    I request you to dont do that please.

  • List data validation failed when creating a new list item but does not fail when editing an existing item

    Dear SharePoint Experts,
    Please help.
    Why does my simple formula work in Excel but not-work in SharePoint?
    Why does this formula...
    =IF([Request Type]="Review",(IF(ISBLANK([Request Date]),FALSE,TRUE)),TRUE)
    ...work in Excel but fail when I try to use it in SharePoint?
    The intent of this formula is the following...
    If the field "Request Type" has the value "Review" and the field "Request Data" is blank then show FALSE, otherwise show TRUE.
    SharePoint saves the formula, but when a list item is saved where the formula is implemented, (under List Settings, List Validation), SharePoint does not, say anything other than that the formula failed.
    Note that the "list data validation failed" error only happens when I am creating a new item-- the formula above works just fine when one is trying to Save on the edit form. 
    Can you help?
    Thanks.
    -- Mark Kamoski

    Dear Jason,
    I appreciate your efforts.
    However, it seems to me that this statement of yours is not correct...
    "If it meet the validation formula, then you can new or edit the item, otherwise, it will throw the 'list data validation failed' error, it is by design".
    I believe this is NOT the answer for the following reasons.
    When I create a new item and click Save, the validation error is "list data validation failed".
    When I edit an existing item and click Save, the validation error is "my custom error message" and this is, I believe, the way it needs to work each time.
    I think, at the core, the error my formula does not handle some condition of null or blank or other default value.
    I tried a forumla that casts the date back to a string, and then checked the string for a default value, but that did not work.
    I tried looking up the Correlation ID in the ULS when "list data validation failed" occurs, but that gave no useful information because, even though logging was set to Verbose, the stack trace in the error log was truncated and did not given any
    good details.
    However, it seems to me that SharePoint 2013 is not well-suited for complex validation rules, because...
    SharePoint 2013 list-level validation (NOT column-level validation) allows only 1 input for all the multi-field validation formulas in a given list-- so, if I had more than 1 multi-field validation rule to implement on a given list, it would need to be packed
    into that single-line-of-code forumla style, like Excel does. That is not practice to write, debug, or maintain.
    SharePoint 2013 list-level validation only allows 1 block of text for all such multi-field validation rules. So that will not work because I would have something like "Validation failed for one or more of the following reasons-- withdrawal cannot exceed
    available balance, date-of-birth cannot be after date-of-death,... etc". That will not work for me.
    The real and awesome solution would simply be enhancing SP 2013 so that column-level validation forumlas are able to reference other columns.
    But, for now, my workaround solution is to use JavaScript and jQuery, hook the onclick handler on the Save button, and that works good. The only problem, is that the jQuery validation rules run before any of the column-level rules created  with OOTB
    SP 2013. So, in some cases, there is an extra click for the enduser.
    Thanks,
    Mark Kamoski
    -- Mark Kamoski

  • I change ISP and use ms explorer to set on to new ISP. Internet options has the new ISP address but Firefox does not pick it up and is still using the old ISP. Can find no way to set firefox to new ISP. How do i do it?

    I changed ISP and used ms explorer to set up on to new ISP. Internet options has the new ISP address but Firefox does not pick it up and is still using the old ISP address. Can find no way to set firefox to new ISP address. How do I do it? edit

    -> Tap ALT key or press F10 to show the Menu Bar
    -> go to Tools Menu -> Options -> Advanced -> Network -> Connection section -> click '''Settings...''' button -> change these settings in accordance with Internet Options settings that work on MS Internet Explorer -> click OK
    Check and tell if its working.

  • HT1688 I have a honda civic with USB port which allows play back of my old iPhone 4 and 4s.  With the new iPhone 5 the radio shows the phone is conected but does not show any music content.

    I have a honda civic with USB port which allows play back of my old iPhone 4 and 4s.  With the new iPhone 5 the radio shows the phone is conected but does not show any music content.  Any Suggestions?

    You should be syncing your contacts with an app on your computer or cloud service (iCloud, Gmail, Yahoo, etc), and not relying on a backup.  If you haven't been doing this, start now and then restore your old backup.  You will then be able to sync the new contacts back into the phone.  However, you will lose all messages, etc newer thant the backup.

  • Since i have down loaded the new software my wifi does not work I have been to a apple store and they said it is a hard ware issue I do believe it is not my fault has the wifi workded before cheers Ben..

    Since I have down loaded the new software my wifi does not work. I have been to a apple store and they said its a hardware issue. My phone was fine before the down load.

    What is your technical support question for these user to user technical support forums?

  • Currency conversion - Line item total does not tally with account balance

    hi guys!
    we are currently going through currency conversion in Zimbabwe and we are at preparation stage. i have got 3 issues:
    1. while trying to run program RFSEPA02 the following error is appearing-
       -Line item total does not tally with account balance
    2. i might need to retrieve some FI documents whic were archived. how do i retrieve archived documents
    3. i might also be required to delete(if its an option) some records so tha line item total will tally with account balance

    put a break-point @
    if t_balance_items_hw[] <> t_balance_account_hw[] or
         t_balance_items_tw[] <> t_balance_account_tw[].
        perform dequeue_account.
        message e099.
    *   Summe der Einzelposten stimmt nicht mit Kontensaldo überein. ->
      endif.
    endform.                               " CHECK_ACCOUNT_BALANCE_2
    and debug y it is getting the error.
    Short text
    Switch On Open Item Management by Changing Master Record
    Description
    This program activates open item (OI) management for a G/L account and makes the necessary changes to documents already posted. These are then displayed afterwards as open items. It does not process the open items any further. In reversed documents especially, it does not reenter clearing data in the document.
    Requirements
    No items can already be archived from this account.
    Caution: Company policy must be in place to ensure that this does not happen.
    Some G/L accounts cannot be managed on an open item basis, especially G/L accounts that are used in account determination for automatic transactions (for example, accounts set up for transactions MVA or VVA, or accounts which are posted to using posting keys set up for account type M).
    Caution: Before making any changes, check that the G/L account can really be managed on an open item basis. If necessary, contact your SAP consultant.
    The account must be blocked from posting since any new documents posted at the same time as converting documents and postings for this account would not be entered.
    Output
    When using the list log, each document that was changed is listed. In addition, the total of the changed BSIS/BSAS entries and the total of the changed documents is listed.
    Regards
    Prabhu
    Message was edited by: Prabhu Peram

  • I have Adobe photoshop cs5. need to update camera raw, cause my camera raw is  2010and does not read my camera,  I went out and downloaded the new one and it does not link to adobe photoshop cs5

    I have moved my Photoshop CS5 to my traveling computer,a Surface Pro 3.  I have photoshop loaded but in trying to look at raw images it says my camera raw does not support the sony alpha 65 which is what I have.  I went out and tried to download the newest raw version and even went out and did a zipfile download and it will not update my current version.  What should I do

    I have 6.0.  Tried to download newest verion and it will not download.  Went out and then downloaded a zipfile and it still will not download, thus cannot look at my raw pictures.
    Thanks, John
    m: gener7 
    Sent: Thursday, December 11, 2014 6:01 PM
    To: JOHN STAHLY
    Subject:  I have Adobe photoshop cs5. need to update camera raw, cause my camera raw is  2010and does not read my camera,  I went out and downloaded the new one and it does not link to adobe photoshop cs5
    I have Adobe photoshop cs5. need to update camera raw, cause my camera raw is  2010and does not read my camera,  I went out and downloaded the new one and it does not link to adobe photoshop cs5
    created by gener7 <https://forums.adobe.com/people/gener7>  in Photoshop General Discussion - View the full discussion <https://forums.adobe.com/message/7007148#7007148>

  • When I click the Editor, it loads but does not open the Editor page. Options?

    When I click the Editor, it loads but does not open the Editor page. Options?

    Try making separate desktop icons for the Editor and Organizer. You can then launch directly. The standard desktop icon is for the welcome screen which often runs in the background or doesn’t shut down properly.
    Start by right-clicking on the desktop and select:
    New >> Shortcut
    Then browse to:
    C:\Program Files\Adobe\Photoshop Elements 13
    Inside the Photoshop Elements 13 folder make sure you select the application (not a shortcut) by scrolling down to the files beginning with the letter P and highlighting ‘PhotoshopElementsEditor’
    Then click next followed by finish.
    You can repeat for the Organizer using the different file path.
    New >> Shortcut
    Then browse to:
    C:\Program Files\Adobe\Elements 13 Organizer
    Highlight ‘PhotoshopElementsOrganizer’
    Then click next, followed by finish.
    Now that you have your separate desktop icons you can delete the one for the welcome screen, if preferred. On Mac try launching directly from Applications. [if not using PSE13 substitute your own version and go to Program Files (x86)]

  • TS1367 My charger connects with my macbook with a very faint green light (not the normal orange light) and can maintain the computer turned on but does not charge the battery.

    My charger connects with my computer with a very faint green light (not the normal orange light) and can maintain the computer turned on but does not charge the battery. The power source to keep it on is the power adapter and that it's "Not charging" on the battery settings. And my charger seems to charge other computers fine.
    The part of my mac where the adapter (L-shaped, magnetic) attaches is a bit damaged - a small piece of the white case/body around the part where the adapter attaches is broken off, but that's just an outer damage.
    I don't know what's wrong with my computer, and if anyone has had a similar experience or knows what's going on, it'd be tremendously helpful!
    Thank you!!

    Hi Christopher,
    Doubtful an upgrade would fix a hardware issue. If you are thinking of upgarding to Lion, best to do all necessary maintenance first.
    Try Resetting the System Management Controller (SMC)
    If that doesn't help try here >  Apple Portables: Troubleshooting MagSafe adapters

  • Visual Studio 2012 SharePoint Project Error : The partial project item type does not have a value for this property

    Hi,
    I am getting this error from visual studio 2012 whenever i try to create the following project types:
    - Workflow Custom activity
    - Web parts
    The error is as mentioned below
    "The partial project item type does not have a value for this property"
    Due to this the when I add above type of items in my project, they show a red cross icon against them.
    Please let me know If have you any solution?

    Hi
    I had same issue. Below is the solution
    Installing
    "Visual Studio 2012 Update 3" usually solves this problem. (You can download it through microsoft's official site at
    "http://www.microsoft.com/en-in/download/details.aspx?id=39305")
    Hansraj Rathva

  • When I change a password, sometimes I get a pop-up asking if I want to save the new password - sometimes it doesn't appear. How can I save the new password if popup does not appear?

    When I change a password, sometimes I get a pop-up asking if I want to save the new password - sometimes it doesn't appear.
    How can I save the new password if popup does not appear?

    The website may be using autocomplete=off to prevent Firefox from saving the name and password.
    You can remove autocomplete=off with a bookmarklet to make Firefox save the name and password.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered
    *Saved Password Editor: https://addons.mozilla.org/firefox/addon/saved-password-editor/

  • I am setting up a new iTunes account and do not have a credit card.  When I am setting the new account up it does NOT give me an option of "none" in lieu of an actual credit card. What do I do?

    I am setting up a new iTunes account and do not have a credit card.  When I am setting the new account up it does NOT give me an option of "none" in lieu of an actual credit card. What do I do?

    How did you create it ? There are instructions on this page for creating a new account (the instructions won't work with existing existing account) without giving credt card details : http://support.apple.com/kb/HT2534
    e.g. if currently logged into an account then log of it, then find a free app in the store, click on its free 'price', and you should then be able to create a new account during the 'buying' process and get 'none' as an option on the payments screen

Maybe you are looking for

  • BlackBerry R900 (UK)

    Hi, just got one of these off eBay and it arrived yesterday. Everything with it, perfect condition, total bargain. I've got an Orange SIM in it now and think it's so cool I actually plan on using it for texting/BBM/email. However: it's not connecting

  • E17-cvs packages

    I have rebuilt e17 packages. If you want to download them using pacman, add this to your pacman.conf: [e17-cvs] Server = http://dreameen.hopto.org:1102/~dreameen/e17/packages I must warn you though...My upload is painfully slow, so it's be better if

  • Can't install Creative Cloud

    I had CC installed as well as Photoshop and Premeir. I had to do a system restore on my computer and it rolled back to a point that was previous to when I had installed CC, etc. I have made sure there is no trace of anything Adobe on PC under all use

  • The application IDVD 4.0 has unexpectedly quit

    After have made my DVD movie everything is working, except for the burning of DVD, because when I press down the Burn button suddenly iDVD 4.0 crash and says " The application iDVD has unexpected quit". Please is anybody there who can help me?

  • Invoice and Credit Memo from ECC to SUS

    Hi Gurus Is it possible to replicate Invoice or a credit Memo from ECC to SUS if the PO was delvired to vendor through SUS. with Regards Manjunath