Automate

 View Only
  • 1.  Troubleshooting ME12 Script - Adjusting Pricing Conditions in PIR

    Posted 11-22-2021 11:55
    Hello,

    We have a script for ME12 that deletes old Pricing Conditions and adds new ones. The script is working fine, except that when it needs to choose the validity date range - it is choosing the second date range on the list, rather than the most recent date range. Does anyone know how to fix this?

    Thanks!

    ------------------------------
    Maxwell Streit | Data Maintenance Manager
    The Coleman Company Inc | 0000000000
    ------------------------------


  • 2.  RE: Troubleshooting ME12 Script - Adjusting Pricing Conditions in PIR

    Employee
    Posted 11-22-2021 14:26
    Hi Maxwell

    If it's always choose the 2nd condition, then that's how it's recorded.

    I'm not 100% what you're trying to accomplish, because you state you create a new condition record each time, but then you state you also need to select from a list of condition effectivity dates.

    If you're creating a new condition each time, then you can use this template:  https://community.winshuttle.com/sap-module-templates/viewdocument/change-purchasing-info-record?CommunityKey=8a12989f-fefe-4b81-8147-4bbb11af6820&tab=librarydocuments

    If you need to find a specific condition effectivity date to update, it would require GUI scripting, and you'd have to use the effectivity date do to the find.

    You'll have to use the pop-up to "identify disabled fields" as the date is read only, and then click a start date - you'll see a red box around it for a moment.

    You then use an Indexed IF to position based on the effectivity start date - make sure you disable the download field of the start date, as well

    A quick example is attached.

    My test data 
    in SAP

    in the script template
    I threw in a bad start date so that you could see the message

    HTH,
    Sigrid

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



  • 3.  RE: Troubleshooting ME12 Script - Adjusting Pricing Conditions in PIR

    Posted 11-23-2021 13:37
    Hi Sigrid,

    Thank you for your reply. We are doing a mass update to delete the FRC1 and ZOC1 conditions, and replace them with ZOC1 and ZOC3. 

    We just need the script to choose the current effectivity date (x date to 12/31/9999). Is there a way to do this without GUI scripting?

    Best,

    Maxwell

    ------------------------------
    Maxwell Streit | Data Maintenance Manager
    The Coleman Company Inc | 0000000000
    ------------------------------



  • 4.  RE: Troubleshooting ME12 Script - Adjusting Pricing Conditions in PIR

    Employee
    Posted 11-23-2021 13:46
    Hi Maxwell

    With transactions that have sections like this that don't provide a way to find a specific row, you have two choices:

    1. use a BAPI, but there isn't a remote-enabled BAPI that I'm aware of to do this for ME12
    2. use GUI scripting
    Those are the only options I'm aware of.   If anyone else has a better suggestion, please post here.

    Best Regards,
    Sigrid

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



  • 5.  RE: Troubleshooting ME12 Script - Adjusting Pricing Conditions in PIR

    Posted 11-24-2021 05:00
    Hi Maxwell,

    the effective date ranges are in table A018. Search on Supplier, Materialnumber and Purch.Org.
    Maybe you can first query this table to find out which row must be selected and then use the rownumber to select the right row in your transaction script.
    It will be a bit complicated but I think it can be done.

    Regards,

    ------------------------------
    Jan van Asseldonk | Consultant
    CTAC | +31629078169
    ------------------------------