Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

converting few columns of an internal table into rows in alv report

former_member200679
Participant
0 Kudos

Hi all,

         i am facing an issue with column to rows conversion in alv report. I want to keep two columns of internal table as it is and rest to be converted to rows.

I am getting the below output in alv:

and the required output is as shown below:

I am searched online for various transpose options, but they all convert every column of the internal table to rows.

Columns serial no and date will be as it is and rest column should be converted into rows and an additional column must be added that of count sum.

I am getting the summation of count column in alv, but i require it in row form for every date.

I request you all to kindly provide a solution for this as soon as possible.

thanks,

Saurabh.

4 REPLIES 4

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Saurabh,

We can transpose the value using RTTS Method in dynamic ALV concept. Please find the link below.

For Summation, add the column(Summation) in field catalog and calculate the value date wise like normal calculation.

Regards

Rajkumar Narasimman

0 Kudos

Thanks Rajkumar for your solution. I almost achieved the desired output.

now i am getting this output:

first column is serial number, second is date , 3 to 14 column is for count of respective services and final  is total count for every services for that particular date.


But now i want those empty cells to be filled with '0' instead of just being blank showing that there was no service count for that particular date and for that particular service.



my final dynamic internal table  is <gfs_dyn_table>.


I am unable to find out where should i put a condition to fill those blank cells with zero value.



I again hope to hear a positive solution soon.


Thanks.

0 Kudos

Hi Saurabh,

If the column datatype that used here is character, then we need to loop the final internal table and fill the value for each cell by checking whether it is initial or not like below.

if <fs_value> is initial.

<fs_value> = 0.

endif.

If the column data type is integer or numeric, system will load the initial value. In ALV, if it is not showing then, we need to check the Field catalog maintained whether output type NO_OUT = 'X'. If it maintained like this, we need to remove it.

Regards

Rajkumar Narasimman

0 Kudos

Thanks a lot Rajkumar. I just included ' gw_dyn_fcat-inttype = 'I'.' in the field catalog and it worked like a charm