2009 Aug 21 6:00 PM
HI
i am using ALV_BLOCK_LIST_APPEND, in that the fieldcatalog has fileds as
f1 f1 f3
and the itab which is paased in the ALV
contains values as
f1 f2 f3
1 2 3
4 5 6
but during the display the o/p is coming as header
f1 f2 f3
the corrosponding values are not shown
please help
HI
i am using ALV_BLOCK_LIST_APPEND, in that the fieldcatalog has fileds as
f1 f1 f3
and the itab which is paased in the ALV
contains values as
f1 f2 f3
1 2 3
4 5 6
but during the display the o/p is coming as header
f1 f2 f3
the corrosponding values are not shown
please help
2009 Aug 22 8:30 PM
Hi ,
The values are not geting transferred from the internal table .
Can you paste your code so that the error can be detected.
Else you can debug your program and see why the values are not getting transferred to the internal table .
you can also refer to the Alvaro's blog on List display.....
/people/alvaro.tejadagalindo/blog/2006/11/27/dynamic-alv-list-display
Hope this helps you .
Thanks and Regards
Aditi Wason
2009 Aug 23 7:28 PM
HI
as i have said there is no problem in the internal table , in the internal table infact the values are correctly populated, but its not coming in display, so cant understand the issue
2009 Aug 23 7:43 PM
2009 Aug 24 6:57 AM
2009 Aug 24 8:25 AM
Hi,
take the sample code... its tested and is working perfectly fine.... you can use this example in your code solve your issue... it replicates your issue to some extent...
TYPE-POOLS : slis.
DATA : BEGIN OF wg_field_form,
field1 TYPE char30,
field2 TYPE char30,
field3 TYPE char30,
END OF wg_field_form.
DATA i_field_form LIKE TABLE OF wg_field_form.
DATA wa_print TYPE slis_print_alv.
DATA : wa_fieldcat1_slis TYPE slis_fieldcat_alv.
DATA : lt_fieldcat1_slis TYPE slis_t_fieldcat_alv.
DATA ls_layout TYPE slis_layout_alv.
DATA t_events TYPE slis_t_event.
DO 10 TIMES.
wg_field_form-field1 = sy-index.
wg_field_form-field2 = 2 * sy-index.
wg_field_form-field3 = 3 * sy-index.
APPEND wg_field_form to i_field_form.
ENDDO.
wa_fieldcat1_slis-col_pos = '1'.
wa_fieldcat1_slis-fieldname = 'FIELD1'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = 'FIELD1'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
2009 Aug 24 8:26 AM
wa_fieldcat1_slis-col_pos = '2'.
wa_fieldcat1_slis-fieldname = 'FIELD2'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = 'FIELD2'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '3'.
wa_fieldcat1_slis-fieldname = 'FIELD3'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = 'FIELD3'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
*call the initial function module
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat1_slis
i_tabname = 'I_FIELD_FORM'
"'i_field_form'
it_events = t_events
* IT_SORT =
* I_TEXT = ' '
TABLES
t_outtab = i_field_form
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
wa_print-reserve_lines = 1.
*
* *display the data
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = wa_print.Regards,
Siddarth
2009 Aug 24 8:39 AM
hi
I HAVE USED THE SAME LOGIC , EXCEPT THE PART DO 10 TIMES. wg_field_form-field1 = sy-index. wg_field_form-field2 = 2 * sy-index. wg_field_form-field3 = 3 * sy-index. APPEND wg_field_form to i_field_form. ENDDO.
but just to see it even if i put it same way in my code its creating in output so many lines but output is not coming.
please help
2009 Aug 24 8:44 AM
there were certain lines which I had changed and those lines you had commented actually... just copy and paste the complete code removing the do 10 times......enddo.....
copy and paste the code with the call function part also......
and then see if it works or not... if it does not....
copy the complete code in a new program and then check if it works... if it works then compare both the prog line by line....
Regards,
Siddarth
2009 Aug 24 8:47 AM
Hi,
Try to change your code like below.
I hope that it solves.
Thanks
Venkat.O
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout1
it_fieldcat = lt_fieldcat1_slis
i_tabname = 'I_FIELD_FORM' "Instead of 'i_field_form'. Capital letters in quotes not small letters
it_events = t_events
* IT_SORT =
* I_TEXT = ' '
TABLES
t_outtab = i_field_form
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
2009 Aug 24 8:55 AM
hi
I DID THE SAME BUT ITS OF NO USE, its still in the same stage. no output
2009 Aug 24 9:05 AM
HI
see the basic idea of cretaing i_field_form is it should have data, i am seeing data inside it but its not getting populated, i copied your program in a new one and saw its wroking but when i implement it in my program i_field_form contains values but it cannot connect with fieldcatlaog i suppose.
2009 Aug 24 9:11 AM
Hi,
did you paste the code which i had given in my previous ex. if not... just paste this and comment your code of appending fieldcatalog....
wa_fieldcat1_slis-col_pos = '1'.
wa_fieldcat1_slis-fieldname = 'FIELD1'.
wa_fieldcat1_slis-tabname = 'I_FIELD_FORM'.
wa_fieldcat1_slis-seltext_l = 'FIELD1'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '2'.
wa_fieldcat1_slis-fieldname = 'FIELD2'.
wa_fieldcat1_slis-tabname = 'I_FIELD_FORM'.
wa_fieldcat1_slis-seltext_l = 'FIELD2'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '3'.
wa_fieldcat1_slis-fieldname = 'FIELD3'.
wa_fieldcat1_slis-tabname = 'I_FIELD_FORM'.
wa_fieldcat1_slis-seltext_l = 'FIELD3'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.Regards,
Siddarth
2009 Aug 24 9:34 AM
hi
thats ok, but the 1st row of itab i_field_form should come as a header of ALV, and from the second row the content should follow with correspondence with the 1st row.
2009 Aug 24 9:41 AM
now copy and paste this code completely.....
READ TABLE i_field_form INTO wg_field_form INDEX 1.
IF sy-subrc = 0.
wa_fieldcat1_slis-col_pos = '1'.
wa_fieldcat1_slis-fieldname = 'FIELD1'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = wg_field_form-field1.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '2'.
wa_fieldcat1_slis-fieldname = 'FIELD2'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = wg_field_form-field2.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '3'.
wa_fieldcat1_slis-fieldname = 'FIELD3'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = wg_field_form-field3.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
DELETE i_field_form INDEX 1.
*call the initial function module
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat1_slis
i_tabname = 'I_FIELD_FORM'
"'i_field_form'
it_events = t_events
* IT_SORT =
* I_TEXT = ' '
TABLES
t_outtab = i_field_form
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
wa_print-reserve_lines = 1.
*
* *display the data
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = wa_print.
ENDIF.
2009 Aug 24 10:08 AM
hi
Thanks a lot it solved my problem as of now,but the fieldcatalog is not dynamic, can it be made dynamic by any means
2009 Aug 24 10:53 AM
yes sure it can be made dynamic.....
DO 10 TIMES.
wg_field_form-field1 = sy-index.
wg_field_form-field2 = 2 * sy-index.
wg_field_form-field3 = 3 * sy-index.
APPEND wg_field_form TO i_field_form.
ENDDO.
READ TABLE i_field_form INTO wg_field_form INDEX 1.
DATA W_STRING TYPE STRING.
IF sy-subrc = 0.
do 3 times.
W_STRING = SY-INDEX.
CONDENSE W_STRING NO-GAPS.
concatenate 'FIELD' W_STRING INTO W_STRING.
perform field_catalog USING sy-index W_STRING.
ENDDO.
DELETE i_field_form INDEX 1.
*call the initial function module
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid .
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat1_slis
i_tabname = 'I_FIELD_FORM'
"'i_field_form'
it_events = t_events
TABLES
t_outtab = i_field_form
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
wa_print-reserve_lines = 1.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = wa_print.
ENDIF.
FORM field_catalog USING p_sy_index TYPE i
p_w_string TYPE string.
FIELD-SYMBOLS : <fs> TYPE ANY.
DATA lw_index TYPE string.
lw_index = sy-index.
CONDENSE lw_index NO-GAPS.
wa_fieldcat1_slis-col_pos = lw_index.
wa_fieldcat1_slis-fieldname = p_w_string.
wa_fieldcat1_slis-tabname = 'I_field_form'.
CONCATENATE 'WG_FIELD_FORM-' p_w_string INTO p_w_string.
ASSIGN (p_w_string) TO <fs>.
wa_fieldcat1_slis-seltext_l = <fs>.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
ENDFORM.Regards,
Siddarth
2009 Aug 24 11:12 AM
hi
since you knw that 3 coulmn are there u r using
do 3 times.
W_STRING = SY-INDEX.
CONDENSE W_STRING NO-GAPS.
concatenate 'FIELD' W_STRING INTO W_STRING.
perform field_catalog USING sy-index W_STRING.
ENDDO.
what if we dont knw how many coloumns will be there, i mean i am reading data from a file in AL11, it can have any no of data and as such the 1st line will come as column heading , so can we do something where we do not need to hardcore the coulmn no.
2009 Aug 24 11:29 AM
hi,
u can use the code given below.... in that case.... its completely dynamic and will work for sure....
FIELD-SYMBOLS : <fs> TYPE ANY.
READ TABLE i_field_form INTO wg_field_form INDEX 1.
DATA w_string TYPE string.
IF sy-subrc = 0.
WHILE 1 = 1.
w_string = sy-index.
ASSIGN COMPONENT sy-index OF STRUCTURE wg_field_form TO <fs>.
IF sy-subrc = 0.
CONDENSE w_string NO-GAPS.
CONCATENATE 'FIELD' w_string INTO w_string.
PERFORM field_catalog USING sy-index w_string.
ELSE.
EXIT.
ENDIF.
ENDWHILE.
DELETE i_field_form INDEX 1.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat1_slis
i_tabname = 'I_FIELD_FORM'
"'i_field_form'
it_events = t_events
TABLES
t_outtab = i_field_form
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
wa_print-reserve_lines = 1.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = wa_print.
ENDIF.
FORM field_catalog USING p_sy_index TYPE i
p_w_string TYPE string.
DATA lw_index TYPE string.
lw_index = sy-index.
CONDENSE lw_index NO-GAPS.
wa_fieldcat1_slis-col_pos = lw_index.
wa_fieldcat1_slis-fieldname = p_w_string.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = <fs>.
CONDENSE wa_fieldcat1_slis-seltext_l NO-GAPS.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
ENDFORM. " field_catalog
2009 Aug 23 11:07 AM
hii swarnil,
it seems that yoou didn't pass the sy-repid value in the variable V_REPID.just chk it
form DISPLAY_DATA .
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
....
rgrds,
Shweta
2009 Aug 23 7:16 PM
HI
no i have passed sy-repid in the ALV init, so that is nt the problem. please help
2009 Aug 24 6:53 AM
LOOP AT i_bdclog1 INTO wg_bdclog1.
SPLIT wg_bdclog1 AT cl_abap_char_utilities=>horizontal_tab
INTO
wg_field_form-field1
wg_field_form-field2
wg_field_form-field3
wg_field_form-field4
wg_field_form-field5
wg_field_form-field6
wg_field_form-field7
wg_field_form-field8
wg_field_form-field9
wg_field_form-field10
wg_field_form-field11
wg_field_form-field12
wg_field_form-field13
wg_field_form-field14
wg_field_form-field15.
APPEND wg_field_form TO i_field_form .
CLEAR:wg_field_form,wg_bdclog1.here i_bdclog1 contains the value of a file which is present in AL11, and the file is read and taken in an internal table
Edited by: swarnali_IBM on Aug 24, 2009 7:55 AM
2009 Aug 24 6:54 AM
READ TABLE i_field_form INTO wg_field_form INDEX 1.
IF sy-subrc = 0.
wa_fieldcat1_slis-col_pos = '0'.
wa_fieldcat1_slis-fieldname = wg_field_form-field1.
* wa_fieldcat1_slis-fieldname = 'field1'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = wg_field_form-field1.
* wa_fieldcat1_slis-seltext_l = 'field1'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '1'.
wa_fieldcat1_slis-fieldname = wg_field_form-field2.
* wa_fieldcat1_slis-fieldname = 'field2'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = wg_field_form-field2.
* wa_fieldcat1_slis-seltext_l = 'field2'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
wa_fieldcat1_slis-col_pos = '3'.
wa_fieldcat1_slis-fieldname = wg_field_form-field3.
* wa_fieldcat1_slis-fieldname = 'field3'.
wa_fieldcat1_slis-tabname = 'I_field_form'.
wa_fieldcat1_slis-seltext_l = wg_field_form-field3.
* wa_fieldcat1_slis-seltext_l = 'field3'.
wa_fieldcat1_slis-outputlen = 30.
APPEND wa_fieldcat1_slis TO lt_fieldcat1_slis.
2009 Aug 24 6:55 AM
call the initial function module
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout1
it_fieldcat = lt_fieldcat1_slis
i_tabname = 'i_field_form'
it_events = t_events
* IT_SORT =
* I_TEXT = ' '
TABLES
t_outtab = i_field_form
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
wa_print-reserve_lines = 1.
*
* *display the data
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
is_print = wa_print.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |