When we are executing transaction MB51 in background using a variant, which determines a flat list display and a layout, the layout is ignored during the printing. it might be the result in missing columns on the output.
You are having the above issue because the standard system behavior of reporting tools is different in online transactions and background execution. While the online transactions can use the layouts entered on the selection screens, printing reports ran in background always tend to use the standard layout for display purposes.
To resolve the issue please follow the below steps:
It is possible to change the default standard layout to any existing layout, which was created for the transactions "Flat List" displays. After applying this change the background execution will always use the selected layout for output purposes.
The default standard layout can be changed through the following steps:
- Open transaction MB51
- Enter selection criteria for a set of Material Documents
- Choose "Flat List" in the "Display Options" section
- Run the transaction online
- Go to Settings / Layout / Administration...
- Select the row of the preferred layout
- Define default setting (Shift+F8)
- Save your changes
During the next background execution of the transaction, the recently set default standard layout will be used. The setting can be reverted to the SAP standard layout by selecting the activated layout and pushing the "Define default setting" button again.
Selection example (transaction MB51):
Spool list display example (transaction SP01):