2009 Oct 21 11:14 AM
Hi,
I am using REUSE_ALV_LIST_DISPLAY for my ALV display.The width of the ALV varies for different inputs.
I have a header followed by sub heading.Subheading has been structured into boxes on top of the fields label using TOP OF PAGE.Is there a way to fix the right alignment of the subheading with the width of the ALV?
WRITE:/50 'heading'.
WRITE: 145 'subheading'.
WRITE: 169 SY-VLINE.
I want the value of sy-vline be adjusted as per the width of my ALV.
Please advice
Thanks.
2009 Oct 21 11:25 AM
Hi,
You can dynamically position text using the write statement -
Example
This example outputs a text field text at different positions, with different output lengths.
DATA: text TYPE string VALUE '0123456789ABCDEF',
col TYPE i VALUE 25,
len TYPE i VALUE 5.
WRITE text.
WRITE /5(10) text.
WRITE AT col(len) text.
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/db9e2335c111d1829f0000e829fbfe/frameset.htm
You would need to determine the width of your ALV before the TOP-OF-PAGE event is triggered and then pass the position value into the routine.
Kind regards, David
Hi,
You can dynamically position text using the write statement -
Example
This example outputs a text field text at different positions, with different output lengths.
DATA: text TYPE string VALUE '0123456789ABCDEF',
col TYPE i VALUE 25,
len TYPE i VALUE 5.
WRITE text.
WRITE /5(10) text.
WRITE AT col(len) text.
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/db9e2335c111d1829f0000e829fbfe/frameset.htm
You would need to determine the width of your ALV before the TOP-OF-PAGE event is triggered and then pass the position value into the routine.
Kind regards, David
2009 Oct 21 11:25 AM
Hi,
You can dynamically position text using the write statement -
Example
This example outputs a text field text at different positions, with different output lengths.
DATA: text TYPE string VALUE '0123456789ABCDEF',
col TYPE i VALUE 25,
len TYPE i VALUE 5.
WRITE text.
WRITE /5(10) text.
WRITE AT col(len) text.
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/db9e2335c111d1829f0000e829fbfe/frameset.htm
You would need to determine the width of your ALV before the TOP-OF-PAGE event is triggered and then pass the position value into the routine.
Kind regards, David
2009 Oct 21 11:29 AM
HI David,
Thanks for the prompt reply...I am sure your suggestion is just fine,but how will i determine the width of ALV before event top of page is triggered?
Thanks.
2009 Oct 21 11:43 AM
Hi,
In the example you would need to determine the length manually and the position value would be in variable LEN.
I am not sure of your criteria for the width your ALV however it could be that you calculate the length of fields in your internal table before it is output and perhaps take the maximum value? You can use the in built method STRLEN for example to work out the length of a data object.
Regards, David
2009 Oct 21 11:50 AM
Thanks
Will confirm with client for the correct length option.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |