Automate

 View Only
  • 1.  Retrieving existing Customer master data from within a script - is it possible

    Posted 12-17-2024 04:36

    Hi, currently, I 'hard code' the KNA1-KTOKD value for a customer by line in my data load file. The script then uses these values in an if statement and behaves accordingly.

    This is a risk though, it can damage the customer in an unrecoverable way.

    My question: is there a way to retrieve the KNA1-KTOKD value from the system 'on the fly', within the script, i.e. as and when needed by each line of the file as it's worked through?

    Thank you,

    Marcus



    ------------------------------
    Timothy Lee
    Master Data Manager
    Thermo Fisher Scientific (UK)
    ------------------------------


  • 2.  RE: Retrieving existing Customer master data from within a script - is it possible

    Employee
    Posted 12-17-2024 10:10

    Hi Timothy

    Am not 100% sure I understand your ask.  I see you are updating data and want to download values - but it's unclear if it's before or after the update.

    You can:

    • if updating, check the Backup Data checkbox on the Run tab, which will download the values you are updating prior to the update
    • You can chain a second script to open the object (customer) download the value(s) of the records you just updated - so this is executed after the update.

    Hope that gives you some ideas.

    Best Regards,

    Sigrid



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



  • 3.  RE: Retrieving existing Customer master data from within a script - is it possible

    Posted 12-17-2024 10:19

    Hello, thanks Sigrid...

    I have taken a screenshot from within my script. Where it says 'Z002' (this represents KNA1-KTOKD, ringed in red), instead of explicitly having it on my data file (as currently), I would like to obtain the current KNA1-KTOKD value from system as the script is being executed. Is it possible to retrieve it in this way?

    Thank you,

    Marcus



    ------------------------------
    Timothy Lee
    Master Data Manager
    Thermo Fisher Scientific (UK)
    ------------------------------



  • 4.  RE: Retrieving existing Customer master data from within a script - is it possible

    Employee
    Posted 12-17-2024 10:58

    Hi Timothy

    You can definitely download a field you have captured - it would be the value before the update.

    You can also use an SAP field value to compare on the left hand side of the IF, as Jayasri mentioned.

    You can also run a second script to download the new value.

    Does that help?

    Best Regards,

    Sigrid



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



  • 5.  RE: Retrieving existing Customer master data from within a script - is it possible

    Posted 12-17-2024 11:19

    Hi Sigrid and Jayasri, thanks for your replies...would it be possible to have a call with somebody, I am struggling to explain myself. Perhaps there is a solution herein that I am not seeing or understanding. I can't get my head around it and I am sure a simple verbal explanation would get us over the line. Jayasri mentions that it will have to be done in two stages is my interpretation. Thank you.



    ------------------------------
    Timothy Lee
    Master Data Manager
    Thermo Fisher Scientific (UK)
    ------------------------------



  • 6.  RE: Retrieving existing Customer master data from within a script - is it possible

    Posted 12-18-2024 02:01

    Hi both, I have rectified my script, it now works without me having to retrieve KNA1-KOTKD, so no need for us to explore that route. Sorry to have disturbed you and thanks for your time invested in this yesterday. Have a good day.



    ------------------------------
    Timothy Lee
    Master Data Manager
    Thermo Fisher Scientific (UK)
    ------------------------------



  • 7.  RE: Retrieving existing Customer master data from within a script - is it possible

    Employee
    Posted 12-17-2024 10:15

    If you want to check against an SAP screen field on the fly, one option is to use the IF condition with the SAP field option if it is available on the same screen.

    I believe this will only work in non-batch mode. 

    Are you using XD02? If so, it does not look like Customer Account Group is readily available on the main screens in XD02. 

    Alternatively, you can do it in 2 steps - You could populate the account group using a Query with IN operator and pass your list of customers. You have to design your template to compare the query output with your input list of customers and use sorting etc to guard against possibility of missing or typos in customer number etc...they may not always line up exactly.  

    I am curious to see if others have suggestions. 



    ------------------------------
    Jayasri Varyani
    SE
    Precisely Software Inc.
    ------------------------------



  • 8.  RE: Retrieving existing Customer master data from within a script - is it possible

    Posted 12-17-2024 10:20

    Hi Jayasri, I have just posted an answer to Sigrid Kok (above), I think I answered both your questions in there?



    ------------------------------
    Timothy Lee
    Master Data Manager
    Thermo Fisher Scientific (UK)
    ------------------------------