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 user-command

Former Member
0 Likes
2,244

HI,

<b>In my ALV report output check box is there.

when the user check the checkbox and select icon(&ETA).

it should dipslay another program selection screen.

please let me know how i can do code for this.</b>

regards,

vijay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

Hi,

just include a subroutine in your code eg.

&----


*& Form USER_COMMAND

&----


FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM.

CASE P_UCOMM.

WHEN '&ETA'.

(call your selectionscreen)

-


-


ENDIF.

ENDCASE.

ENDFORM

Include the sunroutine name in the 'I_CALLBACK_USER_COMMAND'

parameter of the REUSE_ALV_GRID_DISPLAY func. module eg.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

-


-


I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

-


-


EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

Reward points if found to be useful

Regards,

Sandeep

Message was edited by:

sandeep govindan

5 REPLIES 5
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
732

Hi,

In PBO, you need to have such coding for register.

call method o_alvgrid->register_edit_event

exporting

i_event_id = cl_gui_alv_grid=>mc_evt_modified.

Then based on that, in PAI you need to call another program if sy-ucomm = '&ETA' and checkbox is checked.

Message was edited by:

Jayanthi Jayaraman

Read only

Former Member
0 Likes
732

hi Vijay,

U can use user command for this .

check the value of sy-ucomm

CASE sy-ucomm

when '&ETA'

u can call the program which u want to call .

U can use submit statement for this.

Submit Report_Name via selection-screen.

endcase

Read only

Former Member
0 Likes
733

Hi,

just include a subroutine in your code eg.

&----


*& Form USER_COMMAND

&----


FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM.

CASE P_UCOMM.

WHEN '&ETA'.

(call your selectionscreen)

-


-


ENDIF.

ENDCASE.

ENDFORM

Include the sunroutine name in the 'I_CALLBACK_USER_COMMAND'

parameter of the REUSE_ALV_GRID_DISPLAY func. module eg.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

-


-


I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

-


-


EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

Reward points if found to be useful

Regards,

Sandeep

Message was edited by:

sandeep govindan

Read only

Former Member
0 Likes
732

Hi Vijay,

CASE SY-UCOMM

WHEN '&ETA'.

IF p_radio = 'X'.

SUBMIT ztest via selection-screen.

ENDIF.

ENDCASE.

Read only

Former Member
0 Likes
732

Hi, Vijay,

Follow this it will work.

In Internal table which is being passed to alv.

*----


DATA: BEGIN OF IBKPF OCCURS 0,

MCHK,MSEL(1) type c

-


-


data : end of ibkpf.

In layout

*----


LYT-BOX_FIELDNAME = 'MSEL'.

LYT-BOX_TABNAME = 'IBKPF'.

form user command.

*----


FORM USERCOMMAND USING R_COMMAND TYPE SY-UCOMM SELFLD TYPE SLIS_SELFIELD.

DATA : MFLAG(10) TYPE C.

CASE R_COMMAND.

when 'YOUR BUTTON NAME'

CALL TRANSACTION ' '

alv function

*----


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = REPID

I_CALLBACK_USER_COMMAND = 'USERCOMMAND'

IT_FIELDCAT = FCAT

I_SAVE = 'X'

  • IT_EVENTS = F3[]

IS_LAYOUT = LYT

TABLES

T_OUTTAB = IBKPF.

Note:- Click on save button after check your chek box, so it will save value of check box to MSEL field of internal table. If you need I will send you a complete program to your mail.