‎2008 Oct 23 10:34 AM
Hi
Please tell me what is wrong in this alv program. i dont get any error. i dont get output either
*&---------------------------------------------------------------------*
*& Report ZALVBALA
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zalvbala.
DATA : alvgrid TYPE REF TO cl_gui_alv_grid,
conname TYPE scrfname VALUE 'BALA',
custcont TYPE REF TO cl_gui_custom_container,
fieldcat TYPE lvc_t_fcat,
flayout TYPE lvc_s_layo,
headcatalogline type LVC_S_FCAT.
DATA : BEGIN OF inttable OCCURS 0.
INCLUDE STRUCTURE zemptable.
DATA : END OF inttable.
SELECT * FROM zemptable INTO TABLE inttable.
CALL SCREEN 100.
*----------------------------------------------------------------------*
* MODULE display_alv INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE display_alv INPUT.
CREATE OBJECT custcont
EXPORTING
container_name = conname.
CREATE OBJECT alvgrid
EXPORTING
i_parent = custcont.
flayout-zebra = 'X'.
flayout-grid_title = 'Demo Program'.
flayout-smalltitle = 'X'.
headcatalogline-fieldname = 'ENO'.
headcatalogline-inttype = 'C' .
headcatalogline-outputlen = '5' .
headcatalogline-coltext = 'Employee Number '.
headcatalogline-seltext = 'Employee Number '.
APPEND headcatalogline to fieldcat.
headcatalogline-fieldname = 'ENAME'.
headcatalogline-inttype = 'C' .
headcatalogline-outputlen = '20' .
headcatalogline-coltext = 'Employee Name '.
headcatalogline-seltext = 'Employee Name '.
APPEND headcatalogline to fieldcat.
CALL METHOD alvgrid->set_table_for_first_display
EXPORTING
is_layout = flayout
CHANGING
it_outtab = inttable[]
it_fieldcatalog = fieldcat.
ENDMODULE. "display_alv INPUTtable structure
Name : zemptable
Fields
eno
ename.
i have created a screen 100 with a custom control in name 'BALA'
Thanks in advance,
Bala.
‎2008 Oct 23 10:45 AM
Hi,
Try this....
headcatalogline-fieldname = 'ENO'.
headcatalogline-inttype = 'C' .
headcatalogline-outputlen = '5' .
headcatalogline-col_pos = 1.
headcatalogline-tabname = 1.
headcatalogline-coltext = 'Employee Number '.
headcatalogline-seltext = 'Employee Number '.
APPEND headcatalogline to fieldcat.
headcatalogline-fieldname = 'ENAME'.
headcatalogline-inttype = 'C' .
headcatalogline-outputlen = '20' .
headcatalogline-col_pos = 2.
headcatalogline-tabname = 1.
headcatalogline-coltext = 'Employee Name '.
headcatalogline-seltext = 'Employee Name '.
APPEND headcatalogline to fieldcat.
CALL METHOD alvgrid->set_table_for_first_display
EXPORTING
is_layout = flayout
CHANGING
it_outtab = inttable[]
it_fieldcatalog = fieldcat[].
see whether u passed the container name to 'conname' correctly...
Edited by: Sukriti Saha on Oct 23, 2008 3:18 PM
‎2008 Oct 23 10:41 AM
Hi Bala.
Have you checked whether ut inttable contains any entries or not?
Rgds,
Sandeep
‎2008 Oct 23 10:46 AM
Yes i checked the table has entries. In the screen 100 which it displays i dont see anything. its a plain screen
i dont know why my custom control does not show up.
Please help.
Thanks,
Bala.
‎2008 Oct 23 10:49 AM
Hi all,
I found out the error. in the line
MODULE display_alv input.i should have given
MODULE display_alv outputThank you all for your help.
Thanks again,
Bala.
‎2008 Oct 23 10:45 AM
Hi,
Try this....
headcatalogline-fieldname = 'ENO'.
headcatalogline-inttype = 'C' .
headcatalogline-outputlen = '5' .
headcatalogline-col_pos = 1.
headcatalogline-tabname = 1.
headcatalogline-coltext = 'Employee Number '.
headcatalogline-seltext = 'Employee Number '.
APPEND headcatalogline to fieldcat.
headcatalogline-fieldname = 'ENAME'.
headcatalogline-inttype = 'C' .
headcatalogline-outputlen = '20' .
headcatalogline-col_pos = 2.
headcatalogline-tabname = 1.
headcatalogline-coltext = 'Employee Name '.
headcatalogline-seltext = 'Employee Name '.
APPEND headcatalogline to fieldcat.
CALL METHOD alvgrid->set_table_for_first_display
EXPORTING
is_layout = flayout
CHANGING
it_outtab = inttable[]
it_fieldcatalog = fieldcat[].
see whether u passed the container name to 'conname' correctly...
Edited by: Sukriti Saha on Oct 23, 2008 3:18 PM
‎2008 Oct 23 10:51 AM
You are calling your module in the PBO of your screen, aren't you? I'm thinking not because it is defined as an INPUT module (which is called from the PAI) rather than as an OUTPUT module (which is called from the PBO).
‎2008 Oct 23 10:52 AM
Hi,
You may pass the I_STRUCTURE_NAME field also as your structure name(Name of the DDIC structure (for example, 'SFLIGHT') for the data in the output table. If you specify this parameter, the field catalog is generated automatically
).
‎2008 Oct 23 10:52 AM
Hi,
Check if the table zemptable contains some entries in SE16n.
Regards
Karthik D