New item addition with Characteristic Values - BAPI_SALESORDER_CHANGE

Hi,
I need to add new item in existing sales order. The new item to be added is a configurable material, with Characteristic values to be filled. Iam using 'BAPI_SALESORDER_CHANGE' to insert new item. Iam able to insert normal item. The problem is, iam not able to insert the configurable item. BAPI returns a message 'No changes made'.
Code is attached.
  WA_HDRX-UPDATEFLAG = 'U'.
  SELECT MAX( POSNR ) FROM VBAP CLIENT SPECIFIED
  INTO MAX_POSNR
  WHERE MANDT = SY-MANDT AND
        VBELN = I_SORDER.
  TMP_POSNR = MAX_POSNR + 10.
  WA_ITEM-ITM_NUMBER = TMP_POSNR.
  WA_ITEM-MATERIAL   = 'LEFTEYE'.
  WA_ITEM-PLANT      = I_STORE.
  WA_ITEM-SHIP_POINT = I_STORE.
  WA_ITEM-CONFIG_ID  = 'LEFT'.
  WA_ITEM-INST_ID    = 'LEFTEYE'.
  APPEND WA_ITEM TO IT_ITEM.
  WA_ITEMX-ITM_NUMBER = TMP_POSNR.
  WA_ITEMX-UPDATEFLAG = 'I'.
  WA_ITEMX-MATERIAL   = 'X'.
  WA_ITEMX-PLANT      = 'X'.
  WA_ITEMX-SHIP_POINT = 'X'.
  WA_ITEMX-CONFIG_ID  = 'X'.
  WA_ITEMX-INST_ID    = 'X'.
  wa_itemx-ITEM_CATEG = 'X'.
  APPEND WA_ITEMX TO IT_ITEMX.
Schedule lines
  WA_SCHD-ITM_NUMBER = TMP_POSNR.
  WA_SCHD-SCHED_LINE = TMP_POSNR.
  WA_SCHD-REQ_DATE   = SY-DATUM.
  WA_SCHD-REQ_QTY    = 1.
  WA_SCHD-SCHED_TYPE = 'CN'.
  APPEND WA_SCHD TO IT_SCHD.
  WA_SCHDX-ITM_NUMBER = TMP_POSNR.
  WA_SCHDX-SCHED_LINE = TMP_POSNR.
  WA_SCHDX-REQ_DATE   = 'X'.
  WA_SCHDX-REQ_QTY    = 'X'.
  WA_SCHDX-SCHED_TYPE = 'X'.
  APPEND WA_SCHDX TO IT_SCHDX.
characteristic values
  WA_VALUE-CONFIG_ID = 'LEFT'.
  WA_VALUE-INST_ID   = 'LEFTEYE'.
  WA_VALUE-CHARC     = 'PRES_DIST_SPH'.
  WA_VALUE-VALUE     = '3.2'.
  APPEND WA_VALUE TO IT_VALUE.
  WA_INST-CONFIG_ID = 'LEFT'.
  WA_INST-INST_ID   = 'LEFTEYE'.
  WA_INST-OBJ_TYPE  = 'MARA'.
  WA_INST-CLASS_TYPE = '300'.
  WA_INST-OBJ_KEY   = 'LEFTEYE'.
  WA_INST-QUANTITY  = 1.
  APPEND WA_INST TO IT_INST.
  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      SALESDOCUMENT    = SALES_DOC
      ORDER_HEADER_INX = WA_HDRX
      LOGIC_SWITCH     = LS_LOGIC
    TABLES
      RETURN           = IT_RET
      ORDER_ITEM_IN    = IT_ITEM
      ORDER_ITEM_INX   = IT_ITEMX
      SCHEDULE_LINES   = IT_SCHD
      SCHEDULE_LINESX  = IT_SCHDX
      ORDER_CFGS_INST  = IT_INST
      ORDER_CFGS_VALUE = IT_VALUE.
Where iam missing ?
Any input would be helpfull.
regards,
Nagarajan.J

Hi,
Iam now able to insert configurable item in existing sales order. But the characteristic values are not getting stored.
Latest code is attached. What else is missing for storing characteristic values ?
select maximum item number in sales order
  SELECT MAX( POSNR ) FROM VBAP CLIENT SPECIFIED
  INTO MAX_POSNR
  WHERE MANDT = SY-MANDT AND
        VBELN = I_SORDER.
calc next item number
  TMP_POSNR = MAX_POSNR + 10.
header data
  WA_HDRX-UPDATEFLAG = 'U'.          "update
  SALES_DOC          = I_SORDER.
item data
  WA_ITEM-ITM_NUMBER = TMP_POSNR.
  WA_ITEM-MATERIAL   = 'LEFTEYE'.
  WA_ITEM-PLANT      = I_STORE.
  WA_ITEM-SHIP_POINT = I_STORE.
  APPEND WA_ITEM TO IT_ITEM.
  WA_ITEMX-ITM_NUMBER = TMP_POSNR.
  WA_ITEMX-UPDATEFLAG = 'I'.          "add
  WA_ITEMX-MATERIAL   = 'X'.
  WA_ITEMX-PLANT      = 'X'.
  WA_ITEMX-SHIP_POINT = 'X'.
  APPEND WA_ITEMX TO IT_ITEMX.
Schedule lines
  WA_SCHD-ITM_NUMBER = TMP_POSNR.
  WA_SCHD-SCHED_LINE = TMP_POSNR.
  WA_SCHD-REQ_DATE   = SY-DATUM.
  WA_SCHD-REQ_QTY    = 1.
  WA_SCHD-SCHED_TYPE = 'CN'.
  APPEND WA_SCHD TO IT_SCHD.
  WA_SCHDX-ITM_NUMBER = TMP_POSNR.
  WA_SCHDX-SCHED_LINE = TMP_POSNR.
  WA_SCHDX-REQ_DATE   = 'X'.
  WA_SCHDX-REQ_QTY    = 'X'.
  WA_SCHDX-SCHED_TYPE = 'X'.
  APPEND WA_SCHDX TO IT_SCHDX.
config & characteristic values
  WA_VALUE-CONFIG_ID = '000001'.
  WA_VALUE-INST_ID   = '00000001'.
  WA_VALUE-CHARC     = 'PRES_DIST_SPH'.
  WA_VALUE-VALUE     = '3.2'.
  APPEND WA_VALUE TO IT_VALUE.
  WA_INST-CONFIG_ID     = '000001'.
  WA_INST-INST_ID       = '00000001'.
  WA_INST-OBJ_TYPE      = 'MARA'.
  WA_INST-CLASS_TYPE    = '300'.
  WA_INST-OBJ_KEY       = 'LEFTEYE'.
  WA_INST-QUANTITY      = 1.
  WA_INST-QUANTITY_UNIT = 'NO'.
  APPEND WA_INST TO IT_INST.
  WA_REF-POSEX     = TMP_POSNR.
  WA_REF-CONFIG_ID = '000001'.
  WA_REF-ROOT_ID   = '00000001'.
  APPEND WA_REF TO IT_REF.
  WA_PART-CONFIG_ID  = '000001'.
  WA_PART-PARENT_ID  = '00000001'.
  WA_PART-INST_ID    = '00000001'.
  WA_PART-OBJ_TYPE   = 'MARA'.
  WA_PART-CLASS_TYPE = '300'.
  WA_PART-OBJ_KEY    = 'LEFTEYE'.
  APPEND WA_PART TO IT_PART.
  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      SALESDOCUMENT      = SALES_DOC
      ORDER_HEADER_INX   = WA_HDRX
    TABLES
      RETURN             = IT_RET
      ORDER_ITEM_IN      = IT_ITEM
      ORDER_ITEM_INX     = IT_ITEMX
      ORDER_CFGS_REF     = IT_REF
      ORDER_CFGS_PART_OF = IT_PART
      ORDER_CFGS_INST    = IT_INST
      ORDER_CFGS_VALUE   = IT_VALUE
      SCHEDULE_LINES     = IT_SCHD
      SCHEDULE_LINESX    = IT_SCHDX.
  READ TABLE IT_RET INTO WA_RET WITH KEY TYPE = 'E'.
  IF SY-SUBRC = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
  ENDIF.
I get the following messages from BAPI.
ORDER_HEADER_IN has been processed successfully.
ITEM_IN has been processed successfully
The sales document is not yet complete: Edit data
TIL-Direct Sales TINDC01372 has been saved
What else is missing ?  Any help is appreciated.
thanks,
Nagarajan.J

Similar Messages

  • Assign Object to class with characteristic values ?

    Hi All,
    I want to assign object to class with characteristic values. I found CL20N transaction for performing the same. Is there any BDC , BAPI to upload the same.
    Thanks & Regards,
    Navneeth K.

    Hi,
    try as below
        CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            classtext            = 'X'
            classtype            = w_classtype  "Class type
            language             = sy-langu
            object               = w_object     "Object Matnr + Batch
            objecttable          = 'MARA'     "As requirement
            change_service_clf   = 'X'
            inherited_char       = ' '
            change_number        = ' '
          TABLES
            t_class              = t_class
            t_objectdata         = t_objectdata
            i_sel_characteristic = i_sel_characteristic
            t_no_auth_charact    = t_no_auth_charact.
        IF sy-subrc <> 0.
        ENDIF.
    *     Create with reference-----------------------
          w_objectkeynew = wa_inputfile-to_matnr.
          CALL FUNCTION 'BAPI_OBJCL_CREATE'
            EXPORTING
              objectkeynew    = w_objectkeynew
              objecttablenew  = 'MARA'
              classnumnew     = w_classnum
              classtypenew    = w_classtype
            TABLES
              allocvaluesnum  = t_allocvaluesnum
              allocvalueschar = t_allocvalueschar
              allocvaluescurr = t_allocvaluescurr
              return          = t_lreturn.
    "or
    BAPI_OBJCL_CHANGE              Classification BAPI: Change Assignment
    Prabhudas

  • BAPI_SALESORDER_CHANGE with characteristic values

    Hi everyone,
    I am dealing with BAPI_SALESORDER_CHANGE. I have tried to update an item by replacing a certain material for a configurable one, and everything worked fine.
    However, I cannot get the characteristic values are stored in the sales order line.
    I have filled in values in ORDER_CFGS_VALUE & ORDER_CFGS_INST tables this way:
    I guess I am dpig something wrong but I cannot fin the reason.
    3GAA100 is the name of my configurable material.
    Could someone please explain me the difference between the fields WA_VALUE-CONFIG_ID and WA_VALUE-INST_ID?
    Am I filling some field with a no suitable value?
    Characteristic values
    WA_VALUE-CONFIG_ID = '3GAA100'.
    WA_VALUE-INST_ID = '3GAA100'.
    WA_VALUE-CHARC = 'M_001'.
    WA_VALUE-VALUE = '1'.
    APPEND WA_VALUE TO IT_VALUE.
    WA_INST-CONFIG_ID = 'LEFT'.
    WA_INST-INST_ID = '3GAA100'.
    WA_INST-OBJ_TYPE = 'MARA'.
    WA_INST-CLASS_TYPE = '300'.
    WA_INST-OBJ_KEY = 'LEFTEYE'.
    WA_INST-QUANTITY = 1.
    APPEND WA_INST TO IT_INST.
    I would be very greateful if someone could help me.
    Thanks a lot in advance and best regards.
    Ben.

    Hi everyone,
    I am dealing with BAPI_SALESORDER_CHANGE. I have tried to update an item by replacing a certain material for a configurable one, and everything worked fine.
    However, I cannot get the characteristic values are stored in the sales order line.
    I have filled in values in ORDER_CFGS_VALUE & ORDER_CFGS_INST tables this way:
    I guess I am dpig something wrong but I cannot fin the reason.
    3GAA100 is the name of my configurable material.
    Could someone please explain me the difference between the fields WA_VALUE-CONFIG_ID and WA_VALUE-INST_ID?
    Am I filling some field with a no suitable value?
    Characteristic values
    WA_VALUE-CONFIG_ID = '3GAA100'.
    WA_VALUE-INST_ID = '3GAA100'.
    WA_VALUE-CHARC = 'M_001'.
    WA_VALUE-VALUE = '1'.
    APPEND WA_VALUE TO IT_VALUE.
    WA_INST-CONFIG_ID = 'LEFT'.
    WA_INST-INST_ID = '3GAA100'.
    WA_INST-OBJ_TYPE = 'MARA'.
    WA_INST-CLASS_TYPE = '300'.
    WA_INST-OBJ_KEY = 'LEFTEYE'.
    WA_INST-QUANTITY = 1.
    APPEND WA_INST TO IT_INST.
    I would be very greateful if someone could help me.
    Thanks a lot in advance and best regards.
    Ben.

  • Report on Open Items along with Qty & Value for LA confirmed items

    Hi,
    I would like to know a report of Open POs(No Goods receipt made) but LA confirmed Items along with Values(Amount)
    i.e
    List of confirmed,unsent items along with Values for plant wise or vendor wise or PO Number wise.
    Regards,
    Vengat

    Hi,
    Any other inputs?
    Our client's requirement is to know how many (Both Qty & Value) of items for the input LA confirmed(ASN received) but no GR Made
    Regards,
    Vengat

  • Fields relevant for printouts changes for PO for New item addition

    Hi,
    We have configured Fields relevant for printouts changes for purchase
    order, it is working for all relevant fields except New line item
    addition in the Purchase order.
    This was working fine before EHP4 patch upgrade, after that the field
    was disappeared in configuration.
    Thanks in advance,
    Vinod

    Hi: looking for same functionality, were you able to fix this issue? Thanks.
    Daniel G.
    Skyworks Inc

  • Multiple line items one with default values

    Hi All
    We have a flat file coming into xi that needs to be mapped to an idoc, the idoc will have multiple line items.
    The first line item must have default values but the from the second line item and on must have dynamic value from file? How Can this be achieved?
    Regards

    Hi,
    I didnt get the the exact prb you have been facing...
    But from my understabding,
    Try giving constants for the default values of first Line Item.
    Then, directly map the file data to the second line items onwards..
    Regards,
    Swetha,

  • Transaction Notification for Restrict user to delere row but new item addition will allowed in Production Order

    Dear All Experts,
    My client having some custom requirement in Production Order.
    1) When Production Order will created and its status will released then it will allowed user to update any quantity of any items or add any new items but it will not allowed to delete any items from row level.
    2) When any item will be deleted then our transaction notification will be raised.
    I created one Transaction Notification Code but it will restricted to update anything or delete.
    IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '202'
    BEGIN
    Declare @VisOrder1 nvarchar(255)
    Set @VisOrder1=(SELECT Top 1 T1.VisOrder+1 FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry 
    WHERE (T0.Status = 'R' and T1.VisOrder=(select TOP 1 VisOrder from wor1 where DocEntry=@list_of_cols_val_tab_del order by VisOrder Desc)))
      If @VisOrder1 >0
      begin
      SET @error = 231
      SET @error_message =  'You have not rights to delete any Item - Please Contact System Administrator ' + @VisOrder1
      end
    END
    Please help me for solve this problem.
    I wait for your warm replay.
    Thanks & Regards,
    Nishit Makadia

    Hi,
    Please check these threads. Let me know your feedback.
    http://scn.sap.com/thread/3518208
    http://scn.sap.com/thread/3545101
    Thanks & Regards,
    Nagarajan

  • New consolidation group with wrong values

    Hi all,
    We are working with SEM-BCS 6.0 and we are having an issue that we hope you can help us.
    At 012.2008 we have created a new consolidation group (N002) with the consolidation unit 0100.
    This consolidation unit (0100) also exists in consolidation group (H001) since 006.2008.
    The problem is that at 012.2008 when we use the posting logic u201Cstandardu201D the account values are correct in the consolidation group that used to exist (H001), but for the new consolidation group (N002) the account values are only the delta values.
    For example:
    011.2008
    Account 111000 = 50.000u20AC
    012.2008
    Account 111000= 60.000u20AC
    At 012.2008 in the consolidation group (H001) we have the 60.000u20AC but in the consolidation group N002 the account only has 10.000u20AC (delta)
    But if the new consolidation group (N002) only exists since 012.2008 and for the consolidation unit 0100 the first consolidation is defined as 012.2008 why is only being considered the delta (10.000u20AC) and not the all value (60.000u20AC)?
    Thanks for your help.
    Best regards

    We are using the cumulative type of data storing.
    Sorry, you can't. It's the system that always stores data periodically. You may just load data cumulatively.
    Regardless of type of your load data in the system is always kept periodically.
    > The reason for the appearance of this company in another group is only because they want to do a u201Csecondu201D consolidation considering a different group of companies by consolidation area.
    > That is, they want to consolidate both consolidation groups with the same companies but with them being considered differently by consolidation areas.
    > Is like the second consolidation group is a simulation.
    Sorry, Ricardo, I cannot read it in business terms. Different hierarchies, dif. ConsAreas, dif. groups... I do not see why and what for.

  • Establishing new shortcut keys WITH coordinate values

    Hello,
    I don't know if it's possible, but I am trying to make a shortcut key that will let me move a text box to a specific place. I have a bunch of text boxes on each page, and I want to move each one to a specific area. Going to the transform window and entering the X and Y coordinates is time consuming, so I would like to make shortcut keys I could use for the text boxes. I've looked at the shortcut keys and couldn't find a place where I could enter X and Y coordinates.
    Unfortunately when I started out on this project, I didn't know much about InDesign and I disassociated all the text boxes from the master page (yup, went and did it over the course of 2 hours, boy do I regret that now!) otherwise I'd just move the boxes on the master page.
    For example, I'd like to move a box from it's current position to
    X: 23.44 mm
    Y; 243.00 mm
    Or, if there is an easier way to do this without using shortcut keys, I'd appreciate any help.

    I still get an error message. I copied Gerald's script exactly as it appears above, and the error message says "bad argument move" line 2.
    Sorry to not get this, but I really have no idea how the script Gerald gave me should appear. Should the entire thing be on one line, should the spaces appear exactly as he has them??? I copied and pasted it in just as it appears below - the same form as above:
    for (n=0; n<app.selection.length; n++) {
    app.selection[n].move([23.44, 100.05]);
    Maybe there was some slight adjustment I should have made? Please bear with me, I want to get this right, sorry if I am missing something that everyone else already knows.
    I was able to get the "helloworld" script from the tutorial to work, btw, so I know that there isn't some glitch keeping me from executing scripts.

  • DVWP with Multiple Item Form duplicates values on the screen on new item

    Hello,
    I have created a custom page in SPD called Submit.aspx. I have 3 custom lists (A,B and C). On that page I have two list webparts (from list A and B) and one multiple item form DVWP (list C). I have edited the list webparts to display the Add new item link only.
    Sometimes when a user adds a new item numerical values are duplicated on the screen from the item below (see the screenshot). It happens only on the screen. When a user saves the form or refreshes it the values disappear. How can I fix this to not duplicate
    the values when a new item is created. Projects on the list are sorted alphabetically. The item before the last one on the screenshot is the new item that has identical values as the last item. On save or refresh duplicate values
    disappear from a new item.

    Hi LetMe, it would be difficult for anyone to help you with the amount of customization you've done, unless you provide the code for us to check.
    cameron rautmann

  • Images with news items appearing as blanks

    I am using BT Yahoo - Mozilla Firefox with Windows XP professional and Service Pack 2. There is a news section on the home page but any news item accompanied with still images (e.g Chinese New Year Celebrations on Jan 22)the images are blanked out. I have tried the solution provided by cor-el but it failed.

    You can use these steps to check if images are blocked:
    *Open the web page that has the images missing in a browser tab.
    *Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    *Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    *Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    *Select the first image link and scroll down through the list with the Down arrow key.
    *If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.
    See also:
    *http://kb.mozillazine.org/Images_or_animations_do_not_load
    *https://support.mozilla.org/kb/Images+or+animations+do+not+show

  • E-Mail Notification with https link to new item

    Hi all,
    we have a vibe 3.4 system and want to use the e-mail notification features so all in our team will get those status messages.
    Generally this feature works and we get mail. The problem is that the links in the mail to the new item starts with http://... not https:/xxx.
    How can this be configured so the links use secure https to the items??
    kind regards,
    Martin

    Hi Martin,
    Does your system already use secure HTTP urls(HTTPS) when anyone accesses the site? If yes, then for emails you just need to configure at one place. Follow the steps below (but make sure to take proper backups before you do. I am just extracting the steps mentioned in Vibe Documentation, which can be read online as well here https://www.novell.com/documentation.../bju0gr2.html#. If all the configurations are made already, then just scroll down to the section: Defaulting to Secure HTTP URLs in E-Mail Notifications)
    Defaulting to Secure HTTP URLs in E-Mail Notifications
    When an e-mail notification is sent from Vibe, Vibe includes a URL to the location on the Vibe site where the notification was sent. By default, the URLs in e-mail notifications are formed with http rather than https. You can reconfigure Vibe to default to https for Vibe site URLs.
    Log in to the Vibe server with sufficient rights to edit the ssf-ext.properties file (root on Linux, Administrator on Windows).
    Change to the following directory:
    Linux:
    /opt/novell/teaming/apache-tomcat/
    webapps/ssf/WEB-INF/classes/config
    Windows:
    c:\Program Files\Novell\Teaming\apache-tomcat\
    webapps\ssf\WEB-INF\classes/config
    Open the ssf.properties file in a text editor.
    Locate and copy the following line:
    ssf.secure.links.in.email=false
    Close the ssf.properties file without saving.
    Make a backup copy of the ssf-ext.properties file, located in the same directory with the ssf.properties file.
    Open the ssf-ext.properties file in a text editor.
    Paste the line that you copied in Step 4 to the bottom of the file:
    ssf.secure.links.in.email=false
    Change false to true so that the line now looks like this:
    ssf.secure.links.in.email=true
    Save the ssf-ext.properties file, then exit the text editor
    Restart Vibe to put the change into effect.
    All system-generated e-mail notifications now default to secure HTTP URLs. However, all user-generated e-mails from the Vibe system follow the current users context. For example, if a user is logged in as HTTP and chooses to share an entry with another user, the link in the e-mail notification uses HTTP.
    Regards,
    Saad.

  • Condition type value updation using characteristic value in sales order

    Hi Experts,
    We are implementing SAP for one of our Spain client. In that one of the Legal requirements is, whenever they are selling the finished products to domestic customers who contain OIL as one of the component then, some additional cost needs to be calculated and collected from customer and which needs to be paid back to Spain Government every month on Region basis.
           If OIL is not a component to produce the finished product then, not required to charge the customer additionally.
    The OIL content used to produce every finished product will vary based on product characteristic value. Meaning, for some finished product the OIL used will be 2.2 KG and for some products it will be 3.5, 4.3 KG and etc.
    Since various combinations of products are available for the client, during sales order creation we are planning to update some special characteristic which the data flow from u201CVariant Tableu201D. In the variant table we are going to maintain the OIL Quantity required making finished product.
    But we are not sure how to activate a new condition type with the value fetched in the special characteristic. This new condition type needs to be activated based on this characteristic value and multiplied with total order quantity and price to charge from customer.
    Example, the special characteristic fetched the value of 2.2 KG based on variant table. Total Order quantity is 10 PC and charge is 0.06 EURO per KG. in this case, (2.2 x 10 ) x 0.06 EURO = 1.32 EURO
    I need the expert opinion how to activate the new condition type based on characteristic value and achieve the above requirement.
    Thanks in advance.
    Warm Regards,
    VEL

    Hello,
    I have replicated the whole requirememt in IDES and getting the price calculation as needed but the only issue with the Conversion factor for the condition type. Either you need to maintian the conv factor in material master or need to enter manually for the condition type in SO. Some how you have to maintain the conversion factor to calculate the price for the condition type in different unit.
    For easy of understanding Lets make the whole requirement in 2 parts
    Part - 1
    Oil qty calculation. For convenience sake I have taken oil qty also in TO
    1) Created a num char OIL_QTY1 with length 9 and decimal places 5 and UOM as TO
    2) Created Variant table to infer the OIL qty in TO per piece of finished prod ( This oil qty data may be depends on various factors). For certain Finished products the oil qty may be 0 or blank
    3) Created a REF char SO_QTY  to pull the SO qty to configuration and add this char in class 300(Table:VBAP,Field :KWMENG)
    4) Created another char SO_OIL_QTY  (Num with length 9 and decimal places 5 and UOM as TO)
    5) Created a PROCEDURE say PROC_SO_OIL_QTY with code
    *$self.SO_OIL_QTY = $self.OIL_QTY1 * $self.SO_QTY*
    6) Create another PROCEDURE as mentioned earlier with modified code
    $SELF.A_VARCOND = 'TEST_001' if OIL_QTY1 specified,
    $SET_PRICING_FACTOR ($SELF,A_VARCOND,'TEST_001', SO_OIL_QTY)
    Note: Maintain proper seq of the procedures in profile. The Qty cal proc should be before the price related procedures.
    PART-2
    1) For the condition type maintained 60 EUR per TO (0.06 EUR per KG)
    Now if you create SO for the Finished product of 10 PC
    the Char values will be
    OIL_QTY1  = 0.00022 TO (inferred from Variant table th proc)
    SO_QTY    = 10
    SO_OIL_QTY = 0.0022 TO
    Get into conditions tab
    Here Condition type ZSIG will be displayed as error with Amount 60 EUR per TO and condition value will be blank. Just enter value 1 in the col NumC and CCon fields.
    Now the Condition value will appear as 1.32 EUR.
    Hope this gives some more clarity
    Regards
    Brahmaji D

  • Adding item positions with reference to contract in sales order

    Hi all,
    I would be very grateful if some of you could help on this:
    I have a requirement to add lines with reference to a contract while the user is creating or modificating it via VA01 or VA02. The logic flow will be as follows:
    if the user enters a new item position with reference to a contract, and the qty entered exceeds the qty in the position selected of the contract, we have to skip the standard error message and try to spli the quantities in several positions with the same material in the contract.
    As an example:
    the contract 000000000001 has 5 lines:
    line     material       qty
    01       mat1           100
    02       mat1           50
    03       mat1           50
    04       mat2           n/a
    05       mat2           n/a
    if the user picks up the line 02 of the contract to create a new line in the sales order, and enters 180 as qty, the sap standard will raise an error, saying the qty has exceeded the contract qty. Ok, we have to skip that error (maybe could we set it as a warning??) and 'split' the qty as follows:
    in the sales orders, 3 lines will be created automatically
    line    material     qty
         mat1         100
         mat1         50
         mat1         30
    and of course, the released quantities in the contract must be updated: i.e the contract should be as follows:
    line     material       available qty
    01       mat1           0
    02       mat1           0
    03       mat1           20
    Any ideas? : )
    What i've done by the moment is to check is that 'split' is possible, in userexit_save_document. If not (e.g. if the user enters 220 for mat1 in the previous example), a custom error will appear. If it is possible, then the sales order will be created (only with the line the uswer entered) and I will trigger somehow a FM processed in background to modify the sales order.
    my question now is: how can i add lines to the created sales order, making reference to some contract lines?
    I've seen BAPI BAPI_SALESORDER_CREATEFROMDAT2 is used to create a document with reference, but can i use it to MODIFY an existing sales order?
    any help would be greatly appreciated.
    thanks a lot for your help.
    regards.

    Hello,
    there's a function module called 'BAPI_SALESORDER_CHANGE', which could change a sales order. The problem could be,that these BAPI's enque the salesorder. So if you start them in background via an userexit, you have to be sure that the salesorder is updated and dequeued by posting.
    An other way could be to use the exit 'userexit_check_vbap' in MV45AFZB. It's called after creating a new position or changing a position. All existing positions at that time in a internal table 'XVBAP', which you could change. (But be carefull, that you don't create an endless loop !).  
    The check about the contract quantity is in a form routine called 'vbep-wmeng_pruefen_folgebeleg(sapfv45e)'.
    Have a look into the form 'vbap_pruefen_ende' in FV45PFAP_VBAP_PRUEFEN_ENDE. There's the whole thing done including the call of the userexit.
    Regards Wolfgang

  • Update item characteristic values using BAPI_SALESORDER_CHANGE

    Hi Experts,
    Could anyone give me sample code on how to update the characteristic values of a sales order item? Points will be awarded... Thanks!
    Regards,
    LM

    Just checked on OSS note 549563 regarding this. This is resolved. Thanks

Maybe you are looking for

  • Syncronize excel to Sharepoint list (i.e. a site calendar)

    Hi I need some help relating to syncing an excel sheet saved on sharepoint to a calendar on the same sharepoint site. What I have is as follows: 1. A project site with an excel sheet save in a document app. 2. A Calendar on the project site. That exc

  • What's new in kde4.4?

    As a long time kde user I was bewildered by some of the things that hit me when I fired up kde4.4. To kick the changes off I was impressed by the new netbook setup which one call up seemlessly and which relies on the new search and launch activity: s

  • IPhone 4S update to iOS 5.1 singal and battery issues

    Hi, I was on 5.0.1 and had no issues at all loved the phone and my battery life. Eversince I updated to 5.1 my phone signal is awful, 2 bars when I had 5 before, constantly floating, calls drop for no reason. Yesterday nobody was able to reach me unt

  • Import photos from iphone to pc without the use of icloud

    Hi all, before it was so easy to import photos to my pc, now trying to backup my photos via icloud is quite impossible as i've followed all the instructions and backed it up however i cannot find it. it is meant to be saved in my pictures then there'

  • "......." did not respond or cancelled the connection

    I keep getting this error message and I don't know what to do about it. I just got a MacBook Pro and my girlfriend just got a MacBook and we have been trying to chat with no luck. I have changed my port to 443 and changed streaming to 1.5 MPS and she