First time on screen: I am simplifying transaction IW41 and I need to execute an InputScript the first time the screen appears. What is the best way to do this?

Use the system variable V[_transactionid]:

// first time on this screen?

if not V[_transactionid=&V[IW41_transactionid]

  Set V[IW41_transactionid] "&V[_transactionid]

  // Read additional data

  Enter "/8" process="IW41_read_data.txt"

  // You may terminate the script with a "Stop" command

  // since the screen is not yet displayed

  Stop

endif

// main part of script

// ...