Application Development and Automation 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: 
Read only

help about alv

Former Member
0 Likes
822

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
799

Hi,

All the field names should be in CAPITAL lettes and also same as in internal table.

Hi,

All the field names should be in CAPITAL lettes and also same as in internal table.

5 REPLIES 5
Read only

Former Member
0 Likes
799

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

Read only

Former Member
0 Likes
800

Hi,

All the field names should be in CAPITAL lettes and also same as in internal table.

Read only

Former Member
0 Likes
799

Hi,

Try to pass the values in Upper case, when u hard-code ('USER_COMMAND' not 'user_command').

Hope it helps!!

Regards,

Pavan

Read only

Former Member
0 Likes
799

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.

Read only

Former Member
0 Likes
799

Hi ,

If you pass uppercase to the parameter <fieldname> of the field catalog this issue will be resolved mostly.

Regards,

Radhika.