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

alv grid

Former Member
0 Likes
1,649

hi can anyone tel me wats the error in this coding this is not working

its showing no error but im not getting alv grid display

DATA: grid1 TYPE REF TO cl_gui_alv_grid,

ok_code LIKE sy-ucomm,

mycontainer TYPE scrfname VALUE 'CUST',

container TYPE REF TO cl_gui_custom_container.

DATA : t_mara TYPE TABLE OF zmara.

DATA : v_save,

v_repid LIKE sy-repid,

v_variant TYPE disvariant.

INCLUDE zsta.

INCLUDE zpbo.

START-OF-SELECTION.

PERFORM set_data.

END-OF-SELECTION.

CLEAR v_variant.

v_repid = sy-repid .

v_variant-report = v_repid.

v_save = 'A'.

CALL SCREEN 786.

----


  • FORM CREATE_CON *

----


  • ........ *

----


FORM create_con.

IF container IS INITIAL.

CREATE OBJECT container EXPORTING

container_name = mycontainer

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 = sy-repid

txt2 = sy-subrc

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

  • TXT3 = ' '

  • TXT4 = ' '

ENDIF.

CREATE OBJECT grid1 EXPORTING

i_parent = container.

CALL METHOD grid1->set_table_for_first_display

EXPORTING i_structure_name = 'ZMARA'

is_variant = v_variant

i_save = v_save

i_default = 'X'

CHANGING it_outtab = t_mara.

ENDIF.

ENDFORM. "

----


  • FORM SET_DATA *

----


  • ........ *

----


FORM set_data.

SELECT matnr

ersda

ernam

laeda

aenam

vpsta

pstat

lvorm

matfi

cmrel

FROM mara INTO TABLE t_mara UP TO 5 ROWS.

ENDFORM. " GET_DATA

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,580

hi zubair

click the screen number screen layout wil open otherwise goto se51 and give ur program name and screen number,

then from left side they wil be tool box from there u drag and drop the custom control and double click it and name it as CUST

and run ur program

hi zubair

click the screen number screen layout wil open otherwise goto se51 and give ur program name and screen number,

then from left side they wil be tool box from there u drag and drop the custom control and double click it and name it as CUST

and run ur program

13 REPLIES 13
Read only

Former Member
0 Likes
1,580

Hi,

Have you created the Screen 786 and a container with name CUST in it?

Read only

0 Likes
1,580

hi,

yeah i have created the screen 786 but not container cust pls tel me how to create that

Read only

0 Likes
1,580

when you go to the layout of your screen painter , on the left hand side there will be one custom control button , drag and drop that on to your screen painter and give the name of that as CUST

Read only

0 Likes
1,580

hi

there is nothing in the left side once the screen painter is opened nothin is there in left side then how to drag and drop a custom control button.

it only showing screen no 0786 active and they is menu bar application bar and remaining screen is blank

Read only

0 Likes
1,580

I am talking about the layout of that screen , click on the layout button on application toolber which will take you to the layout of that screen, there you can find button on left hand side, for more help chk the program BCALV_EDIT_05

Read only

0 Likes
1,580

yeah i clicked the layout button and i opened the screen painter and there is no button on screen

Read only

Former Member
0 Likes
1,580

Hi Zubair,

Pls check the contianer name is 'CUST' or not in your screen painter.

Thanks & Regards,

Siri.

Read only

0 Likes
1,580

hi srilatha

cust is not in my screen painter how to create that?

Read only

Former Member
0 Likes
1,580

Hi Zubir,

In FORM CREATE_CON,

Change the container name as shown......

CREATE OBJECT container EXPORTING

container_name = container

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5.

Thanks and Regards,

Kunjal Patel

Read only

Former Member
0 Likes
1,580

Check

whether u have created the screen container in ur layout and check for the data in the internal table..

also check the fieldcat internal table whether it is showing the data in debug mode...

Read only

0 Likes
1,580

hi sumi vasu

i have not created cust pls tel me how to create cust container in my screen painter

Read only

Former Member
0 Likes
1,580

Hi,

Go to screen painter, create a container from the tools then name the container. That name shd be used in your program.

In se 38, give BCALV* and Press F4. There are lot of sample progs using container. Have a glance on that. Still if u have any doubt then write once again.

Regards,

U. Uma

Read only

Former Member
0 Likes
1,581

hi zubair

click the screen number screen layout wil open otherwise goto se51 and give ur program name and screen number,

then from left side they wil be tool box from there u drag and drop the custom control and double click it and name it as CUST

and run ur program