‎2010 Apr 05 1:05 PM
Hi All,
I have a requirement to add a button in the Classical report.
Iam new to abap.can anyone please guide me regarding this?
Thanks in advance
‎2010 Apr 05 1:12 PM
Hi,
you can create button using following command:
SET PF-STATUS 'XXXX'.
In place of XXXX give relevant name.
Now handle corresponding function code given to the button in above step using event AT USER-COMMAND.
This will solve your problem.
Regards,
Brajvir Singh
‎2010 Apr 05 1:13 PM
‎2010 Apr 05 1:16 PM
Hi,
Where do you want to add the button? Is it in application toolbar or within the report. If you want to add button in application tool bar then do the following:
create a PF-STATUS for the program and list output screen number
PF-STATUS should contain a button and OK_CODE
Call SET PF-STAUS before you dispalying output
In AT USER-COMMAND
check for the ok code of the button and do necessary coding.
Thanks & Regards
Rocky
‎2010 Apr 05 1:28 PM
This is the method to add button on Classical report Selection Screen.
Please note the steps :-
a )Declare TABLES : sscrfields. at the top.
b) SELECTION-SCREEN: FUNCTION KEY 1.
c) declare this in Initialization : MOVE 'button name' TO sscrfields-functxt_01.
d)under At selection-screen
IF sy-ucomm = 'FC01'.
Do what ever u want to do -- functionality.
ENDIF.
‎2010 Apr 05 1:28 PM
hi,
if you use reuse alv grid. you can define your button at pf status. here the example :
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'MY_PF_STATUS'
i_callback_user_command = 'MY_USER_COMMAND'
.
.
.
then :
FORM my_pf_status USING it_extab TYPE slis_t_extab.
SET PF-STATUS 'MY_PF_STATUS'.
ENDFORM. "MY_PF_STATUS
FORM my_user_command USING ip_ucomm TYPE sy-ucomm
ip_selfield TYPE slis_selfield.
CASE ip_ucomm.
WHEN 'VBELN'.
SET PARAMETER ID 'AUN' FIELD ip_sellfield-value.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDCASE.
CLEAR : ip_ucomm.
ip_selfield-refresh =
ip_selfield-col_stable =
ip_selfield-row_stable = 'X'.
ENDFORM.
if you use : write for output.
START-OF-SELECTION.
SET PF-STATUS 'DENEME'.
WRITE : 'EXAMPLE'.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'EXAM'.
BREAK-POINT.
ENDCASE.
if you use Class for ALV u can find more info at here : [OO ALV Reference|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907]
‎2010 Apr 05 1:39 PM
Hi,
use following code
SET PF-STATUS 'STATUS'.
CASE sy-ucomm.
WHEN 'CUSTOMER'.
GET CURSOR FIELD fs_kna1-kunnr
VALUE w_kunnr.
WHEN 'ORDER'.
GET CURSOR FIELD fs_kna1-vbeln
VALUE w_vbeln.
endcase.
double click on STATUS & create 2 buttons there.& in case you need to write coding whatever you want to perform
or else see the below link.
Regards,
Raj.
‎2010 Apr 05 1:48 PM
Thanks to all..for the reply.
i need to format the classical report.how do i do that?
do we have any sytem variable for that?
‎2010 Apr 05 2:17 PM
Moderator message - Please do not ask or answer basic questions - thread locked Rob