How to show logic of picking multiple stores to fulfill an order line item

I'm still learning some basics with OPA.
How do I represent the logic of picking multiple stores to fulfill an order line item when no one store has the requested quantity? A concrete example would be greatly appreciated as I'm still thinking procedurally for solutions.

Hi!
I believe this is following on from the thread:
Calculating least cost of a product across stores using OPA
So I'm assuming we're using a similar data model.
If we want to involve quantity as well as cheapest price, then I'm assuming the requirement is:
Find the cheapest price for the product from all the stores which still have quantity left of that product.
This is where inferred relationships come in handy.
Here is an example of what you can do with them to help solve this requirement.
the store is a member of the product's stores if
.ExistsScope(the store's prices)
..the price's product name = the product name
the store is a member of the product's stores with remaining stock if
.the store is a member of the product's stores and
..ExistsScope(the store's quantities)
...the quantity's product name = the product name and
...the quantity's amount > 0
Then we basically want to pick the cheapest price for the product from the members of the relationship "the product's stores with remaining stock"
Note that "the product's stores with remaining stock" could obviously be many instances, all with different prices. But for an order, a product needs to come from only one place! The deciding factor to "pinpoint" one place from this potential list of many could be based on anything, such as location, sales ranking, etc. But in this case Im going to assume lowest price is the decider.
In the previous post we created a simple relationship between "the product" and "the prices" (which are contained by the store).
We can make a more powerful relationship now:
the price is a member of the product's available prices if
ForScope(the price's store, the main store)
.the main store is a member of the product's stores with remaining stock
(I'm using an alias here to be 100% sure of which store is in scope)
Now we can use the rules in the previous post, but change the relationship to the more advanced one we just created:
the product's cheapest available price = InstanceMin(the product's available prices, the price's amount)
Then
the product's cheapest available store name = InstanceValueIf(the product's available prices, the price's store name, the price's amount = the product's cheapest available price)
This is all psuedo code so many need some slight tweaks when you put it into OPM. Make sure you set up the relationships in a property file and declare all the attributes etc.
Inferred relationships are really useful as "filters" sometimes. Here we first filtered all the stores which have prices for the product (i.e. have it in their catalogue). Then we filtered to get a list of all the stores which have stock remaining for the product. From that, we could find the cheapest available price.
This is by no means the only way to do it! It's also by no means a simple problem but the great thing about OPA is that you can put all of the relationship config rules in the system rule folder / word doc, meaning that the source / business rules can still look relatively simple (in the end, it only took 2 lines of source rules to find the cheapest available price!). Once you've got the right set up and invested time in designing your data model, you will find it much easier to solve seemingly complex problems across entities.
One word of warning though: if you have thousands of instances of prices, stores, products etc. then there is a performance impact of using many inferred relationships and alternatives should also be considered.
Hope this helps!
Feel free to contact me for more help on this. If you are relatively new to OPA and trying to tackle this you should consider investing in some training.
Cheers,
Ben

Similar Messages

  • Posting multiple invoices against single purchase order line item

    Hi,
    We receive invoices on completion of certain milestones and Goods receipt is done when the final lot of material is delivered.  For example the purchase order may be to deliver 1 quantity of Machine.  Material is supplied in bits like Gear Box, Engine and body.  Invoice is received when Gear Box, Engine is supplied. Final invoicing is received on completion of delivery (taking into account what has already been delivered)
    Goods Receipt in SAP needs to be posted only once when complete machinery is delivered (the tracking for different parts delivered is done outside SAP).  However, the multiple invoice needs to be posted in SAP referring to same PO item (Please note PO quantity for complete assembled material is only 1).
    This needs to be treated as material and not service in SAP.  Can you please suggest how to book multiple invoices for same purchase order line item?
    Thanks

    Hi Charan
    Thanks for your reply.  However, both the options are not feasible.  Invoices can be received in different periods, sometimes over different months or years, hence needs to be booked immediately.
    Also, i cannot create material master for each component as the quantity for the final material is only 1.
    Any other alternatives?
    regards
    Sameer

  • Availability Check at Multiple Plants for the Sales Order line Item.

    Hi Friends,
    We are having two plants, Plant A and Plant B. Plant A is used to issue the orders to the vendors and stock them, while Plant B is used to manufacture the Product and Stock.
    When we create the sales order, we want to check the Current Stock Plus Incomming Purchase order stock for plant A and also check current stock plus Production orders in plant B.
    for ex if the current stock is 100 in Plant A and No physical stock in Plant B but there are some production orders for 400 Qty which will be ready in 1 week.
    If i create a sales order for 500 qty which is scheduled for delivery 10 days later.  then we want to commit to the customer ( Looking at both the plants stock situation )  the system should check the stock availability for both the plants and automatically create two different line items , Line item 1 for plant A and line item 2 for plant b.
    I know there is a user exit for Multiple plant selection USEREXIT_PLANT_SELECTION  in program RV03VFZZ. The Description of the USer exit says ( This user exit may be used to provide a list of plants for which availability is to be checked)  But we have never used this one. Will this user exit do exactly what i want ??
    Did any of you, have used the above User exit in your implementations ? If so please let me know whats the purpose of this user exit
    Your reply is much appreciated.
    Thanks & Regards
    Srinivas

    Hi
    I dont know about the userexit which you are referring about
    But this is not available in R3 The system makes a Availability Check only in the plant which has got determined in the item details shipping tab and stops there
    The same is available in APO
    If there are 2 plants say 1000 and 2000
    In sales order the plant determined is 1000 and there is no stock
    In R3 system stops there
    But in APO  system checks the plant 2000 and if stocks are available it creates an STO in the background automatically from 2000 to 1000 if configured accordingly
    Even if the material is maintained in 10 plants the system will make a  Availability Check at all 10 plants and act accordingly
    Regards
    Raja

  • How to delete or activate the deletion flag for the sales order line item

    Hi All,
    I  have one Cust order & with referance to that cust order one production order is created . The production order user has done the Goods issue with 261 movement type  & GR wi 101 before 4 months back , & he has reverse  the GR  with 102 on todays date . but in materila master the  variable prize is maintain thats why it is showing  a differance in the cost .
    User want to delete the Production order as well as the custemer order From MDO4 , So we have make the Production order TECO & save , it is gone form the MD04 but the Custumer order still there . It is not allow us to cancell or reject . We have tried to maintain the reason for rejection but it showing the message that you can not activate the deletion flag for the order .
    Could you please Help me to find out the way how can i delete the custemer order ?
    Thanks In advance
    Regards
    Piyush

    W ehave Settele that order & then activate the deletion flag for the order & then cancel the sales order.

  • Multiple Payors for One Order Line item. Is it possible?

    Hello SD Gurus
    I am trying to see if SAP allows inputting multiple payors for each sales order line item? We have a requirements, where the net value at the line item level will be split up in 1 to 4 payors and then we need to generate the invoices seperately for each of the payors based upon the dollar amount allocated.
    If you have come across such scenario please let me know to accomodate such requirements.
    Thanks much
    Jai

    Hi Aj
    Thanks for your quick response. I was think on the same lines and you have confirmed that we will have to split the line into several lines on sales order.
    I am trying to do that now in our ECC box i.e item 10 with payer 1 and item 2 with payer 2. But as soon as I try to change the payer on item 2, i get the following error message which relates to credit management being active.
    I am assuming once we decativate CM, we should be good to go. PLease confirm. Also once its time for billing, will SAP automatically split the billing into different invoices per sales order line item based upon number of payers on the line items?
    PLease confirm your thoughts.
    Regards
    Jai

  • How to set Confrimed quantity as 0 in the sales order line item

    hi all
    i have a requirement that my user dont want to see confirmed quantity in the sales order line item.
    scenario is make to order.
    i have set strategy group is 20 -make to order
                                            MRP Type is PD
                                           Lot size -
    EX , still its showing confirmed quantity.
    could pls any one tell me how to set 0 quantity in the sales order line item
    thnx

    Dear Sateesh,
    If the availability check is carried out and stock is not there in our plant, then it will show the confirmed quantity as Zero.
    If you don't want to carry out the availability check,
    To achieve this,
    1. Remove the availability check in the transaction OVZG against your requirement class.
    You can find the requirement type assigned to the sale order in the procurement tab.
    In OVZH transaction, you can find the requirement class assigned to your requirement type.
    2. Remove the availability check for your schedule line category in VOV6.
    In the material master MRP3 view, you ll be having Availability check, there you need to specify the availability check..
    If you specify it as KP(No check), then it will confirm the qty, though the stock is not there in our plant..
    To meet your requirement, you have to prefer user exit.(Correct me if I am wrong)
    Thanks,
    Venkatesh.S.P

  • How to upload sales order line items?

    SAPGurus,
    For years my customer service department has been asking for a way to upload sales order line items into the VA01 sales order-entry screen.
    Many of our customers submit PO's with huge amount of line items, up to 1,000 lines. Our CS reps need to key in the data line by line (or copy/paste
    approx 17 lines at once from Excel into the VA01 screen), and we are looking for a way to make this process leaner. One idea we have is that user creates the order header, and then has a way to upload the material numbers and quantities in a separate (newly created Z-transaction) screen in one go.
    Obviously rules then need to be built that deal with the various pop-up messages related to e.g. ATP, material status, etc.
    Does anyone have any experience or thoughts on how we could achieve this? A way to make the sales order-entry process a bit less time-consuming? Any feedback would be greatly appreciated !
    Thank you,
    RVS

    Take the inputs from this Blog created by  SUNIL PILLAI                   
    Sales Documents upload  using Standard Direct Input Program in LSMW
    G. Lakshmipathi

  • How to Find Out The Production Order Number For The Sales Order Line Items

    Hi All,
    I want to know the number of production orders for each sales order line item. I know the sales order number .Can anyone tell me how the tables can be linked to get all the production order numbers for each sales order line item.

    I think it depends on your configuration. But check fields KDAUF and KDPOS in table AUFK.  or in table AFPO.
    Regards,
    Rich HEilman

  • One inspection lot for multiple materials of purchase order line items

    Hi All,
    My client requirement is one inspection lot for multiple materials of purchase order line items.
    Please share your thoughts.
    Thanks in advance for early reply.
    Regards,
    Jishu

    I totally agree with Amol.
    I don't think I would touch that development nor would I ever tell a client it could reliably be done through development.
    Knowing what I know about the table structures, I don't think you could create any development for this that could use a significant amount of the existing tables and functionality.  I think you'd have to create all your own Z tables and basically rebuild the functionality.  Tying it back in with SAP data will be difficult.
    You're even looking at all custom screens for your results recording and UD as well.  And if you have follow-on functions like batch classification requirements, batch determination, COA publication, results copy functions, use of DMR and sampling procedures, physical samples, quality notifications, etc. etc.. you could be looking a whole lot of development.
    Craig

  • Which table stores the condition values of a purchase order line item?

    Hi,
    Please let me know the table that stores the condition values of purchase order line items(when we click on conditions tab after selecting an item then we can see the condition types and there is a corresponding condition value for that condition type.
    My requirement is to get the actual price for a purchase order line item(it can be seen in the last line and it is calculated after considering all the condition types) and display this value in a custom report.
    Thanks,
    Ravindra

    Hi Ravindra
    You can find the conditions data for PO in TAble KONV.
    KONV-KSCH is the condition type
    KONV-KWERT is  the cond value
    KONV-KNUMH is the condition doc no. which is there in EKKO field KNUMH.
    So u have to make a link between KONV-KNUMH and EKKO-KNUMH.
    Thanks
    Vijeta

  • How to Import Order Line Items

    Hello,
    My job requires me to key over 50 order line items (per order) and I receive around 400 orders per week. It's pretty tiresome and its not ergonomical.
    I was wondering if there's any way I can "Import" order line items from an Excel sheet, instead. For each line item, there are only 3 columns I key in:
    - Part #
    - Order Qty #
    - Inv. Loc #
    Other required fields (Order UOM, Handling Type, Lead Time Cat., (Publish) List Price, etc.) will then populate automattically.
    My question is whether this is possible?
    Any help will me appreciated. I will then ask the IT department to help implement. Thank you.

    Importing can be done through EIM, but involves some work by Administrators.
    You can also try to do it with an Import Object, but this is not fully supported by Siebel.
    Another option would be through Script.
    More info on Supportweb: How to Create Import Object for Quote Item [ID 863848.1]
    How Can Scripting Be Used to Extract Information From an Excel File and Save the Information in Siebel Objects When Using Thin Client? [ID 798144.1]
    As a last resort you can also add some Visual Basic for Applications (VBA) to the Excel sheet.
    http://it.toolbox.com/blogs/siebel-answers/example-siebel-scripting-through-ms-excel-siebel-data-server-26861

  • During F110  run-How to pick profit centre from the Pur.Invoice line item ?

    Could anyone please help me with a solution to this problem.
    Purchase invoice line items have got profit centre recorded from Material master.
    While doing the auto payment run F110, for foreign currency invoices, the exchange rate diff
    is posted to a - realised exch rate diff gl a/c.
    But there is no cost object attached.
    Business wants the system to pick the profit centre from the purchase invoice line item
    and put it in the line item record of the exch rate diff account.
    Can I do it using OKB9 ? Could someone please explain how to do it.
    Thanks

    Hi,
    With standard SAP this is not possible.may be you have to develop some custom program.
    with my experiance,we always post to defualt cost center.
    hope this helps you.
    Thanks,
    Rau

  • How to set partial delivery for Purchase Order line item

    Hi Team
    We have created a PO for 100 quantity along with 25% over delivery tolerance.  We have done 5 GRNs totaling for 95 quantity.  when we try to do another 10 quantity, system not accepting the GRN.
    I want to set the partial delivery for this line item.  Please help how to do this.
    regards
    Ravi

    where did you check the underdelivery tolerance of 0?
    the PO is the place to check, changes in material master will notz effect existing POs.
    if you removed the delivery complete indicator and the item still does not show up in MIGO, then set the "propose all items in MIGO settings"
    if it still does not show up, then you might have other restrictions like confirmations , last goods receipt etc.
    the error 'Document does not contain any selectable item" is often discussed in this forum, you will find numerous threads that list what you have to check.

  • How to: Reference fields XREF1/2 to be displayed in Acc Doc Line Item

    Hi Experts,
    May I know how to display the fields in the Line Item Level that can also be changed.
    What I already did was the configuration OB32, OB41, FI>GL>Master Data>G/L Accts>Line Items>Define Special Fields for Line Item Dsiplay.
    But it still not working. What is the proper way to configure these fields?
    Thanks

    In the Line item Display list in FBL*N follow this menu path: Settings
    -> Special fields, and add the fields you want from relevant table.
    The fields are later available for display, and you can choose them from
    the Line item Display list following this menu: Settings -> Display
    variant -> Current. From the hidden list you can now choose the fields
    you want to have shown. If the technical name is shown for the fields,
    the special fields are all starting with '1-U_'. It's important, that
    you add the Special field, if the field also exist as Standard field.
    The Special fields are shown in the bottom of the Hidden list.
    Review the solution part of note 215798 the detailed steps.
    XREF1 / XREF2 do not exist in the index table (BSIS/BSAS) for the G/L
    account. Therefore you should create XREF1/2 as special field for
    display via FAGLL03/FBL3N.
    SPRO - ... - Define Special Fields for Line Item Display
    There you should also include the field and store the change.
    You do not have to run the RFPOSXEXT again, because the related
    structure is generated automatically within the storage of the data.
    After you have stored the 'new' field, you should run the report
    BALVBUFDEL. This report will reset the ALV buffer, because the old
    definition of the fieldcatalog does not have the needed fields, and
    so it might happen that these are not displayed in the fieldlist of
    the FAGLL03.
    Please refer to the attached 984305 and 215798 Point 3.
    Regards,
    Fernando

  • How to grey out the Account Assignment Group Fld  in Billing Doc Line Item

    Hi SD Guru's
    I have a small doubt.
    I have maintained account assignment group in material master. Now when i create an order , the account assignment group gets picked from material master into this sales order.
    Now i go to VF01 for doing the invoicing.
    Now i can still go to billing document line item against the material and change its account assignment group before raising the invoice. When i change this field, i can still post to accounts.
    I want to know is there any way in which we can restrict the way in which this field is greyed out and is made non-editable, so that only correct entries with account assignment group maintained in material master are posted.
    Answers will be appreciated.
    Kind Regards
    Ravi

    Hi,
    Sandeep can you please give me step by step process of using SHD0 in this case.
    Now if i apply this to transaction VF01 and VF02, would it apply for all billing document types? I dont want that, i want it to work for a specific billing type
    Kind Regards
    Ravi

Maybe you are looking for

  • ITunes library contents at several HDs, how to move location?

    I have a problem with having iTunes recognise that some of my iTunes library contents are being moved into another HD. I have only some most used music files at the internal HD of my PowerBook G4, and a huge video collection at an external HD, and no

  • Error message after upgrading to 7.3

    i upgraded to iTunes 7.3 and i got a message that said something about some files were missing and i needed to uninstall and try again. i uninstalled it and now i can't even download iTunes. i can download but i can't do anything else. anybody else h

  • Shift Planning (PP61) in SAP. How to automate the process of entering  data

    Hi Friends, With using PP61 tcode we can able to enter data manually. I want to upload data from excel file. Is there any automation process? like any programs are function modules will useful? Many thanks in advance for the solution.

  • Error building formula

    I am trying to build formulas involving cells in another table on the same sheet. I click on the cell I want to reference, and sometimes it works, sometimes it doesn't. When it works, the cell I click becomes coloured, and the formula includes a refe

  • Will not update apps through app store

    My Ipad can not update apps through app store?