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

ABAP Help

Former Member
0 Likes
860

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 INPUT

table structure

Name : zemptable

Fields

eno

ename.

i have created a screen 100 with a custom control in name 'BALA'

Thanks in advance,

Bala.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
833

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

7 REPLIES 7
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
833

Hi Bala.

Have you checked whether ut inttable contains any entries or not?

Rgds,

Sandeep

Read only

0 Likes
833

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.

Read only

0 Likes
833

Hi all,

I found out the error. in the line

MODULE display_alv input.

i should have given

MODULE display_alv output

Thank you all for your help.

Thanks again,

Bala.

Read only

Former Member
0 Likes
834

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

Read only

christine_evans
Active Contributor
0 Likes
833

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).

Read only

Former Member
0 Likes
833

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

).

Read only

Former Member
0 Likes
833

Hi,

Check if the table zemptable contains some entries in SE16n.

Regards

Karthik D