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: 

User command in ALV

Former Member
0 Kudos

Hello Everyone,

Does anyone knows how to trigger user command in ALV?

I am using FM 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' and i add one self-defined button on ALV toolbar.

The problem arises: When i try to click on my self define button on ALV toolbar, the control is not going inside this perform.

FORM user_command USING r_ucomm TYPE syucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN 'PICK'.

ENDCASE.

ENDFORM.

Any idea how the control will go inside this perform when i click on my self-defined button.

Thanks in advance.

Regards,

Tarun

9 REPLIES 9

hymavathi_oruganti
Active Contributor
0 Kudos

FORM user_command USING r_ucomm TYPE <b>syucomm</b>

rs_selfield TYPE slis_selfield.

<b>sy-ucomm</b> change above syucomm like this

Former Member
0 Kudos

Hi Tarun,

change syucomm to SY-UCOMM and try it.

Regards,

Raghavendra

0 Kudos

change syucomm to SY-UCOMM

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

case r_ucomm.

when 'BACK' or 'CANC' or 'EXIT'.

leave to screen 0.

when '&IC1'.

set parameter id 'AUN' field rs_selfield-value.

call transaction 'VA03' and skip first screen.

endcase.

ENDFORM. "USER_COMMAND

Message was edited by: kishan negi

former_member184569
Active Contributor
0 Kudos

Declare r_ucomm of type sy-ucomm

Former Member
0 Kudos

Hi Tarun,

Looked up an example for adding a self defined button to ALV. There it specifies that the type for r_ucomm is syucomm. So, that might not be a problem. There are some small mistakes possible.

1. Adding function code to the button

2. Setting the button as 'disabled'.

3. Button type ( normal )

Do try these.

Regards,

Aniket

Please mark helpful answers.

0 Kudos

Hi Aniket,

May be you are right.

I tried the various options suggested by everyone regarding the setting of the r_ucomm.

Might be the problem arises in setting up the properties of the button.

Can you please elaborate more on this.

Do or anyone have sample code for this.

If you pass sample code to me it would be great help to me.

Thanks in advance again for your great help.

Regards,

Tarun

0 Kudos

PICK is an internal command, so try giving another name for ur self defined button in SET PF STATUS and try checking.

activate the set pf status.

0 Kudos

Tarun

Take a look at BCALV_TEST_HIERSEQ_LIST_EVENTS

Regards,

Ravi

Note : Please mark the helpful answers

0 Kudos

Hi again Tarun,

Please post you email ID. Will mail you some stuff that will be useful.

Regards,

Aniket