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

Fallback class

1741


What is the basic difference internal tables and database tables? : abap data dictionary

561


Explain the Inportance of pa30? : abap hr

747


If i wont like to change the standard print program where i copied standard script to customer namespace,in this case is it possible to retreive the data if u connect the script with standard program.if yes how?if no why? Is it possible to print the logo in first page only,where the form consists of 10 pages.How can u do this? How can u set a table format where it cosists of fields like cust no, custname, amount ...in a script? How do u know that the particular BADI is suitable for the existed report.How do u findout this?When do u opt for BADI OR USEREXIT?did functional people tell u to adopt BADI or USEREXIT? What is the difference between SY-INDEX & SY-TABIX ? I have a report with fields Status,time & date. the contents it consists are Status Time Date AAA 01:20:15 05-06-10 AAA 11:02:32 O3-06-10 AAA 23:11:00 05-06-10 AAA 09:14:46 05-06-10 HOW DO U WRITE A CODE TO DISLAY A ROW WHICH WAS RECENTLY EXECUTED?( for this question it should display AAA 23:11:00 05-06-10 AS Output)

2062


How many types of views are there? : abap data dictionary

554






What does an exec sql statement do in abap? What is the disadvantage of using it?

676


What is a data dictionary? : abap data dictionary

571


Write an abap program for creation of customer enquiry using BAPI 'BAPI_INQUIRY_CREATEFROMDATA'.

1767


What is processing class, where we do them and why? : sap abap hr

568


Explain sap abap 3-tier architecture?

730


could anyone tell me what r real time questions been asked in interviews?i am in urgent need..thanks in advance

1438


What are the organizational related Infotypes

1562


We have got some values for Field F1 say 1,2,3,4 and F2 say 10,10,10,10.Now can you tell me what would be the output for F1 if we use At End Of event?and what would be the output for F2 if we use At Last event?Also i want to know what is the difference between Total calculation for At end event and grand total for At last event???

1676


Explain Singleton class

833


Explain get pernr concept when we use logical data base? : abap hr

744