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 Grid

Former Member
0 Kudos

Hi,

I have a program with selection screen,After the user enters the selection criteria,the output should be displayed in ALV, so after the selection-screen I am calling the PBO of the screen(9000) and fetching data,creating container,creating object and using the method "set_table_for_first_display" and passing my internal table to it.But my table is not getting displayed.i.e i am getting a blank screen 9000.I checked in debugging data is coming well and the return code for "set_table_for_first_display" is also zero.but the alv is not coming on the screen.

What to do...plz help..urgent.

THanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Deepti

Are you getting emply ALV without any records or noting in the screen?

11 REPLIES 11

Former Member
0 Kudos

Deepti

Are you getting emply ALV without any records or noting in the screen?

0 Kudos

No I am not getting the alv at all..its just a blank screen

0 Kudos

Deepti

It could be problem creating custom container, so please make sure below highlighted name are exactly matching your custom contanier (CAPS).

cont_for_flights TYPE scrfname VALUE '<b>ALV1</b>',

CREATE OBJECT custom_container

EXPORTING

container_name = <b>cont_for_flights</b>

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

0 Kudos

The name is exactly matching and value is in CAPS as well....and I checked in debug mode, the custom container is also getting created....is there anything else that needs to be taken care of ??

0 Kudos

hm..

This code is working for me, even if you give diff. custom container name in debug always sy-subrc will be 0. please make sure. I had the same problem . that's why i'm mentioning same thing again.

here is my code.

CREATE OBJECT custom_container

EXPORTING

container_name = cont_for_flights

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

  • create an instance of alv control

CREATE OBJECT <b>grid1</b>

EXPORTING i_parent = custom_container.

CALL METHOD <b>grid1</b>->set_table_first_display

EXPORTING

i_structure_name = 'VBAK'

is_layout = gs_layout

CHANGING

it_outtab = gt_outtab[].

Message was edited by:

Pavan Kothapalli

0 Kudos

I appreciate the reply from you. But this is correct in my case.Please check the below code:

DATA: container1 TYPE scrfname VALUE 'ZDKA2_ONE'.

CREATE OBJECT custom_container1

EXPORTING

container_name = container1

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

IF sy-subrc NE 0.

CALL FUNCTION 'POPUP_TO_INFORM'

EXPORTING

titel = g_repid

txt2 = sy-subrc

txt1 = 'The control could not be created'(510).

ENDIF.

CREATE OBJECT grid1

EXPORTING i_parent = custom_container1.

gs_layout-grid_title = 'Material Status'(100).

gs_layout-sel_mode = 'A'.

CALL METHOD grid1->set_table_for_first_display

EXPORTING i_structure_name = 'EQUI'

is_layout = gs_layout

CHANGING it_outtab = t_equi.

I have a doubt, since this is not a selection screen(100), it is a screen 9000 created by me, am i supposed to add a container element on the screen,in the layout of screen 9000 ???

0 Kudos

Deepti

you need to create custom container in screen 9000.

in your program double clik on 9000, then you need to goto screen layout and add custom container in your screen, and give the name exactly as <b>ZDKA2_ONE</b>

and let me if it works.

Pavan

Message was edited by:

Pavan Kothapalli

0 Kudos

Thanks Pavan, I understood the problem but was giving the name incorrect.Now it has solved my problem.Thanks again.I have awarded points to u.

0 Kudos

Hi,

In the method " SET_TABLE_FOR_FIRST_DISPLAY" there is a field IT_OUTTAB which is of type standard table. In my case I want to pass an Internal table i.e bcas I dont want all the fields of one table, I want some from one table some from other, so I created an Internal Table and want only those internal table fields to be displayed as ALV grid columns.I am not able to pass itab to IT_OUTTAB.What to do.Please help.

Thanks.

0 Kudos

Create a type in SE11 first for the fields which you want in the output and then create an internal table for that.

Like:

DATA: ITAB TYPE STANDARAD TABLE OF ZTYPE_TAB.  " < ZTYPE_TAB is created type in SE11.

Regards,

Naimesh Patel

0 Kudos

Thanks.That was one way of doing it.But I found out how to do that using the Field Catalog.

Thanks.

Message was edited by:

Deepti Kaza