Hi Matthias
Nice job on the initial script with the loop!
For that message, I believe you're missing document date, which is also required. Posting date defaults, but document date does not - at least in my system.

It's in the recording but not "enabled" so that you can map it.

However, you are trying to swap company code prior to entering the dates, and SAP gets mad about that and throws an error. So I suggest you enter the dates first, then swap company codes
One other thing to consider for this tcode. There are settings in FB50 that could cause a pop-up for company code when the tcode starts.

some users may have this option checked

it causes this pop-up at the start of the tcode

this can affect others running the script successfully.
Best practice is to record with the pop-up and then use a skip if not found property to ignore the pop-up in the script if it doesn't happen. So I modified your script:
- I added the pop-up with skip if not present checked, mapping to the same company field
- I reordered the first part - entering both posting and document dates after the pop, then clicking company code to swap company codes

Modifications made to your script attached. Please be sure to map document date to where you want to it go, next to posting date.
Hope this makes sense.
Best Regards,
Sigrid
------------------------------
Sigrid Kok
PSE | Winshuttle NA
------------------------------
Original Message:
Sent: 07-01-2021 07:11
From: Matthias Lautenschlaeger
Subject: Please enter a valid Date
Hi Community, i'm new here, and as well in winshuttle. Im not that experienced guy. So please forgive me if i'm asking sometimes stupid questions :)
At the moment im trying to get my FB50 transaktion running, and in debug mode it works more or less, but when running i get the message please enter a valid date. The date is valid as far as i can see. im desperated and i ran the script now felt like 100 times in debug, but i didn't get the clue whats wrong in my script. Any idea what i have done wrong or could be the reason. I attach the script and hope someone can tell me what im searching for :)
Thx in advance
Matthias
------------------------------
Matthias Lautenschlaeger | PLM Assistant
GSI Helmholtzzentrum für Schwerionenforschung GmbH | +49 6151 71xxxx
------------------------------