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

problem with alv report using classes

Former Member
0 Likes
615

Hey,

I am getting an error while i try to excute my code. The error is "Field Symbol has not been assigned".

*******************************************

REPORT ZBPALVCLASS .

tables: kna1.

data: grid type ref to cl_gui_alv_grid,

g_cust_container type ref to cl_gui_custom_container.

data: begin of t_kna1 occurs 100,

kunnr type kunnr,

name1 type name1,

ort01 type ort01,

land1 type land1,

end of t_kna1.

data: w_fcat1 type lvc_s_fcat,

t_fcat1 type lvc_t_fcat.

select kunnr name1 ort01 land1 from kna1 into table t_kna1.

perform catalog.

call screen 110.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0110 INPUT.

if sy-ucomm = 'EXIT'.

LEAVE PROGRAM.

endif.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0110 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

if g_cust_container is initial.

create object g_cust_container

exporting

container_name = 'LVCONTROL'.

create object grid

exporting

i_parent = g_cust_container.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING I_STRUCTURE_NAME = 'kna1'

CHANGING

IT_OUTTAB = t_kna1[]

IT_FIELDCATALOG = t_fcat1[].

endif.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Form catalog

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM catalog .

w_fcat1-fieldname = 'KUNNR'.

  • w_fcat1-outputlen = 7.

*w_fcat1-seltext_m = 'Customer'.

append w_fcat1 to t_fcat1.

clear w_fcat1.

w_fcat1-fieldname = 'LAND1'.

  • w_fcat1-outputlen = 10.

  • w_fcat1-seltext_m = 'Country'.

append w_fcat1 to t_fcat1.

clear w_fcat1.

w_fcat1-fieldname = 'NAME1'.

  • w_fcat1-outputlen = 10.

  • w_fcat1-seltext_m = 'Name'.

append w_fcat1 to t_fcat1.

clear w_fcat1.

w_fcat1-fieldname = 'ORT01'.

  • w_fcat1-outputlen = 25.

  • w_fcat1-seltext_m = 'City'.

append w_fcat1 to t_fcat1.

clear w_fcat1.

ENDFORM. " catalog

*************************************************************

Thanks in advance

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
591

Hi,

There is no need to KNA1 structure to pass set_table_for_first_display ih you have field catalog


    call method grid1->set_table_for_first_display
      changing
        it_outtab                     = t_kna1[]
        it_fieldcatalog               = t_fcat1[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
 

aRs

Message was edited by:

aRs

5 REPLIES 5
Read only

suresh_datti
Active Contributor
0 Likes
591

if this is not a typo, change the case & check

EXPORTING I_STRUCTURE_NAME = 'kna1'

ie

EXPORTING I_STRUCTURE_NAME = 'KNA1'

~Suresh

Read only

0 Likes
591

it does'nt make any difference

Read only

former_member194669
Active Contributor
0 Likes
592

Hi,

There is no need to KNA1 structure to pass set_table_for_first_display ih you have field catalog


    call method grid1->set_table_for_first_display
      changing
        it_outtab                     = t_kna1[]
        it_fieldcatalog               = t_fcat1[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
 

aRs

Message was edited by:

aRs

Read only

Former Member
0 Likes
591

I want to know how to increase the size of the table in the output.

Read only

0 Likes
591

Ben, you can simply make the container bigger. Go to screen painter and increase the size of the container, you may need to increase the default size of the screen as well.

Regards,

RIch Heilman