2007 Mar 10 1:35 AM
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
2007 Mar 10 2:29 AM
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
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
2007 Mar 10 1:38 AM
if this is not a typo, change the case & check
EXPORTING I_STRUCTURE_NAME = 'kna1'
ie
EXPORTING I_STRUCTURE_NAME = 'KNA1'
~Suresh
2007 Mar 10 1:39 AM
2007 Mar 10 2:29 AM
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
2007 Mar 10 7:02 PM
I want to know how to increase the size of the table in the output.
2007 Mar 10 7:19 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |