‎2008 Dec 15 2:14 PM
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 wellin 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
‎2008 Dec 15 2:27 PM
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
‎2008 Dec 15 2:31 PM
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
‎2008 Dec 15 2:57 PM
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
‎2008 Dec 15 3:00 PM
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
‎2008 Dec 15 3:07 PM
‎2008 Dec 15 3:26 PM
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.
‎2008 Dec 15 3:35 PM
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?
‎2008 Dec 15 3:21 PM
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
‎2008 Dec 15 3:32 PM
No its r_ucomm is not capturing the pushbutton's action. the value of r_ucomm is &ic1.
my function code is 'H'.
‎2008 Dec 15 3:36 PM
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
‎2008 Dec 15 3:57 PM
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.
‎2008 Dec 15 4:12 PM
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
‎2008 Dec 15 4:15 PM
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.
‎2008 Dec 15 4:14 PM
.
Edited by: Matt on Dec 15, 2008 5:35 PM - comment no longer required
‎2008 Dec 15 4:20 PM
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
‎2008 Dec 15 4:33 PM
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_commandMax
‎2008 Dec 15 4:37 PM
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.
‎2008 Dec 15 5:20 PM
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
‎2008 Dec 15 4:24 PM
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 .