Resolve a "Cursor field does not exist in the screen" in a BDC Recording

Jimbo's picture

Recordings are an easy way to load data into SAP without a lot of effort or programming and they provide great way to make one-time modifications to existing data--especially to proprietary Z-fields. Producing a recording may be harder when the underlying program changes its interface by showing different fields on the screens or by changing the flow of the screens.

When producing a recording to use with SAP's LSMW the system records the first field that the cursor lands on in every screen so that the cursor can be placed on that field when the batch is executed. Many SAP programs have different fields or even different screens based on the object being changed. In many cases the field that the system wants to put the cursor in doesn't exist on some of the screens in the batch and that causes it to fail in background mode.

Missing cursor field

Unlike the SHDB transaction the LSMW recording editor provides no way to select what field the cursor lands in. In this case the system recorded the first view discription clicked: DYTXT(13). On the Select View(s) screen for materials with fewer views this field doesn't exist.
Missing field in the recording

The easiest way to fix this is to replace this value with the name of a known-good field. It need not be an editable field, but must be a field that is sure to be on the screen. There is a very strong likelyhood that DYTXT(01) will exist and that is the field chosen for this tutorial. Export the recording from the main LSMW screen by clicking on Extras→Export Project.

Click on the project to unselect all of the objects in the project and then click on the description of the recording to flag it for export. Click the export button and save to a text file.

Open the file in notepad. Search for the field that does not exist on all screens and replace it with the field that does. Save the text file and close Notepad.
Modify the recording in notepad.

Import the recording from the main screen of LSMW by clicking on Extras→Import. Select the text file that was edited to import.
Extras...Import Projects

Click on the project at the top of the hierarchy to unselect all of the objects in the project and then click the description of the recording to flag it for import. Click the import button.
Import just the recording and nothing else.

Go back into SAPs recording editor and ensure that the change is reflected in the recording. Some testing may be required, but there should be no additional effort required.
Recording with existing field.