Application Development 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: 

ALV Trouble

Former Member
0 Kudos

Hey folks, I cant get anything into my ALV.

Its driving me crazy because I cannot find any mistake in my coding.

Help would be awesome! Thanks in advance!

If the container is initial it should get filled with the content in gt_titel (definitely filled),

otherwise it just gets refreshed.

-


top include :


data: go_container type REF To cl_gui_custom_container,
      go_alv_grid type REF TO cl_gui_alv_grid.

module itself




MODULE status_0100 OUTPUT.

  IF go_container IS INITIAL.
    CREATE OBJECT go_container
      EXPORTING
        container_name = 'CONTROL_AREA_1'.

    CREATE OBJECT go_alv_grid
      EXPORTING
        i_parent = go_container.

    CALL METHOD go_alv_grid->set_table_for_first_display
      EXPORTING
        i_structure_name = 'zlars'            ***created a DDIC structure containing all required attributes.***
*!!!!!!
      CHANGING
        it_outtab        = gt_titel.

  ELSE.
    CALL METHOD
      go_alv_grid->refresh_table_display.
  ENDIF.

Edited by: Paul Oesterwitz on May 24, 2011 5:34 PM

Edited by: Paul Oesterwitz on May 24, 2011 5:36 PM

1 ACCEPTED SOLUTION

former_member191735
Active Contributor
0 Kudos

I don't see anything wrong. you need to troubleshoot it.

1) Can you see the GRID (even without data) - If no, make sure you have container drawn and named CONTROL_AREA_1

If you can see the grid but no data...

I would put a break point before call to 'CALL METHOD go_alv_grid->set_table_for_first_display' then check if you have the data in internal table

If yes, Check the defination of internal table and match to the structure you are passing and also make the structure name to CAPS.

15 REPLIES 15

awin_prabhu
Active Contributor
0 Kudos

Change below one to CAPS.


i_structure_name = 'zlars'        " Change it to 'ZLARS'

0 Kudos

doesnt help, sry 😕

0 Kudos

1. Check whether the custom container name in screen matches with below name in program,

 container_name = 'CONTROL_AREA_1'. 

2. In debugging put a breakpoint before CALL METHOD go_alv_grid->set_table_for_first_display and check whether inernal table

gt_titel is getting filled.

3. Also check whether you called the screen and the screen is active.

Former Member
0 Kudos

Hello Paul,

Please post the full code .

Are you able to see the AVL list output with empty table or nothing gets displayed during program execution?

Are you populating the internal table "gt_titel" properly?

Did you check in debug mode the contents at the method "set_table_for_first_display"?

Thanks,

Greetson

former_member191735
Active Contributor
0 Kudos

I don't see anything wrong. you need to troubleshoot it.

1) Can you see the GRID (even without data) - If no, make sure you have container drawn and named CONTROL_AREA_1

If you can see the grid but no data...

I would put a break point before call to 'CALL METHOD go_alv_grid->set_table_for_first_display' then check if you have the data in internal table

If yes, Check the defination of internal table and match to the structure you are passing and also make the structure name to CAPS.

0 Kudos

If the table is filled up but no display it mainly comes from the Dynpro...

in your dynpro check in the elementlist tab if ther is an element type 'CuCtr' named 'CONTROL_AREA_1'

This is the link between the container from the code and the Dynpro.

0 Kudos

ok, it had nothing to do with writing in caps or not.

I cannot see the grid when starting the program.

the element list contains a proper custom control.

somehow its still not working, maybe I'm just to dumb since Im an abap rookie...

this is the entire coding



*&---------------------------------------------------------------------*
*& Report  Z_ALV_ANZEIGE
*&---------------------------------------------------------------------*

REPORT  z_alv_anzeige.
INCLUDE z_alv_anzeige_top                       .    " global Data

*define tables
TYPES gt_titeltabelle TYPE STANDARD TABLE OF tsad2.
DATA gt_titel TYPE gt_titeltabelle.
DATA  gs_titel TYPE LINE OF gt_titeltabelle.

*writing data in table
SELECT * FROM tsad2 INTO TABLE gt_titel.

*CALL SCREEN 100.

************ESCAPE BUTTON  *************


DATA: ok_code TYPE sy-ucomm,
      save_ok LIKE ok_code,
      output LIKE ok_code.

*----------------------------------------------------------------------*
*  MODULE init_screen_0100 OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE init_screen_0100 OUTPUT.
  SET PF-STATUS 'STATUS_0100'.
  SET TITLEBAR '0100'.
ENDMODULE.                    "init_screen_0100 OUTPUT

*----------------------------------------------------------------------*
*  MODULE user_command_0100 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'EXIT' OR 'BACK' OR 'CANCEL'.
      LEAVE PROGRAM.
    WHEN OTHERS.
      output = save_ok.
  ENDCASE.
ENDMODULE.                    "user_command_0100 INPUT



****************************************ESCAPE BUTTON END *************

*Before Output Screen 100
*----------------------------------------------------------------------*
*  MODULE STATUS_0100 OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.

  IF go_container IS INITIAL.
    CREATE OBJECT go_container
      EXPORTING
        container_name = 'CONTROL_AREA_1'.

    CREATE OBJECT go_alv_grid
      EXPORTING
        i_parent = go_container.

    CALL METHOD go_alv_grid->set_table_for_first_display
      EXPORTING
        i_structure_name = 'ZLARS'
      CHANGING
        it_outtab        = gt_titel.

  ELSE.
    CALL METHOD
      go_alv_grid->refresh_table_display.
  ENDIF.



ENDMODULE.                 " STATUS_0100  OUTPUT


Edited by: Paul Oesterwitz on May 25, 2011 10:52 AM

0 Kudos

Hi Paul,

Sorry for my stupid question.

Does gt_titel have the same structure of ZLARS?

Regards,

Filippo

Edited by: FCannavo on May 25, 2011 11:23 AM

0 Kudos

gt_titel has everything what tsad2 (database table) has, ZLARS is structured like a line of tsad2.

so yes

0 Kudos

Looks like you've commented the CALL SCREEN statement

*CALL SCREEN 100.

0 Kudos

Why have you commented this ???

*CALL SCREEN 100.

0 Kudos

You have to build up the field catalog for the alv Grid ( say which fields have to be displayd) and send it in the method set_table_for_first_display...

Former Member
0 Kudos

Hi,

Uncomment the Call Screen and check whether the screen is activated or not ?

0 Kudos

Oops, but that was just because I tried something out, originally it had not been commented out

Going to try that field catalogue issue, thats what a colleague recommended too

0 Kudos

super cool, I tried it with the patterns 'REUSE_ALV_FIELDCATALOG_MERGE' and 'LVC_TRANSFER_FROM_SLIS' to fill the field catalog with data and now it works smoothly

thanks to everybody for help!