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: 

Alignment is not proper in ALV header disply

Former Member
0 Kudos

Hi i'm trying to display the values in header of Alv Grid report using the following code

  • Fiscal Year

move text-006 to ls_line-info+0(30).

move p_gjahr to ls_line-info+31(29).

  • ls_line-info+0(30) = text-006.

  • ls_line-info+31(29) = p_gjahr.

  • CONCATENATE text-006

  • p_gjahr

  • INTO ls_line-info.

APPEND ls_line TO lt_top_of_page.

the values r displaying like fiscal year:2006

i want to display like fiscal year : 2006

Period : 5

In my internal table i'm able to see the correct format what i want..but while displaying its not.any idea..

i want to fix the postion of col.hope i'm explaining my prob clear.

10 REPLIES 10

Former Member
0 Kudos

Kumar,

U r not that clear in your question.

-Naveen

Former Member
0 Kudos

Hi Kumar

If I understand you correctly, I think the the following should work:

I Assume text-006 = 'fiscal year :'

CONCATENATE text-006 p_gjahr INTO ls_line-info SEPARATED BY space.
APPEND ls_line-info TO lt_top_of_page.

NB space will put a space between the variables being concatenated but you can use any variable in there eg for a comma separated list etc.

Hope that helps.

Andy

Message was edited by: Andrew Wright

In addition to this rather than trying to use offsets to position the text within the variable, you could use the SHIFT command as follows:

SHIFT ls_line-info RIGHT DELETING TRAILING space.

If you insert this between the CONCATENATE and APPEND statements above it should right-justify the text within the ls_line variable.

Kind regards

Andy

Former Member
0 Kudos

hi,

wat r u passing to ls_info-key???

thnaks,

priya.

0 Kudos

not passing anything to info-key.

i want to write like fiscal year : 2006

not fiscal year:2006

not only this case everything i want to write as

field name should start 0 postion and value should start 30 pos..

0 Kudos

my output should like this

fiscal year :2006

period :3

Company code :1000

field name should start 0 pos and field value should start 30 pos

0 Kudos

OK, so you need there to be a much bigger gap between the field name and the value. I can't see any reason why your code wouldn't work using offsets. I've tried a simpler version here without appending to a table and as long as the field you are putting the data in is big enough it seems to work. I can only think that somewhere along the line the field is getting condensed so there are no spaces. If this is not explicitly stated in your code though, I can't think why it would just happen.

Do you at any point use the CONDENSE keyword on the contents of the info field? It is probably worth using the ABAP debuigger to view the nctents of the field as the program runs. You can then check that the field holds the correct data from the very beginning and see at which point it changes.

Andy

0 Kudos

no i'm not using condense.anyway i tried with this option

move 'Fiscal Year' to ls_line-key.

move p_gjahr to ls_line-info.

APPEND ls_line TO lt_top_of_page.

its working fine

0 Kudos

Glad you got it sorted Kumar.

Something weird does seem to happen when the variable containing the offset values is appended to a table - not sure what exactly. However, I shall stop worrying about it now!

Kind regards

Andy

0 Kudos

THANKS ANDY..TAKECARE

Former Member
0 Kudos

kumar,

u may also follow this thread.

<b>How To Create Header in ALV List Report</b>

-Naveen.