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 is a fall back class?

1015


Some Realtime Examples on Exits .

1713


What is the differences between structure and table in the data dictionary in abap?

605


How will you find manager of an employee

848


What are the different types of data dictionary objects? : abap data dictionary

673






Can a filed occur in several field groups? : abap modularization

651


Which infotype records can not be deleted ? : abap hr

602


What is a subroutine?

590


Setting up a BDC program where you find information from?

650


What are the different types of luws. What are they?

622


What is a size category?

665


What are the components of selection table?

608


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

1644


What are the differences between a database index and a match code? : abap data dictionary

643


In which time constraint does the infotype records depend on the subtype ? : abap hr

629