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

Problem with user command

Former Member
0 Likes
1,553

Hi All,

I have an ALV output. in the first detail list i have added a pushbutton on the application tool bar. when i click on the pushbutton a popup screen should be displayed. i have designed popup screen but when i'm trying to call the screen its not displaying. and one more thing if i clicked on other alv fields in the grid its going further screen but only this pushbutton click is not working. i have written the code like the below.

FORM user_click USING r_ucomm LIKE sy-ucomm
                                 rs_selfield TYPE slis_selfield.


  CASE rs_selfield-fieldname.
when 'pushbutton function code'
      CALL selection-SCREEN '0400' STARTING AT 30 10 .
      not performing this.
    WHEN 'C'.
        performing well

in all other cases its working fine but except in pushbutton case its not working. but all other are fieldnames. so rs_selfield is capturing properly i thought, but in my new addtional pushbutton case its not working.

can anybody help me in this regard.

thanks

g.s.naidu

19 REPLIES 19
Read only

MarcinPciak
Active Contributor
0 Likes
1,467

Hi,

Do not capture rs_selfield-fieldname field. Instead use r_ucomm. User command passes function code which you have to first assing for each pushbutton. When you press it, it the code of respective button will be stored in r_ucomm.


CASE r_ucomm.
when "Function code of a pushbutton
   CALL selection-SCREEN '0400' STARTING AT 30 10 .
WHEN "different function code of another pushbutton
...

Regards

Marcin

Read only

Former Member
0 Likes
1,467

Hi,

Is the popup screen a selection screen? If not you should enter the code call screen 0400 starting at colpos rowpos. This will call the screen when you click on the button. Also you may try to run the program in debugging mode to check if the function code is being captued and the subroutine is being called.

Thanks and regards,

Sachin

Read only

0 Likes
1,467

Hi Sachin,

Yes its a selection screen. i have checked this in debugging mode. the function code is not getting captured. i have tried with r_ucomm also its not atall going there. its going to rs_selfield-fieldname.

Any suggestion please

thanks

g.s.naidu

Read only

0 Likes
1,467

Hello,

Some where u need to use the wordPICK but i am not sure this may help..

Thank u,

santhosh

Edited by: santhosh kumar on Dec 15, 2008 4:01 PM

Read only

0 Likes
1,467

Can you provide your code please?

Read only

0 Likes
1,467

THIS IS MY CODE :

i_callback_user_command = 'USER_CLK'

FORM USER_CLK USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

case R_UCOMM.

when 'H'.

CALL selection-SCREEN '0200' STARTING AT 80 30 .

ENDCASE.

CASE rs_selfield-fieldname.

WHEN 'C'.

ITS PERFORMING THE REQUIRED ACTION.

WHEN 'D'.

ITS PERFORMING THE REQUIRED ACTION.

ENDCASE.

Read only

0 Likes
1,467

Do you have any button with function code H ? Ensure you have one and that you have activated your GUI status. This might be the problem.

rs_selfield keeps only the information about cursor position in ALV, it has nothing to do with triggering function codes assinged to sy-ucomm (r_ucomm in your case).

How do you get inside user-command, I mean how you trigger it?

Read only

Former Member
0 Likes
1,467

Hi,

When you give 'r_ucomm' it should work.

In debugging mode check the 'sy-ucomm' value when you click on your push button and

verify it in your program.

This may resolve the problem, if everything else is fine.

Regards,

Manoj Kumar P

Read only

0 Likes
1,467

No its r_ucomm is not capturing the pushbutton's action. the value of r_ucomm is &ic1.

my function code is 'H'.

Read only

0 Likes
1,467

Hi

Are u sure you've set the right command in your Status GUI?

U should check your status in order to find out the ok_code assigned to your new button, &ic1 is std function

Max

Read only

0 Likes
1,467

Yes my function id is right and i have activated my gui status. i have copied my gui status from the standard gui status.

The only problem i'm getting is the r_ucomm is not capturing my pushbuttons action. why i'm not getting. in two case statements r_ucomm is not working and rs_selfield-fieldname is working.

Read only

0 Likes
1,467

Hi

Because something is wrong on how u manage your status, can u post the code where u transfer your status to ALV and where u set your status.

U need to find out the solution in your status

Max

Read only

0 Likes
1,467

are you using the pf-status form also. show that also. some where you are doing the mistake.

show the code related to status form.

Read only

matt
Active Contributor
0 Likes
1,467

.

Edited by: Matt on Dec 15, 2008 5:35 PM - comment no longer required

Read only

Former Member
0 Likes
1,467

Sorry Matt,

Thats not with intention its only due to hurryness. any ways it wont be repeated for the next time.

Thanks

g.s.naidu

Read only

Former Member
0 Likes
1,467

Hi

I've tried this sample and it works fine:

data: t_bkpf type table of bkpf.
data: gt_repid type sy-repid.

start-of-selection.

  GT_REPID = sy-repid.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM       = GT_REPID
      I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
      I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
      I_STRUCTURE_NAME         = 'BKPF'
    TABLES
      T_OUTTAB                 = t_bkpf.

*&---------------------------------------------------------------------*
*&      Form  PF_STATUS_SET
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->RT_EXTAB   text
*----------------------------------------------------------------------*
FORM PF_STATUS_SET USING rt_extab TYPE slis_t_extab.
  set pf-status 'ALV' excluding rt_extab.
ENDFORM.                    "set_pf_status

*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM user_command  USING r_ucomm LIKE sy-ucomm
                         rs_selfield TYPE slis_selfield.
  if r_ucomm = 'H'.
    message i208(00) with r_ucomm.
  endif.
endform.                    "user_command

Max

Read only

Former Member
0 Likes
1,467

Hi,

I think you are not passing the PF-STATUS to the alv... you might be calling the PF-STATUS in the report program.

Try to set the PF-STATUS using the ALV then it will be captured in perfrom user_click.

Read only

Former Member
0 Likes
1,467

Hi Max,

Yes your code is working fine . my minor mistake is i have taken &pop as a function id but still it was not working. after that i have taken pop only as a function id. now my popup is displaying.

So thank you all of you for the great response.

I'll close this thread here now.

Thank you once again.

Regards

g.s.naidu

Read only

former_member203501
Active Contributor
0 Likes
1,467

hi naidu ,

Please see the function code after ckicking the push button in the Debugging mode and use it in the case statement . i think it is not 'H' . i think the pf-status should have 3 chars .

do like this ..

case: r_ucomm .

when 'PUSH'. <------ give the button function code from the debugging mode.

do some thing ..

endcase .