Thanks for the information - I do have the long text function, but only in the regular recording mode, not SAP GUI scripting.
We have managed to re-record the script to now include the language field. It seems to be successful as it picks up the data entered into the script.
Thanks for your help.
Original Message:
Sent: 06-17-2025 17:51
From: Sigrid Kok
Subject: VA01 SAP GUI Script changing text language
Hi Jody
If you have the function module installed, you can use the Add Long text option, which allows you to select one or multiple text types and input a language. Having said that, the sales order must exist to add the long text this way. It allows you to upload and download long text as one long string.
Please see the documentation here: https://help.precisely.com/r/n/Automate-Studio/Connect/Latest/en-US/Automate-Studio-with-Studio-Administrator-User-Guide/Add-Long-Text

....

If I add the header contract conditions, I see this - you must pass in the sales order number and language and then the long text.

for long text at the item level, you will pass in the same but also the item number

In my ECC system, I have a bunch of options for the header and line item texts. Ditto in S/4Hana.
Because you may have availability to promise pop-ups (ATP), as well as changing partner functions, and that can also include updating conditions and other areas that are tricky to automate, I would use a BAPI to create/maintain the sales orders, and then use a VA02 to add the long text. Here are the BAPI names for create: BAPI_SALESORDER_CREATEFROMDAT2 and update: BAPI_SALESORDER_CHANGE.
Hope this helps,
Sigrid
------------------------------
Sigrid Kok
*Precisely Software Inc.
Original Message:
Sent: 06-13-2025 11:05
From: Jody Boyce
Subject: VA01 SAP GUI Script changing text language
Hi All,
I have helped my colleagues build a SAP GUI script to place orders in VA01. The reason we used SAP GUI is so we can close down any pop-ups (regular occurrence), and select different partner functions.
We have also built in a Long text for the 'Invoice Header Text' in the order. The script works fine, but when it is run, the language of the text is defaulting to 'EN', although the sold to is set up with 'DE' language (as seen in the bottom of the screenshot). Please could you help me understand why this is happening?
I'm unable to add in an additional field to specify the text as it is SAP GUI, and we can incorporate this step at the time of recording as the language field is greyed out as it is supposed to pick up the customers default language.

I'm aware that we can create a script without using SAP GUI and add the long text feature, but we won't be able to skip through any pop-up screens as far as I'm aware.
Any suggestions and tips welcome, script attached.
Thank you.
------------------------------
Jody Boyce
Customer Account Specialist
Johnson & Johnson Vision Care - VISTAKON
United Kingdom
------------------------------