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: 

Problem in ALV Grid Heading

Former Member
0 Kudos

Hello Experts,

I am facing a problem when displaying the ALV heading.

I need the ouptu like this

Zusammenfassung:

Schätzpreis ungültiger Infosatz Anzahl Anteil(%)

Best. mit X - 10 10.5

Best. mit - X 10 10.5

Best. mit X - 10 10.5

Best. mit X - 10 10.5

But I am getiing the output like when I am concatnating the char fields:

Schätzpreisungültiger InfosatzAnzahlAnteil(%)

Best. mit X-1010.5

Best. mit X-1010.5

Best. mit X-1010.5

Best. mit X-1010.5

I have tried all sorts of concatenating options like separated by..

So please help me how to achieve the desired output.

Thanks in Advance,

Vasanth.M

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

Hi,

With REUSE_ALV_COMMENTARY_WRITE everything gets condensed so that you cannot have more than one space in the grid header - in the list header multiple spaces are shown.

If you do not unse REUSE_ALV_COMMENTARY_WRITE, you can pass a form routine for the online grid case with parameter I_CALLBACK_HTML_TOP_OF_PAGE:

form top_of_page using cl_dd type ref to cl_dd_document.

In this form methods of class CL_DD_DOCUMENT can be used to create den text output in HTML-format.

This allows for spaces.

Regards,

Clemens

14 REPLIES 14

Former Member
0 Kudos

hi,

just u sort that all field before passing that fields information in to that particulat function madhule.u sort information based on character field............

with regards.

m.srikanth

Former Member
0 Kudos

Hi,

Did u try using like below.

Concatenate A SPACE(3) B SPACE(3) to C.

Where A and B are variables which has data.

Regards

Rakesh

Clemenss
Active Contributor
0 Kudos

Hi,

as I learned today in the FAQs, concatenate will not remove spaces if they are included in string literals.

con catenate 'a' ` ` 'b' into c => a b

the back-quote ( `, french accent grave) encloses string literals and leading or trailing spaces are not removed from string literals. Normal single quotes (') are for character literals, ABAP removes eading or trailing spaces.

I think it's worth a try!

Regards,

Clemens

former_member181962
Active Contributor
0 Kudos

try using

concatenate....separated by ` `.

Note that these are not normal quotes. these are the quotes above the "TAB" key in your keyboard.

Regards,

Ravi

Former Member
0 Kudos

Hi Vinod,

I tested with this sample code,


data: v1 type char20 ,
      v2 type char6,
      v3 type char6,
      v4 type char50.

v1 = 'Best. mit X -'.
v2 = '10'.
v3 = '10.5'.
concatenate v1 v2 v3 into v4 separated by space .

write: / v4.

and the output is <b>Best. mit X - 10<u></u> 10.5</b>, you could observe the space between them.

Hope may be you are doing some thing else.

Regards,

Raghav

0 Kudos

Hello,

Thanks for the reply.

I need more than one space in the line

X - 10 10.5

I need the output like the above,

Vasanth

0 Kudos

Hi Vasanth,

try with this code.

data: v1 type char20 ,
      v2 type char6,
      v3 type char6,
      v4 type char50.
constants : c_space type abaptype value space .

v1 = 'Best. mit X -'.
v2 = '10'.
v3 = '10.5'.
concatenate v1 v2 c_space v3 into v4 separated by space .

write: / v4.

Regards,

Raghav

0 Kudos

Hello Raghavendra,

If the write the variable after concatenating it will show the spaces. But when I am passing the same variable into the FM <b>REUSE_ALV_COMMENTARY_WRITE</b> Iam not able to see the space.

Vasanth

0 Kudos

Any Helps....

Former Member
0 Kudos

Hi Vasanth,

I dont think you will get more than one character of space.

DATA : V_SPACE(10) TYPE C.

CONCATENATE 'VIKRANTH' 'RAJESH' INTO V_CONCATE.

wa_comment-typ = 'S'.

wa_comment-key = 'USER :'.

wa_comment-info = V_CONCATE.

append wa_comment to it_comment.

output : vikranth rajesh.

but you will not get vikranth rajesh this many spaces.

Thanks

Vikranth Khimavath

Clemenss
Active Contributor
0 Kudos

Hi,

With REUSE_ALV_COMMENTARY_WRITE everything gets condensed so that you cannot have more than one space in the grid header - in the list header multiple spaces are shown.

If you do not unse REUSE_ALV_COMMENTARY_WRITE, you can pass a form routine for the online grid case with parameter I_CALLBACK_HTML_TOP_OF_PAGE:

form top_of_page using cl_dd type ref to cl_dd_document.

In this form methods of class CL_DD_DOCUMENT can be used to create den text output in HTML-format.

This allows for spaces.

Regards,

Clemens

Former Member
0 Kudos

Hello,

COuld anybody tell me how to use the parameter <b>I_CALLBACK_HTML_TOP_OF_PAGE</b> in the REUSE_ALV_GRID_DISPLAY fm.

and the use of the method CL_DD_DOCUMENT .

Thanks in advance.

Vasanth

Clemenss
Active Contributor
0 Kudos

Vasanth,

there is a useful sample program that should help you to start:

BCALV_TEST_FULLSCREEN_STRING

Use FORM HTML_TOP_OF_PAGE. Copy it to your program and modify according to your wishes. I did not try the multiple space thing but I'm convinced it works.

Regards,

Clemens

Former Member
0 Kudos

Hello Clemens,

I am using the sample report you have mentioned in ur previous post.

It works exactly as I need.

Thank You very Much.

Vasanth