10-12-2005 5:31 AM
hi,
i want to call SET_TABLE_FOR_FIRST_DISPLAY method from CL_GUI_ALV_GRID.
for this i defined and created reference(w_alv_grid).
the i am calling method as
CALL METHOD w_alv_grid->SET_TABLE_FOR_FIRST_DISPLAY
my peroblem is when i do error checking its giving the error messgae as
<b>The Obligatory parameter "I_PARRENT" had no vlaue assign to it.</b>.
please help me.
10-12-2005 5:45 AM
Hi
Why dont you directly call the method from patterns button in SE38. Dont create a reference .
In pattern -> choose ABAP Object patterns.
Then give class -> CL_GUI_ALV_GRID and method SET_TABLE_FOR_FIRST_DISPLAY .
or if you want to create a new refernce to class in your program try this -
<b>data: grid_custom_container TYPE REF TO cl_gui_custom_container,
grid_container TYPE scrfname VALUE 'MYGRID',
alv_grid tYPE REF TO cl_gui_alv_grid.
CREATE OBJECT grid_custom_container
EXPORTING container_name = grid_container.
CREATE OBJECT alv_grid
EXPORTING i_parent = grid_custom_container.</b>
Cheers.
( Don't forget to reward if answers were helpful )
10-12-2005 5:38 AM
could you plz explain ur prob bit more
if possible paste the code.
ambichan
10-12-2005 5:45 AM
Hi
Why dont you directly call the method from patterns button in SE38. Dont create a reference .
In pattern -> choose ABAP Object patterns.
Then give class -> CL_GUI_ALV_GRID and method SET_TABLE_FOR_FIRST_DISPLAY .
or if you want to create a new refernce to class in your program try this -
<b>data: grid_custom_container TYPE REF TO cl_gui_custom_container,
grid_container TYPE scrfname VALUE 'MYGRID',
alv_grid tYPE REF TO cl_gui_alv_grid.
CREATE OBJECT grid_custom_container
EXPORTING container_name = grid_container.
CREATE OBJECT alv_grid
EXPORTING i_parent = grid_custom_container.</b>
Cheers.
( Don't forget to reward if answers were helpful )
10-12-2005 6:41 AM
Hi Sanjay Sinha ,
as you said i was trying to call directly from patterns,
its giving the field 'me' is unknown.
when i clalled through pattern is showng as follow.
CALL METHOD me->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = itab[]
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
please help me
10-12-2005 6:49 AM
Did you try the othe method i.e. creating an insatnce of this class in your program.
data: alv_grid tYPE REF TO cl_gui_alv_grid.
CALL METHOD alv_grid->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = itab[]
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
.
Cheers
Message was edited by: Sanjay Sinha
10-12-2005 6:50 AM
10-12-2005 6:57 AM
in the pattern wizard
pass the <b>instance</b> name (instance of the alv_grid) if you leave it blank system will use <b>me</b> and you have to manually change that.
Regards
Raja