Automate

 View Only
  • 1.  ME21N for Account Assigned Services

    Posted 11-19-2020 09:27
    Hello,

    I'm a new user and have been thrown in the deep end a bit.

    I'm trying to create a script to load Purchase Orders with multiple service lines (Item Category 'D') per PO, each line being account assigned either 'K' or 'P'.  The service line details are planned (i.e. have a service master).  I have created scripts with a loop from the Account Assignment Category field in the line item, through to the entry of the Cost Centre.

    I have also used the filtering technique recommended in the guides on the first line item, applying a filter on 'item' and adding in the criterial '9999'

    My problem is that when I run the scripts they only manage to create POs with 2 line items.  Any PO with 3 or more line items crashes with varying errors depending on the mode selected.  All modes are failing.

    Can anyone steer me in the correct direction to fix this issue?

    Regards
    Andrew


    ------------------------------
    Andrew Earnshaw | SAP MM Consultant
    ASSALA GABON SA | +447788555588
    ------------------------------


  • 2.  RE: ME21N for Account Assigned Services

    Posted 11-20-2020 02:13
    Hi Andrew,

    Are you able to share your script?

    ------------------------------
    Ben
    Woodside Energy Ltd
    ben.crerar@woodside.com.au
    ------------------------------



  • 3.  RE: ME21N for Account Assigned Services

    Posted 11-20-2020 04:04
      |   view attached
    Hi Ben, thanks for responding.  Here's the script:

    ------------------------------
    Andrew Earnshaw | SAP MM Consultant
    ASSALA GABON SA | +447788555588
    ------------------------------

    Attachment(s)

    Txr
    ME21N_20201120_085052.Txr   1.24 MB 1 version


  • 4.  RE: ME21N for Account Assigned Services

    Posted 11-20-2020 07:15
    Andrew,

    I may be misunderstanding your description however it sounds like your loop doesn't contain all the elements of creating the line item.  We use ME21N to create material PO's but Services may be the same using Service Master rather than Material Master.  We successfully create PO's with many lines and various cost objects using the Loop function and condition statements around the actual cost assignments required.  The script creates header elements and the the first line of the PO and then the Line elements are repeated within the loop right after the filter.  That is all the line elements are within the loop and not just the cost assignment elements.  The last line of the loop elements is just prior to the save.
    I could possibly send you a copy of the working script if needed.

    ------------------------------
    Darryl Odger | Procurement & Supply Management
    Canadian National Railway Co. |
    ------------------------------



  • 5.  RE: ME21N for Account Assigned Services

    Posted 11-23-2020 09:58
    Hi Ben and Daryll,

    Thanks for you kind assistance.  I've now been able to resolve my issue.  For the record it was due to the positioning of the loop in my script as pointed out by Darryl.  The copy of the working script was invaluable.

    All the best,

    Andrew


    ------------------------------
    Andrew Earnshaw | SAP MM Consultant
    ASSALA GABON SA | +447788555588
    ------------------------------