Automate

  • 1.  ME21N - Create Service PO

    Posted 11-22-2021 10:05
    Hello All, 
    I hope all is going well for you!

    I am trying to do ME21N Service PO Script following this clever instruction: 
    ME21N: Creating a purchase order

    Using debug option I can see that WS opens filter again while executing loop for line 20 and encounters error.
    When looking into code, I cannot understand why as loop is after filter. I would be thankful for support. Script file is attached :). 


    ------------------------------
    Robert Dudziak | Senior Procurement Operations Analyst
    Kimberly-Clark Corporation |
    ------------------------------

    Attachment(s)



  • 2.  RE: ME21N - Create Service PO

    Employee
    Posted 11-22-2021 13:58
    Hi Robert,

    Inside your loop, when you enter the subsequent rows, you want to select the row and click item details.  Your script hits enter(ok code '/00'), which will cause your row to disappear because of the filter prior to entering line item details like account assignment, etc.

    it should look something like this

    If you want to try a BAPI instead, there is an example template:  https://community.winshuttle.com/sap-module-templates/viewdocument/po-creation?CommunityKey=8a12989f-fefe-4b81-8147-4bbb11af6820&tab=librarydocuments

    HTH,
    Sigrid

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



  • 3.  RE: ME21N - Create Service PO

    Posted 11-24-2021 03:22
    Hello Sigrid,
    Thank you! I was trying to do it your way and then I found my error :D by comparing line by line both maps. Actually there was filter button in the loop: 

    I removed it and script works flawlessly for Cost Center based Service POs so far. 
    SInce it's service PO, when I hit enter it alaways opens items section with prompt to enter data to limits tab :).  I will be doing bigger tests to check if there are any errors later. If they are I will use your advice with selection. 

    As service POs in my Company can be based on Coste Center or WBS depending it is K or P in account assignment, I tried to map WBS fields and If conditions. 

    For Cost Centers (account assingment K) - works
    For WBS (account assingment P) - throws error as below, but when using Debug Mode to see where error is - no error. Is there any way to check what causes the error?

    Normal Run in Quality: 

    Debug Mode and clicking ok from start to end: 

    My Mapping:

    I also attach script with WBS/CC added. 



    ------------------------------
    Robert Dudziak | Senior Procurement Operations Analyst
    Kimberly-Clark Corporation |
    ------------------------------

    Attachment(s)