Based on certain condition how can we show different columns in output of ALV?? For Ex if Condition A is met we need to show 1 5 and 7 column , If condition B is met we need to show 1 2 and 4 and if condition C is met we need to show 1 3 and 6.

Answer Posted / ambareesh.j28

Everything what you asked for lies in the field catalog. Let us assume there are totally 7 fields (A to G) , and 3 conditions (X,Y,Z). So your code should be something like this:

If X, Pass A,C,D fields to field catalog.
elseif Y, Pass B,C,G fields to field catalog.
elseif Z, Pass E,F,G fields to field catalog.
endif. 

Use the function modules REUSE_ALV_LIST_DISPLAY / REUSE_ALV_GRID_DISPLAY to execute the output and view it. 

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the attributes of a field that can be activated or deactivated during runtime?

566


Can a constructor be redefined?

922


What is the use of 'for all entries'?

604


How to call transaction in session method without recording?

1552


What is direct input method ?

1478






Does sap handle multiple currencies?

611


How do you set up background jobs in sap? What are the steps?

538


How many types of views are there ?

647


what next in SAP-ABAP/4 is it going to be change?

1659


Advantages and disadvantages of different types of bdc's?

579


Power is interrupted while transferring data from internal table to application server. How will you determine many records are transferred in session method and call transaction method? : abap bdc

694


What are the types of indexes in abap?

608


What does the insert statement in extract datasets do? : abap modularization

586


When a function module is activated syntax checking is performed automatically. State yes or no. : abap modularization

617


What are Pull and Push Methods?

1778