Skip to Content
Technical Articles
Author's profile photo Muhammad Ashar Azhar

How to enabale ALV grid display in MB5B in S4 HANA

There is an old requirement from functional side and end users for having MB5B in ALV grid display format. “Is it possible to display the result of transaction MB5B as ALV gird ?”

In this blog I will discuss the steps needed to enable ALV grid display format for tcode MB5B in S4 HANA.

Output of MB5B is as follows without “Output as ALV Grid” indicator.

Tcode%3A%20MB5B

Tcode: MB5B

Solution:

To enable option of “Output in ALV Grid”. You have to activate the  business function.

“LOG_MM_OPTIMIZATIONS” and BADI “MM_UI_OPTIMIZATIONS”.

Details is available in sap note.

2998335 – Activate “Output as ALV Grid” indicator in MBLB – SAP ONE Support Launchpad

After completing these steps output will be as follows showing “Output in ALV Grid” option.

Tcode%3A%20MB5B%20with%20Output%20as%20ALV%20Grid

Tcode: MB5B with Output as ALV Grid

 

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      It's "enable".

      The instructions in the note are very short:

      • This selected checkbox "Output as ALV Grid" is available on the selection screen only if Business Add-In (BAdI) MM_UI_OPTIMIZATIONS is active.
      • You can activate it in the Customizing (Materials Management -> General Settings for Materials Management -> BAdI: Activate MM UI-Related Performance Optimizations).
      • The BAdI is only available in the Customizing if reversible business function LOG_MM_OPTIMIZATIONS is activated.
      • With this indicator you will be able to run the report on the background with ALV display format.

      I'm honestly not sure why this needs to be complicated and couldn't just be included by default. It's still an option on selection screen. If someone doesn't want it, they won't use it.

      Author's profile photo Md. Uzzal
      Md. Uzzal

      Thanks a lot for your effective solution.

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      To make it clear, it's not my solution, I just copy-pasted from the SAP note. For some reason the author didn't do that and not everyone has S-user to access SAP Notes all the time.

      Glad you found it useful. Thanks!

      Author's profile photo Bharath Padmanabhan
      Bharath Padmanabhan

      Exactly what I was looking for my requirement. Thank you so much for this post. Extremely helpful.

      Author's profile photo Muhammad Ashar Azhar
      Muhammad Ashar Azhar
      Blog Post Author

      Thanks

      Author's profile photo Bharath Padmanabhan
      Bharath Padmanabhan

      Hi Muhammad,

      I activated the BADI and Business function. I see output as ALV grid checkbox now.

      This is my observation of standard SAP code and system behavior:

      If we simply select the output as ALV grid checkbox, it does NOT show the output as ALV grid. It still shows the output as List.

      In order to show the output as ALV Grid, we have to additionally select the "Total Only - Non - Hierarchical Representation checkbox. ONLY if both the checkboxes are selected, output comes as ALV grid.

      Both%20checboxes%20selected

       

      Output looks like this:

      ALV%20Grid%20display

      ALV Grid display

      I figured this out by debugging the standard code for MB5B when I noticed that we need to enable this checkbox. Not sure if I am doing anything incorrectly. My question is - When this is not mentioned in the SAP Note, why is the code only showing ALV grid output when the Totals checkbox is checked?

       

      Author's profile photo Bharath Padmanabhan
      Bharath Padmanabhan

      If we look at line 1396 of report RM07MLBD, we will see if else statement.

      This is where, standard code checks if the totals logic should be applied or not.

      Scenario 1: Execute the report by selecting only the ALV grid checkbox.

      We will see that code will execute line no 1414 in report RM07MLBD which is nothing but displaying the output as List.

      Scenario 2: Execute the report by selecting ALV grid as well as Totals checkbox.

      We will see that code will execute line no 1406 in report RM07MLBD which is nothing but displaying the output as ALV Grid.

      So based on my understanding, we have to select Totals checkbox in combination with ALV grid checkbox.

      Experts - Please correct me if this understand is wrong.

      Thanks

      Bharath