Automate

 View Only
  • 1.  Trying to create script to remove/expire a BP role

    Posted 03-14-2024 13:46

    Using Winshuttle Studio v20.3 (64bit) build 221103001  I'm trying to create a simple script to open a BP, select a role and change the date to yesterday so that the role "disappears" (expires) from the list of assigned roles. When I run and stop on errors I get the ok code = TVOK but then the valid to date never gets updated.  I can clear the ok code and manually change the date and save but the script is supposed to read the date from the excel template.  I've tried several times but I either get the ok code /00 popup which stops there or the = TVOK code which stops the script from going further. (Row 14 in expert view)

    If I run in standard mode I get runtime errors.  Is there any way to accomplish this without updating 4000+ records manually?

    Thank you.



    ------------------------------
    Barb Cardenuto
    Sr Master Data Analyst
    Lamb Weston ID
    ------------------------------

    Attachment(s)

    Txr
    BP_RemoveCustRole.Txr   547 KB 1 version
    xlsx
    DataTemplate.xlsx   10 KB 1 version


  • 2.  RE: Trying to create script to remove/expire a BP role

    Employee
    Posted 03-14-2024 16:05

    Hi Barb

    Great that you tried to create a script. :)

     My default is display mode when I open BP.

    I took a look and you didn't swap to edit mode.  You will need to do that to edit anything in your BP, but you only need to do it for the first record.  After that it stays in edit mode for the next ones.  It would look something like this on the Expert View tab

    The other part of this how are you finding which row your role is in to end date it?  Or is it always in the same place?   I'm in a demo system so I have a few BPs that are customers and vendors, but in general, will you know which row it's on?

    If the role is always on the same row, you can go ahead and update it.  Otherwise, you may have to use GUI scripting to position it - or - find a bapi.

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Trying to create script to remove/expire a BP role

    Employee
    Posted 03-15-2024 09:48

    Hi again Barb,

    Did a quick (not exhaustive) search for a BAPI and couldn't find one.  So I created a quick GUI script as an example, so that you can see how to do this, in case the role is in a different place in each Business Partner.  (attached)

    You would choose GUI scripting mode in Studio

    Then open the BP and swap to edit mode - only for the first transactions

    Then I opened the roles and used the small pop-up from Studio to capture disabled fields - and I clicked on a single role, like FLCU01, then I clicked on the pop-up again to disable capturing read only fields - and I updated the date.

    You would see the role as a download field in your script like here 

    You use that as the "index" - the lookup value in the table - to find the right row:

    Choose Indexed If and choose the Role as the Index field, and then compare it to a value in your Excel workbook column - in my case column C

    Then disable the role downdown field by unchecking it - you don't need it as part of the script except as the index to find the right row.

    If you need to end date multiple roles, you can add a loop, but I didn't do that in this example.

    If GUI scripting is new to you, I plan to cover some examples in an upcoming educational webinar on March 28th.  The topic will be material master, but the concepts apply to many places in SAP.

    Hope this helps,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------

    Attachment(s)

    xlsx
    BP_Role_EndDate_GUI.xlsx   5 KB 1 version
    Txr
    BP_Role_EndDate_GUI.Txr   59 KB 1 version


  • 4.  RE: Trying to create script to remove/expire a BP role

    Posted 29 days ago

    Hi Sigrid

    I've been trying for 3 days to get this to work. I created my own GUI scripts several times and each time I can get the first record to process and the log for subsequent rows are posted but the script keeps opening the same BP record in SAP rather than read the next BP number.  I've tried clicking the Start SAP GUI option but I get the same results.  The first row is processed but the next rows keep opening the same vendor number and logging "No message is returned from SAP".  My head hurts from continually hitting the brick wall.  I decided to go to your original sample script and only added rows 9,10 to accommodate a popup for "Changes to vendor XXXX have not yet been confirmed".  Can you help?  What am I missing? 

    Thank you. 



    ------------------------------
    Barb Cardenuto
    Sr Master Data Analyst
    Lamb Weston
    ID
    ------------------------------

    Attachment(s)



  • 5.  RE: Trying to create script to remove/expire a BP role

    Employee
    Posted 20 days ago

    Hi Barb,

    It might be time to open a support ticket, so that someone can take a look at it with you.  

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------