Hi Automate Community!
This week's tip is about "No Batch Input for screen XXXX nnnn" errors that occur when running transaction scripts. These errors are fairly frequent and can be a source of frustration, especially because they don't offer any explicit information about what went wrong during the run. In this tip I'll try to help you identify the possible causes and how to debug these errors.
First of all, these errors occur because the sequence of screens when running a script is different to that of the original recording and SAP is displaying a screen that either did not appear in the recording or appears in a different place in the sequence. The error basically means that the script doesn't have any data for the particular screen being processed and therefore the run terminates.
There are several reasons as to why a screen is being requested by SAP which was not a part of the original recording, but speaking in very broad terms, they can all be reduced to two main reasons:
- Something in the data is causing an unexpected window to popup or screen to appear
- SAP configuration and options unrelated to our data
1. Something in the data is causing an unexpected window to popup or screen to appear
In this case, it is our data which causes the screen sequence to be different to that in the script. In other words, when we originally recorded the transaction with a specific set of data, SAP presented us with a particular sequence of screens. When running the script for another set of data, SAP is presenting a different sequence of screens. The error occurs because SAP doesn't find any input data in the script for the screen it is currently on, and the transaction is terminated.
Here are some brief examples to better understand this:
- FI: When posting a document, a particular type of GL account may prompt a window for additional Cost object or PA fields that other GL accounts don't request.
- MM: When creating a material, a particular Material Type will display a material view that a different Material Type doesn't display
- SD: For Sales Orders, a customer with multiple partners will prompt an additional partner selection window whereas customers with a single partner will not
In all of these examples, the original recording may not have contemplated every different scenario required and is limited to specific types of data.
Solving these errors normally involves the following steps:
- Identify exactly what it is about the data that is causing the difference in screen sequence
- Include the differing screens in the original recording by:
o Creating a new "mini" recording that captures the extra screens and cutting and posting them to the original recording, or:
o Manually creating the extra screens
- Create IF Conditions around the screen, or use a skip screen indicator on that screen.
If we can easily predict, based on the data, when the extra screens will occur, it is best to use an IF condition. E.g. IF GL account starts with 4, then process the extra Cost Object window. In this case, SAP configuration rules drive whether the extra window appears or not.
If it is harder to predict, a skip screen indicator may be sufficient. E.g. if we cannot easily know which customers have multiple business partners because there are many customers and their related business partners may be created or deleted every day, then a skip screen on the Partner Selection window will process the customer whether or not the extra screen appears.
To identify what about the data is causing the error, the easiest way is to debug the script screen by screen and see exactly where the script is failing. In other words, let's identify the screen that is disrupting the expected sequence. I'll show this in depth with the following example:
When creating a vendor, SAP will display a popup requesting to confirm the address if another vendor with the same address or name already exists in SAP. If the original script recording did not include this popup, you will get a "No batch input for screen (SAPMF02K 1050 Vendor master: window for duplicates)" error for any vendors that happen to have the same address as an existing vendor in SAP.
I have a simple vendor creation script that I recorded which enters XK01 and:
-Enters the vendor number, company code, Purchasing Org and Account group

- Enters the vendor's name and address in the Address tab and proceeds to the next tab (Control)

- Leaves the Control tab blank and proceeds to the remaining tabs and saves.
- 
-
When I try to run the script for several different vendors, most of them are created but I receive the error for vendor DD75753:

When I debug that row, I will see that the script correctly processes the first screen:

I know this because the values for this screen are being entered (and are in red), and especially because the OK-Code popup has appeared. This popup includes the OK Code (which corresponds to the button/key used in that screen) and allows me to debug to the next screen in the sequence:
It also processes the second screen (Address tab correctly)

However, when I reach the next step, where I should be reaching the Control tab, I see this instead:

I am seeing the Vendor: Display duplicates popup which I did not include in my original script. Also, the Ok Code popup has disappeared, which means that I cannot advance. SAP is expecting some information for this screen, which is not included in my script, and therefore the run is stopped.
In the Expert view of my script, I see the following:

The script is erroring out between the "SAPMF02K – 111 Customer Master: General Data, CAM Address, Communication" screen and the "SAPF02K – 120 Vend. Mastr: general Control Data" because for this particular vendor, SAP is displaying another screen that I didn't encounter in my original recording and therefore isn't expected in the script.
In this example, this might actually be my intended outcome, in other words I don't want my script to create any vendors that match a vendor which is already in SAP. In that case I would leave the script as it is, and it will continue to error for any vendors that already exist in SAP. I may want to "translate" or transform the error so that the end user receives a more intuitive message. How to do this has been covered in Sigrid's excellent Tip of the Week here.
However, let's assume that I do want to be able to create a new vendor with the same address as an existing vendor and therefore I need my script to correctly process this screen and continue with the remaining screens. In this case I would need to add the screen to my script in the correct place in the sequence, making sure it includes the green check mark button.
The easiest way to do this is by creating a new recording, using a vendor which will prompt the duplicate window. It doesn't have to be a complete recording, just enough to make sure the window and green check mark are recorded and then copy/paste it to my existing script. Once included in the script, I would mark it with a skip screen indicator to make sure that the script correctly processes vendors that prompt the window as well as vendors that don't.
The end result of the script would look like this:

Where there is a new screen between the Address and Control screens, which has the Skip Screen Indicator enabled.
2. SAP configuration and options unrelated to our data
The second major cause of No Batch Input errors is due not to data present in our template, but to different behaviors in SAP itself.
Stored values for first record
One clear example is tcodes which "remember" values from the first record and then use them by default for subsequent records.
Identifying the cause of these errors can be simple because the same error message will be repeated for all rows except for the very first one in a run:
Some examples are:
FI: FB50, FV50, FB60 may display a select Company Code window as the very first step in the tcode when posting a document. This window doesn't appear for the next documents since SAP stores the Company Code used in the first one and uses it for the next ones. Similarly, this happens with CO tcodes and others like MIRO.
MM: When creating or updating a material in MM01/MM02, the Classification tab will display a popup for the first material which is then suppressed for the remaining materials.
In any case, debugging the script for at least 2 records in a row should allow us to find the differing screen.
SAP user settings
SAP user setting can also cause the screen sequence to be different to that in the original script. Different users may have different user parameters or settings in the same SAP server, and the same user may have different parameters or user settings in different servers such as QA and PRD.
For example, in the case of FI documents, whether or not the Company Code popup appears at all can be controlled by a user setting. If the user that recorded the script has the "No Company Code proposal" option checked, then the script will include the popup. When providing the script to an end user with the option unchecked, the script will cause a No Batch Input error.

Similarly, other user options such as saved default values in the Material View selection screen can cause errors like this.
In summary, No Batch Input errors are triggered where a screen is encountered during a run which was not expected in the script. In other words, SAP presents a different sequence of screens to that in the original recording. This can either be because something in the data we are uploading is causing an unexpected screen or window to appear, or because of behavior, user setting or feature in SAP itself. In all cases, the bast way to solve these errors is to debug the script step by step, for at least two records. This should allow us to discover at what point the error is occurring and whether it can be solved by adding IF conditions or Skip Screens to our script. If the error is desirable, it's wording can be changed using the transform function to make it clearer to the user.
Have a great week!
------------------------------
Daniel del Val
SE
*Precisely Software Inc.
------------------------------