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

USER_COMMAND Not working

Former Member
0 Likes
3,744

Hi

I have used USER_COMMAND in my ALV list and done coding there. But in outut it s not reflecting. Condition for PF is working fine but not for USER_COMMAND.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'.

EXPORTING.

I_CALLBACK_PROGRAM             = SY-REPID.

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

I_CALLBACK_PF_STATUS           = 'PF_STATUS.

FORM USER_COMMAND USING R_UCOMM TYPE SY-UCOMM

                                                     RS_UCOMM TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN 'BACK'.

LEAVE TO SCREEN....

......

ENDCASE.

Please help....

16 REPLIES 16
Read only

ipravir
Active Contributor
0 Likes
3,239

Hi Bharani,

Put the Break-point inside the FORM (as first line). and check, may be the 'BACK' SY-UCOMM is not exist in system.

Regards.

Praveer.

Read only

Former Member
0 Likes
3,239

Hi Praveer

Thanks for your prompt response.

But my main draw bak is .....i have assigned TOOL BAR keys like BACK, SAVE & CANCEL in a screen caled by PF status.

But in ALV only APPLICATION TOOLBAR keys are displaying not the Function Keys where i declared  BACK, SAVE & CANCEL

Read only

ipravir
Active Contributor
0 Likes
3,239

Hi Bharani,

Basically you can use

either REUSE_ALV_GRID_DISPLAY

or CL_GUI_ALV_GRID.

1. REUSE_ALV_GRID_DISPLAY

     is having inbuilt command for BACK / CANCEL and EXIT, you not need to declare these again in you PF-STATUS,

     either of this, if you declaring something in not exist or something which is require in your business function, those only you have to declare in PF-STATUS and based on that you have to write the code in USER_COMMAND.

2. CL_GUI_ALV_GRID,

     Since it's a class based ALV grid, to display this alv you have to declare a new screen and a container object.

     Since, it's on screen level, so you have to write the code on PBO on screen event for back / cancel and exit.

Regards.

Praveer.

Read only

Former Member
0 Likes
3,239

I have already declared these things in PF....but also ot reflecting in the op

Read only

pavanm592
Contributor
0 Likes
3,239

Hi,

Provide the complete parameters of ALV FM

& check the pf_status is activated or not.

Regards,

Pavan

Read only

Former Member
0 Likes
3,239

hii Bharani

please check if your pf status is activated

Regards

Gaurav

Read only

krishna_k19
Contributor
0 Likes
3,239

Hi Bharani,

   Did you implemented the PF-STATUS method??

Regards,

Krishna

Read only

Former Member
0 Likes
3,239

HI Bharani,

does your pf_status subroutine is same as this

FORM PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
   SET PF-STATUS 'ZSTATUS'.
   REFRESH extab[].
ENDFORM.  

Read only

Former Member
0 Likes
3,239

Yes my PF STATUS was activated.

Read only

0 Likes
3,239

you can compare pf status with below image

Read only

0 Likes
3,239

like this way only i have given but same only....Application status only executing not Function Keys

Read only

0 Likes
3,239

Hi Bharani,

To use the Function keys, you need to assign them with user commands first.

Do the following steps:

1. Double click on you GUI status

2. Go to screen menu: Utillities --> F Key Consistency

3. Enter the command for the Function keys you desire to use.

4. Save and Activate it

Note the F keys assignment will be visible in black colour in the GUI status screen here after.

Please try and let me know if it helps

Read only

Former Member
0 Likes
3,239

Hi Bharani,


Can you please put your exact code here for the ALV LIST call and the user_command function?

Also, you may refer the standard program to check if your other parameters like button settings in GUI Status, etc as needed or not.

BCALV_TEST_LIST

Hope this helps!

Regards,

Gayatri

Read only

Former Member
0 Likes
3,239

HI bharani

you need to define back etc fcode like below

Read only

ipravir
Active Contributor
0 Likes
3,239

Hi Bharani,

Please take any standard program PF-STATUS, where the same has been used for the REUSE_ALV_GRID_DISPLAY function module.

And after apply the same in your program check the Command for the BACK/EXIT or CANCEL.

and based on that you can write your logic.

Regards.

Praveer.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,239

Correct your code, replace


I_CALLBACK_PROGRAM             = SY-REPID.

With a local variable initialized with SY-REPID, else the value will become SAPLSALV...


I_CALLBACK_PROGRAM             = LV_REPID.

This is written in FM documentation...


Note: Never pass SY-REPID directly in the interface. If the desired program name is in SY-REPID, it must be assigned to an intermediate variable which is then passed to the interface.

Regards,

Raymond