2009 Jan 02 6:56 AM
hi,
i hav writeen a programm which is as follows.......
REPORT ZMALV1.
.
type-pools : slis.
tables: vbap,
vbak,
mara.
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
end of itab.
data: alv_fieldcat type slis_t_fieldcat_alv.
********************************************
* selection screen declaration
********************************************
selection-screen: begin of block abc with frame title text-001.
select-options: vb for vbak-vbeln.
select-options: erd for vbak-erdat .
selection-screen: end of block abc.
start-of-selection.
perform get_data.
perform display.
form get_data.
select * from vbak into corresponding fields of table itab
where vbeln in vb.
endform.
form display.
perform fieldcat_init using alv_fieldcat .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = 'sy-repid'
it_fieldcat = alv_fieldcat
i_callback_user_command = 'user_command'
tables
t_outtab = itab.
endform.
form fieldcat_init using p_alv_fieldcat type slis_t_fieldcat_alv .
data: is_fieldcat type slis_fieldcat_alv.
is_fieldcat-fieldname = 'vbeln'.
is_fieldcat-outputlen = 25.
is_fieldcat-seltext_L = 'oreder no.'.
is_fieldcat-just = 'L'.
append is_fieldcat to alv_fieldcat.
clear is_fieldcat.
is_fieldcat-fieldname = 'erdat'.
is_fieldcat-outputlen = 25.
is_fieldcat-seltext_L = 'Document date'.
is_fieldcat-just = 'L'.
append is_fieldcat to alv_fieldcat.
clear is_fieldcat.
ihav written a very similar prgramm with larger fields n selections that programm is runing but when im running this program im getting an run time error-'' you attempted to access an unassigned field symbol."
plz help y dis is so?
n if so where should i define a field symbol?
thnks n regards
mukesh
2009 Jan 02 7:00 AM
Hi,
All the field names should be in CAPITAL lettes and also same as in internal table.
hi,
i hav writeen a programm which is as follows.......
REPORT ZMALV1.
.
type-pools : slis.
tables: vbap,
vbak,
mara.
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
end of itab.
data: alv_fieldcat type slis_t_fieldcat_alv.
********************************************
* selection screen declaration
********************************************
selection-screen: begin of block abc with frame title text-001.
select-options: vb for vbak-vbeln.
select-options: erd for vbak-erdat .
selection-screen: end of block abc.
start-of-selection.
perform get_data.
perform display.
form get_data.
select * from vbak into corresponding fields of table itab
where vbeln in vb.
endform.
form display.
perform fieldcat_init using alv_fieldcat .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = 'sy-repid'
it_fieldcat = alv_fieldcat
i_callback_user_command = 'user_command'
tables
t_outtab = itab.
endform.
form fieldcat_init using p_alv_fieldcat type slis_t_fieldcat_alv .
data: is_fieldcat type slis_fieldcat_alv.
is_fieldcat-fieldname = 'vbeln'.
is_fieldcat-outputlen = 25.
is_fieldcat-seltext_L = 'oreder no.'.
is_fieldcat-just = 'L'.
append is_fieldcat to alv_fieldcat.
clear is_fieldcat.
is_fieldcat-fieldname = 'erdat'.
is_fieldcat-outputlen = 25.
is_fieldcat-seltext_L = 'Document date'.
is_fieldcat-just = 'L'.
append is_fieldcat to alv_fieldcat.
clear is_fieldcat.
ihav written a very similar prgramm with larger fields n selections that programm is runing but when im running this program im getting an run time error-'' you attempted to access an unassigned field symbol."
plz help y dis is so?
n if so where should i define a field symbol?
thnks n regards
mukesh
2009 Jan 02 6:58 AM
Hi,
The error is because of this.
is_fieldcat-fieldname = 'vbeln'.
is_fieldcat-fieldname = 'erdat'.
the fieldname should be in Capital letters.
eg is_fieldcat-fieldname = 'VBELN'.
and so on.
regards,
Santosh Thorat
2009 Jan 02 7:00 AM
Hi,
All the field names should be in CAPITAL lettes and also same as in internal table.
2009 Jan 02 7:02 AM
Hi,
Try to pass the values in Upper case, when u hard-code ('USER_COMMAND' not 'user_command').
Hope it helps!!
Regards,
Pavan
2009 Jan 02 7:11 AM
Hi,
The values like fieldname should be passed to fieldcat in quotes should be CAPITAL.
YOU HAVE PASSED IT AS BELOW:
is_fieldcat-fieldname = 'erdat'.
is_fieldcat-outputlen = 25.
is_fieldcat-seltext_L = 'Document date'.
is_fieldcat-just = 'L'.
append is_fieldcat to alv_fieldcat.
clear is_fieldcat.
THE CORRECT WAY IS:
is_fieldcat-fieldname = 'ERDAT'.
is_fieldcat-outputlen = 25.
is_fieldcat-seltext_L = 'Document date'.
is_fieldcat-just = 'L'.
append is_fieldcat to alv_fieldcat.
clear is_fieldcat.
Hope this will work.
2009 Jan 02 7:46 AM
Hi ,
If you pass uppercase to the parameter <fieldname> of the field catalog this issue will be resolved mostly.
Regards,
Radhika.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |