2007 Jun 05 2:25 PM
hi,
in ALV's How to assign field width at runtime?????????
give me with example?????????
hi,
in ALV's How to assign field width at runtime?????????
give me with example?????????
2007 Jun 05 2:37 PM
You cannot do that in ALV.
Regards,
Amit
Reward all helpful replies.
2007 Jun 05 2:41 PM
2007 Jun 05 2:43 PM
And an example.
report zrich_0003 .
* Global ALV Data Declarations
type-pools: slis.
* Internal Tables
data: begin of ialv occurs 0,
test1(10) type c,
test2(10) type c,
end of ialv.
data: fieldcat type slis_t_fieldcat_alv.
start-of-selection.
perform get_data.
perform call_alv.
*********************************************************************
* Form GET_DATA
*********************************************************************
form get_data.
ialv-test1 = 'ABC'.
ialv-test2 = 'DEF'.
append ialv.
ialv-test1 = 'GHI'.
ialv-test2 = 'JKL'.
append ialv.
ialv-test1 = '123'.
ialv-test2 = '456'.
append ialv.
endform.
************************************************************************
* CALL_ALV
************************************************************************
form call_alv.
data: tmp_fc type slis_fieldcat_alv.
clear: fieldcat. refresh: fieldcat.
clear tmp_fc.
tmp_fc-reptext_ddic = 'Test1'.
tmp_fc-fieldname = 'TEST1'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '10'. " <- SPECIFY OUTPUT LENGTH
append tmp_fc to fieldcat.
clear tmp_fc.
tmp_fc-reptext_ddic = 'Test2'.
tmp_fc-fieldname = 'TEST2'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '20'. " <- SPECIFY OUTPUT LENGTH
append tmp_fc to fieldcat.
* Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
tables
t_outtab = ialv.
endform.
Regards,
RIch Heilman
2007 Jun 05 3:02 PM
form call_alv.
data: tmp_fc type slis_fieldcat_alv.
clear: fieldcat. refresh: fieldcat.
clear tmp_fc.
tmp_fc-reptext_ddic = 'Test1'.
tmp_fc-fieldname = 'TEST1'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '10'. " <- SPECIFY OUTPUT LENGTH
append tmp_fc to fieldcat.
clear tmp_fc.
tmp_fc-reptext_ddic = 'Test2'.
tmp_fc-fieldname = 'TEST2'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '20'. " <- SPECIFY OUTPUT LENGTH
append tmp_fc to fieldcat.
if user want to change the tmp_fc-outputlen to 10 for TEST2 IN RUNTIME HOW we can solve the problem?????????
2007 Jun 05 3:06 PM
2007 Jun 05 3:11 PM
ok, but if the user wants to change the outputlen to 30. how can u do it?????????
2007 Jun 05 3:13 PM
Again, he can simply manipulate the output just like you can in Excel, where you click on the side of the cell or column and drag it to the desired length. If he then always wants to see it this way, he can save the ALV layout as a variant and then he would not need to do this each time.
Regards,
Rich Heilman
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |