Hide attributes based on stock level

How can I hide the attributes of a drop down based on their stock level? I would like to hide all of them that are out of stock.
==
John

Hi,
You should add something along this code snippet to the end of your product large layout. What this does is it uses the 2 tags - tag_attributes_json and tag_instock_json to work out which attributes have 0 stock, find them in the drop down and hide them. The only thing you would need to work out is how to target the elements themselves, this may vary depending on your page structure, so $('.catProdAttributeItem select option[value="' + attributes.variations[key].optionIds[0] + '"]').hide() might need to be changed accordingly.
Here is the code snippet:
Object.prototype.getKeyByValue = function (value) {
    for (var prop in this) {
        if (this.hasOwnProperty(prop)) {
            if (this[prop] === value)
                return prop;
attributes = {
    tag_attributes_json
stockers = {
    tag_instock_json
for (var key in attributes.variations) {
    if (attributes.variations.hasOwnProperty(key)) {
        if (stockers.byVariation[key] == 0) {
            console.log(attributes.variations[key].optionIds[0]);
            $('.catProdAttributeItem select option[value="' + attributes.variations[key].optionIds[0] + '"]').hide()

Similar Messages

  • PO/STO Creation based on Stock Levels

    Dear all,
    We have the following scenario to be configured.
    1. When PO/STO being created, if stock is available in DC, STO should be created.
    2. If Stock in DC is zero, PO should be raised against a specific vendor
    How can this be achieved?
    Thanks,
    Satish

    Hi
    What is DC?
    If you use MRP type VB in material master MRP view and maintain reorder level as 100 EA, then whenever stock fall below 100 EA in that Plant a PR will be generated.
    If you have sourcelist and info record with fixed vendor then source assigned PR will be generated then that PR can be made as automatic PO in ME59.
    If you have scheduling agreement and sourcelist with MRP relevency indicator 2, then instead of PR, schedule line will be created during MRP run if the stock is below 100EA
    Hope it will solve your problem
    Regards
    Antony

  • Restrict PO  based on the maximum stock level qty in MMR

    Hi
    We have maintained Maximum Stock level in MRP1 in Material Master. Is there any facility which can restrict the Purchaser, not to raise any PO more than maximum stock level qty which is maintained in Material Master ??? how to do ?
    Is there any user exit or warning mesge settings?
    Edited by: Jayakumar Raju A.S on Jan 13, 2010 8:55 AM

    If you want do such check then you have to do that in a userexit.
    I am personally the opinion that a purchaser does not extend the PO quantity just for fun. Maybe he gets a better price if he procures a little more. It is probably a lack of training and knowledge about each others work, that a buyer does not understand what the maximum stock level is , and the planner may not understand the particular issues a buyer deals with daily.
    Bring those two together an let they explain each other the reason for the maximum stock level and the reason why the  order quantities are changed.  Maybe they will finally change the maximum stock level, maybe the buyer will not change the quantities anmore without discussing it first with the planner......

  • Minimum stock level

    Hi all,
            My scenario comes like this ...i have two service center"A" and "B"where i ll maintain some minimum stock level of spare parts.
           each service center will get service arder individually for spare parts.service center's issue spare parts against order from minimum stock level.  so i maintained make to stock scenario where order is full filled with minimum stock level.so planning has to cover minimum stock level.so i mapped in safety stock.
          But the safety stock level varies with some period.so i need an upload program of safety stock in period oriented manner.
          then fullfillment of service order also based on priority wise  .becas spar parts for that sevice center are obtained from some other plant ...which should maintain a plan which determaine priority to give spare parts to "A" and "B" in percentage of priority
    so i require  1.how to go for upload of safety stock with periodically?
                      2.How the priority can be given for allocation to verious service center.?\
    Regards
    suresh

    Hi,
    For upload the safety stock you can use BDC or LSMW.
    for periodic upload try through background program with the help of ABAPer.
    Regards,
    Nilesh

  • Validating an attribute based on the value of another while inserting

    Hi guys
    I need to validate an attribute based on the value of another attribute.
    Example:
    inside some entity I have the following validation function
    public boolean validateAtt1(Number data){
         if (this.getAtt2() < some vlaue)
              return false;
         return true;
    this function works fine when I'm updating a record, but when I'm inserting a new record the this.getAtt2 return null, now I don't want to override the validateEntity function I want to override the validate function for att1; so in other words is there a way to reach att2 in the validation function of att1 when I'm inserting a new record, because the this.getAtt2() returns null if I'm inserting a new record.

    Using attribute-level setter methods won't work because when the value of a particular attribute is being set, the values of the other attributes might not yet have been set. This explains for example why it does not work when inserting a new record. You therefore have to validate at entity level.
    Rather than coding on the validateEntity() method you use a built-in Validator or Method Validator. When recording validators like this, you can provide a separate message for each business rule. If you also have the bundled exception mode enables (which will be the case by default for web applications), then multiple messages can be shown at the same time.
    If you have one business rule involving two different attributes, for example a and b, and you must provide different messages based on if a is causing the violation or b, you can do it like this:
    - implement one method doing the validation and that will indicate which attribute is causing the violation
    - implement two different method validators (with two different messages) that call the method doing the actual validation and return false based on the attribute causing the violation
    For more information about implementing business rules in ADF BC, you might have a look at this white paper:
    http://www.oracle.com/technology/products/jdev/collateral/papers/10131/businessrulesinadfbctechnicalwp.pdf
    Jan Kettenis

  • Minimum stock level per warehouse and MRP

    Hello experts
    We have tested minimum stock level per warehouse and try to use it for the MRP but it seems that the MRP uses for a specific warehouse the consolidated minimum level
    For example
    WSE 1 minimum stock level 10
    WSE 2 minimum stock level 5
    MRP runs for WSE 2 recommandation is calculated based on 15 pieces of minimum stock level (WSE 1+2)
    Could you please tell me if this is normal behavior and the use of minimum stock level per warehouse is not possible ?

    Hi.....
    SAP gives recomendation on Overall stock basis and not on Minimum Inventory of Particular Warehouse.
    It is standard behavior. But SAP should think of it as it is not right recomendation if someone tries to view it as per warehouse.......
    Regards,
    Rahul

  • Stock levels onesaas api

    hello Guys,
    we have been working with onesaas using their api to integrate our BC site to our distributor.  stock levels are maintained at the distributor level.
    using the onesaas api we are unable to pull the stock levels back into our business catalyst for products that are grouped.  so to explain further, if we set up a product with 1 variation we can pull the stock levels.  but if we have size attributes (small, med large ect..) the stock quantity will not work.
    has anyone else experienced this?
    does anyone know how to get around this?
    any help would be much appreciated.
    thanks.

    Thanks for the help with this.
    We have fixed the issue.
    We were creating individual products for each size variation and then grouping them.  The stock levels were not updating.
    So we have changed to 1 product with multiple attributes and assign a unique code to each product variation. 
    Its all working now.
    Thanks.

  • Inventory Report for current stock and Safety, Minimum etc stock levels

    Hi,
    Is there any report available to view the current stock against the minimum, safety stock levels so that the user can plan further actions accordingly.  Can anyone please guide me on this.
    Thanks in Advance.
    Regards,
    Laxmi

    Hi Shailesh,
    Is there any way we can include some extra fields into this MC.9 report - i tried but could not find anything.  Can you please help.
    Regards,
    Laxmi

  • Report  from system on different stock levels-min, max stock levels

    hI gURUS,
    Is there any Standard Report  from  SAP system to see on different stock levels-minIMUM stock, maximum stock levels

    Hi,
    MMBE will not give stock level min and max  that is maintained in material master MRP view. I think you need to make a z report for th same or may be through query.
    Regards
    Sangeta

  • Stock control – hide if out of stock

    Hi,
    I’m trying to figure out the best way to go with a site I’m building. The client has hundreds of products and if a product is sold they want the item hidden from the website. The issue is – if I choose that option – hide if out and stock and most items there is only 1 of – then when that product is added to the visitors cart the items disappears and says This product is unavailable or out of stock. I’ve added js to say Product added successfully however if the visitor wants to look at their item again (by clicking on it in their shopping cart) then the message comes up ‘This product is unavailable or out of stock’. This can be confusing for customers so I’m wondering what’s the best way to work around this? Ideally it would be great if the customer could still see their item.
    Can anyone suggest a solution?
    Cheers
    EM

    You do not need javascript for that, you can just show hide elements that are in or out of stock.
    You can also hide out of stock items in the admin itself so products once out of stock do not even show.
    You can update your script as an other option to look at the cart and if the item on the page is in the cart just have something that says "this item is already in your cart" as well.
    Lots of options, depends on what your after.

  • Customer consignment stock- REPORTING stock level & goods depatched

    Hi all
    I'm looking for a report (or reports) which shows the following (bare in mind that this will all be customer consignment stock):
    - the delivery numbers
    - the previous month's stock level
    - the quantity of goods despatched the following month with a rolling calculation
    - monthly invoice values
    - remaining stock levels (after current months goods have been issued and invoiced)
    I'm aware that MMBE/ MB58 shows the current stock levels, however I'm hoping there is a report in SE16 which shows it as a report structure.
    I understand that this is a lot of info requested by myself however any information would be appreciated.
    Thanks
    / Vicky

    Dear tortyv,
    As per my understanding of the requirement,
    You please check the "VL06" report if it satisfies your requirement you enter the execution parameters and execute.
    System will give the list of out bound deliveries. Select one of those and click the details icon (ctrlshiftf3) according to the item view or headder view.
    If it does't suit you have to go for z report.
    I f you want that please provide the input fields in order to fetch the required data for the report.
    Thanks&Regards
    Raghu.k

  • Help Needed: XML Attributes based style mapping!

    Hello all, I am new in this Group. I've reviewed the contents which posted earlier. It is pretty good.
    I need a help from this script forum regarding on mapping the attribute based style mapping.
    like: <emphasis style="italic">Text</emphasis> to be mapped as Italic character style
          <emphasis style="bold">Text</emphasis> to be mapped as Bold character style
    Any one example of VBS / JS is enough, Your highly response / help will be appreciated.
    Thanks
    Guna

    Hi gunasekarant
    here I am giving you the sample XML and XSLT files this works fine
    XSLT
    <xsl:transform
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/">
    <xsl:template match="root">
    <xsl:apply-templates/>
    </root>
    </xsl:template>
    <xsl:template
    <xsl:template match="emphasis[@style='bold']">
      <b><xsl:apply-templates/></b>
    </xsl:template>
    <xsl:template match="emphasis[@style='italic']">
      <i><xsl:apply-templates/></i>
    </xsl:template>
    </xsl:transform>
    XML
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <root>
    <emphasis style="italic">Text</emphasis>
          <emphasis style="bold">Text</emphasis>
    </root>
    I have no idea about XSLT for Docbook for downloading you can develop

  • Displaying themes based on Zoom levels in base map

    I am using Oracle AS MapViewer 10131.I have 3 themes added to a base map.
    I am using Oracle Mapbuilder to create Mapping metadata.I want to display the 3rd theme based on the zoom levels.I want to display it only at lower zoom levels.I have followed necessary instructions given in the Mapviwer user guide and mapbuilder help.
    But I am not able to display particular theme based on Zoom levels.
    For example I have min/max scale 70,000/0 for Streets theme set using mapbuilder.This theme should be displayed only at that scale.But I am getting this theme displayed at all min/max scales (zoom levels).While creating the Map Cache Instance given the min/max scales 1000/25000000, the default values.Here the scale values look contradictory to the theme scale values given in mapbuilder.Is this where I am going wrong? or while setting scale for themes?
    I hope you understand my problem.Please help me about this.this is urgent.
    Thanks in advance!!

    My problem is solved now.I am able to display themes on zoom levels.The solution is, I set the min/max scale (zoom levels) in Map Cache Instance as "Ratio" and in theme i set it to "Screen-Inch".The scale of theme is not understood by the map cache instance.So finally i set both the scales to "Ratio" and it is working fine as i expected.
    Anyway thanks for yout interest in helping me.I will surely make a post here if i got stuck in further work.

  • Maximum Lot Size & Maximum Stock Level

    Hi All,
    In MRP 1 view we have Max Lot Size & Max Stock level, how the system give me requirement if i'm maintaining these fields.
    Regards
    Ashok

    Hi Ashok,
    If you mainatain Max lot size system will check for this qty & it will not allow to generate PR or planned order more than this qty in MRP run & Max stock level is the stock for replinshment where lot size if replinishing.
    Regards
    Rang

  • How to put validation between attributes at View Object level in BC4J

    Hi,
    Is it possible in BC4J to put validation between attributes at View Object level?
    I know that I can do it at Entity Object level in validateEntity method, but I have several View Objects connected with one Entity Object and don't want to have the same validation logic for all View Objects.
    Thanks for any help!

    It returns errorWhat error does it return?
    John

Maybe you are looking for

  • Storing 32-bit numbers in plc registers.

    I am using Labview 7.1 and DSC/OPC to communicate to an Allen Bradley SLC 5/05 over Ethernet. In my application, I desire to write and read part numbers ranging from 0-99999999 to/from the N registers of the PLC. Now since the N (Integer) registers o

  • Safari browser connect me with the page I want, but the page itself is not active - how to unblock it?

    Safari browser connect me with the page I want, but the page itself is not active - how to unblock it?

  • How to learn Consolidation

    Hi Guys, I wants to learn Consolidation part in bpc. I am not from finance background.Can any one guide what was the basic things need to Know to start consolidation part in bpc. Please share any documents if possible. Thanks, Suresh

  • Updating Firmware on 7500 model: (download address?)

    I've seen a few threads asking for where to find a firmware update for the Verizon/Westell 7500 modem/router. What is the official address of the 7500 model firmware update? I already know how to do it. I just want the official answer as to where to

  • IIIegal sample percent 100 on statistics

    Hi, Gathering statistics with a sample percent of 100 (default in dialog) gives me: An error was encountered performing the requested operation: ORA-20001: IIIegal sample percent 100: must be in the range [0.000001,100) ORA-06512: a "SYS.DBMS_STATS",