Application Development and Automation 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: 
Read only

Alignment in ALV

Former Member
0 Likes
708

Hi All,

Greetings!!!

I am working an ALV report in which am asked to display the soem of the column headings right align and some left. I need to display calcuated quantities in one column where the negative values should be printed with in the braces... Eg: -2000.000 should be displayed as (2,000.000) and psotive values 1,000.000 default.

Please help me out on this....

Regards,

Kalam.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
669

sorry, bad post. Please erase

Edited by: Gustavo Campanelli on May 7, 2009 3:44 PM

Hi All,

Greetings!!!

I am working an ALV report in which am asked to display the soem of the column headings right align and some left. I need to display calcuated quantities in one column where the negative values should be printed with in the braces... Eg: -2000.000 should be displayed as (2,000.000) and psotive values 1,000.000 default.

Please help me out on this....

Regards,

Kalam.

4 REPLIES 4
Read only

Former Member
0 Likes
669

Hi,

I doubt you can do anything with the column headings, as for your second requirement, you can probably think of moving your values to a character field, as you cannot do for fields with numeric types, and then displaying them by converting it as per your rules. i.e brackets for negatives. before displaying them in the alv.

Read only

0 Likes
669

Hi,

Thanks for an immediate response....

I have used the same for negative values and am able to display the same. But my requirement is for +ve values, I need to display the values with commas(,). eg: 2,000.000. If I declare a quantitty variable in my final Internal table for quantity field, it gives dump as I cannot move character value (1000.000) in to quatity field. If I declare a character field, I cannot display quantity value as 2,000.000 ( if it is +ve). It gets displayed as 2000.000.

Need your guidance...

Regards,

Kalam.

Read only

Former Member
0 Likes
670

sorry, bad post. Please erase

Edited by: Gustavo Campanelli on May 7, 2009 3:44 PM

Read only

Former Member
0 Likes
669

Experiment a little with the abap instruction write anything to textvar, this way you can write formated data to a text variable, then modify it as you like before sending it to the alv.

About the alingment issue, check the catalog definition and modify the fields as you need with the field just, where R stands for right L for left and C for centered. If your catalog is called it_fieldcat, for example, and a workarea is defined as wa_fieldcat, then you should loop and change wa_fieldcat-just for the fields you need. Of course, this is for authomatic catalog creation, for manual creation just modify just in the needed fields.