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

Regarding ALV grid Functionality

Former Member
0 Likes
550

Hi Experts,

I require a small help regarding ALV grid display.

In CL_GUI_ALV_GRID , in the tool bar , when I move from one grid to another for dispalying the output, I want to Exclude the <b> Append</b> and <b>Duplicate</b> row buttons.

As in the case of Subtotals,

<b>ls_exclude = cl_gui_alv_grid=>mc_fc_subtot.

append ls_exclude to pt_exclude.</b>

I require the <b>UI</b> function for <b>APPEND</b> and <b>DUPLICATE</b> rows.

Please treat it as very urgent and important.

I expect valuable suggestions.

Regards

Nagaraj

4 REPLIES 4
Read only

Former Member
0 Likes
520

use the following code to remove the buttons from toolbars......

CREATE OBJECT GV_ALVGRID

EXPORTING

I_PARENT = GV_HISTORYCONTAINER.

CALL METHOD GV_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

I_SAVE = 'X'

IS_LAYOUT = GS_HIST_LAYOUT

IT_TOOLBAR_EXCLUDING = GT_EXCLUDE

CHANGING

IT_OUTTAB = GIT_HISTORY

IT_FIELDCATALOG = GT_HIST_FLDCAT

IT_SORT = GT_SORT_ALV

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.

FORM REMOVE_BUTTONS.

DATA LS_EXCLUDE TYPE UI_FUNC.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_MAXIMUM .

APPEND LS_EXCLUDE TO GT_EXCLUDE.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_MINIMUM .

APPEND LS_EXCLUDE TO GT_EXCLUDE.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SUBTOT .

APPEND LS_EXCLUDE TO GT_EXCLUDE.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_SUM .

APPEND LS_EXCLUDE TO GT_EXCLUDE.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_AVERAGE .

APPEND LS_EXCLUDE TO GT_EXCLUDE.

LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_MB_SUM .

APPEND LS_EXCLUDE TO GT_EXCLUDE.

ENDFORM. "REMOVE_BUTTONS

Read only

0 Likes
520

Hi Naresh,

I have the following code prior to this post. I require code only for removing the APPEND ROW and DUPLICATE ROW .

Can u plz. guide me in this regard.

Regards

Nagaraj

Read only

Former Member
0 Likes
520

Hi Experts,

I have found the UI function for APPEND ROW which is

<b>ls_exclude = cl_gui_alv_grid=>mc_fc_appendrow.

append ls_exclude to pt_exclude.</b>

Similarly, I want the code for <b>DUPLICATE ROW</b>.

Plz. help me in this regard.

Regards

Nagaraj

Read only

Former Member
0 Likes
520

HI Nagaraj,

Looking at the attributes of class CL_GUI_ALV_GRID I think the attribute for Copy Row is MC_FC_LOC_COPY_ROW.

Your code would look like:

ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.

append ls_exclude to pt_exclude

Regards,

Roy