‎2008 Jun 16 12:02 PM
Hi anybody,
I want to use click event button inside abap programe.
how to use click events of button.
anybody tell me.
thanks
s.muthu
‎2008 Jun 16 12:05 PM
hi for this the user commmand is used...
if sy-ucomm = 'TES'.
do some thing....
endif.
‎2008 Jun 16 12:06 PM
Hi,
Use user-command event, When button is created using PF-STATUS, put the name for that button (let say BUTTON1).
When it is clicked the user command event will be triggered, then sy-ucomm will become BUTTON1, so that we can handle the button event.
case sy-ucomm.
when 'BUTTON1'.
--> Code
endcase.
‎2008 Jun 16 12:13 PM
Hiii Mr Subramaniyan
Well i want to make it clear wether u want to have the push button on the application tool bar or n the selection screen area....
however if u want to have it on the application tool bar you have to set the pf status as ....
SET PF-STATUS 'TEST'.
just double click on the TEST and then you would enter SE41 transaction ...there u need to specify the Fcode ...and Display Text ...
Once u activate it then come back to the SE38 screen...
now u can call an event with the following code ...
Case SY-UCOMM.
When 'FCODE' **Fcode set for the icon in the SE41**.
perform the task u want to have ...
endcase ...
regards
chandu reddy
‎2008 Jun 16 12:15 PM
hi,
under END -OF-SELECTION.
set pf-status <name>.
// In pf-staus u can create a button on application toolbar.
under AT USER-COMMAND.
case sy-ucomm.
when 'FCODE'.
...
endcase.
rgds.,
subash
‎2008 Jun 16 12:18 PM
hiii
use following code.it will create button
START-OF-SELECTION.
SET PF-STATUS 'STATUS'.
PERFORM get_data_kna1.
END-OF-SELECTION.Now write following code for performing task on clicking that button.
CASE sy-ucomm.
WHEN 'CUSTOMER'.
SELECT SINGLE kunnr
FROM kna1
INTO w_kna1
WHERE kunnr = w_kunnr.
IF sy-subrc <> 0.
MESSAGE e015(zmsg9).
ENDIF.
WHEN 'ORDER'.
SELECT SINGLE vbeln
FROM vbak
INTO w_vbak
WHERE vbeln = w_vbeln.
IF sy-subrc <> 0.
MESSAGE e015(zmsg9).
ENDIF.
ENDCASE.reward if useful
thx
twinkal
‎2008 Jun 16 12:19 PM
Hi,
It is simple. Create ur Own PF status in SE41 transaction and assign the same to ur report.
Go to SE41-> Select radio button status->press copy status in tool bar. Here Give From program name as SAPMSSY0 and status as STLI. In to program give ur report name and to status ur new PF status name. press on copy. Now go to this status, Add push button in application tool bar option. Save and Activate.
now in ur program do like this.
END-OF-SELECTION.
SET PF-STATUS 'ZSTAT' "Ur new PF status.
All ur processing.
AT USER-COMMAND.
CHECK sy-ucomm EQ 'MYCODE'. "This will be assigned "while creating push button in PF status.
Do ur processing on clicking the button.
Thanks,
Vinod.