Automate

 View Only
  • 1.  VK12 Loop with VK12 issue

    Posted 04-20-2021 03:26

    Hi,
    For some reason i am not being able to use loop in order to change existing condition record. I am particularly using the t-code to set expiration for a condition, in this case "price validity". I am able to do it without using loop but since my list can get crazy big sometimes, i need to use loop to speed up the process.
    What i feel is that in VK12 the detail level assignments does not go to the same box as in the VK11. When i tried to add more line to add new item, what happened was beside the date, i was asked to put at least currency code in details, and when saved, it also changed the price to 0, as i had not put any line level price values. I only want the validity to be changed.
    Screenshot attached for reference.
    VK12 Expert View.


    VK11 view with loop

    Have anyone used loop with VK12 ? Some tips and suggestion would be highly appreciated.
    BR,
    Manoj



    ------------------------------
    Manoj Adhikari | Pricing Analyst
    Metso Oy | +358440526010
    ------------------------------


  • 2.  RE: VK12 Loop with VK12 issue

    Employee
    Posted 04-20-2021 09:58
    Hi Manoj

    You'll want to use FIND logic at the top of the loop.  

    You can click on the binoculars, then enter the material number and click the OK button.  (Note the filter button works the same but then you'll have to undo the filter each time.)


    This will move your material to the top row.

    Make your changes on the top row for the 1 material.

    Put a loop around those steps, and you should be good to go.

    Best Regards,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 3.  RE: VK12 Loop with VK12 issue

    Posted 04-21-2021 05:33
      |   view attached
    Hi Sigrid,
    Thank you for the response. I tried the method, but i think having almost xxxxxx digit line level items in the pricelist record, i will have to put material in the  either in the initial selection screen of the condition or as mass copy paste. That put me in a bit difficult position again. I tried to run without any materials, but it seems like it takes forever to load as it seems to run the whole pricelist.
    Any suggestions with the method of BAPI ?
    Or can you maybe share your template ?
    BR,
    Manoj

    ------------------------------
    Manoj Adhikari | Pricing Analyst
    Metso Oy | +358440526010
    ------------------------------

    Attachment(s)

    Txr
    VK12_YGLP_LOOP.Txr   260 KB 1 version


  • 4.  RE: VK12 Loop with VK12 issue

    Posted 04-21-2021 08:54
    Hi Manoj,
    Based on scripts I have with loops, you want to adjust the end of your loop up 1 line (see screenshot). Also, how are you setting up your data file? Based on where you have your loop set, it should look something like below. I cannot test your script with the loop change on my end due to systematic differences.

    Loop adjustment

    Data File


    ------------------------------
    Vanessa Kutasi | Application Analyst II
    IDEXX | New England WUG Leader
    ------------------------------



  • 5.  RE: VK12 Loop with VK12 issue

    Posted 04-22-2021 03:10

    Hi Vanessa,
    Thanks for pointing out the error. I fixed the the loop range. But that still leaves me to long running script which i believe is because in my recorded script, the initial screen (in SAP) where it prompted me to fill also material, i did not, and now it is running the whole list of the specific condition. Like mentioned before i have 6 digits amount of materials in the the condition that is why it must be really slow. On the data side I have the same data layout as yours.


    So far my alternate is rather doing the change directly in SAP if it is only to make the date change and if they are the same date as i can do in once or twice steps in SAP GUI. But if i would have to change the price, that are line specific, i would really like to have LOOP working as that would speed up the job.

    BR,

    Manoj



    ------------------------------
    Manoj Adhikari | Pricing Analyst
    Metso Oy | +358440526010
    ------------------------------



  • 6.  RE: VK12 Loop with VK12 issue

    Posted 04-26-2021 09:38
    What about using VK11 to create a new condition record? This is how we do it at my company. Rather than having to search/update, we create a new condition record. Some companies will VK12 to end the pricing first, and then create a new record. It may be the faster/simpler method. I have 2 different VK12 scripts to end pricing. One script simply sets the deletion flag, the other changes the end date and sets the deletion flag.  Both of those scripts handle 1 material at a time (no loop). 

    Another option, change a single material at a time, rather than looping through. The script will run much faster. And you can always schedule it to run during off hours so as not to affect the business.

    ------------------------------
    Vanessa Kutasi | Application Analyst II
    IDEXX | New England WUG Leader
    ------------------------------



  • 7.  RE: VK12 Loop with VK12 issue

    Posted 04-27-2021 05:16
    Hi Vanessa,
    I understand your suggestion. That is also a possibility if the condition would have other line level value. But here my situation is I have to make them expired and then i would not add that line to the valid condition at all.  Even if i create a record with VK11 with valid to very close, once it is expired, the previous conditions comes into effect because it is determined now valid. So i will have to edit the existing lines date value.

    I could run line by line change without loop, but unfortunately in my SAP setup, one material can have 60x combinations and last time when i had 7k items to expire, it took me almost 2 days. Line by line transaction takes almost 1 second per line in my case. Loop has always been the better option.
    BR,
    Manoj

    ------------------------------
    Manoj Adhikari | Pricing Analyst
    Metso Oy | +358440526010
    ------------------------------



  • 8.  RE: VK12 Loop with VK12 issue

    Posted 04-28-2021 09:52
    I managed to create a VK12 to change only the validity end date, using a loop. I realize that the pricing condition is different, therefore the beginning screens are different, the loop should give you an idea of what might work for you. I had to keep the 1st material outside the loop, then add additional materials inside the loop. I use the binocculars without the + to do the positioning. Hope this helps.

    ------------------------------
    Vanessa Kutasi | Application Analyst II
    IDEXX | New England WUG Leader
    ------------------------------

    Attachment(s)

    xlsx
    VK12_LoopTest.xlsx   5 KB 1 version
    Txr
    VK12_LoopTest.Txr   453 KB 1 version


  • 9.  RE: VK12 Loop with VK12 issue

    Employee
    Posted 04-21-2021 10:18
    Hi again Manoj

    I have not used a bapi for price updates.  There is one with a blog, but it looks quite like it will require extra work to get all of the inputs they way this blog describes:  https://blogs.sap.com/2014/07/14/document-for-bapi-bapipricesconditions/

    Vanessa is correct.  You have the screen name of the last section inside your loop - it needs to be adjusted to look like this:

    If you want to stick with VK12 transaction, on the initial screen I would suggest you use a wide range of material numbers or at the very least sales org and distribution channel, so that you limit how many you're trying to process at one time.  SAP took about 15 seconds to list all materials for a sales org/dist channel and that was under 4000.

    I ended up with a bit over 500 materials in a loop, and I used the sales org, dist channel and a range from the lowest to highest material number, and it ran in about 23 seconds.

    With the same number of conditions to update, only specifying sales org and dist channel, it ran in about 30 seconds.  But again, I only have about 4000 condition records.

    IDK how many you have to process, but specifying more criteria to limit the number you are processing and breaking it into chunks will be your best bet - even if you get the BAPI working.  It will also prevent locking all of those conditions.  My 2 cents. :) 

    Best Regards,
    Sigrid


    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------