Hi Phil -
When you say there's no error when running through the inputs manually you just mean directly in SAP, correct? Not if you run it in Debug mode? In Debug mode it stops at line 30?
It seems that in your script lines 28/29 is something that says "Display text immediately". I don't know what that screen is, I do not get a similar screen on my system when I try to replicate. If that is something that only shows up sometimes you could skip that screen.

Thanks!
------------------------------
Jennifer Hwang | SE
Winshuttle North America
------------------------------
Original Message:
Sent: 05-12-2021 06:56
From: Phil Godshalk
Subject: VA01
I have scripted VA01 to create credit/debit memos with "create with reference", in this case the billing doc. The script works flawlessly if "copy" button is selected; however, if "Item Selection" path is followed to select only individual lines and which are then copied the script fails.
The error is:

I am attaching the script. It stops at line 30 screen SAPMV45A - 4001. There is no error screen when running through the inputs manually.
Needless to say, scripted work-arounds are painful.
Thanks,
Philip Godshalk
CONFIDENTIALITY NOTICE: This email and any attachments are for the
exclusive and confidential use of the intended recipient. If you are not
the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.