2008 Jun 13 10:04 AM
Hi,
I have a clssical report and i want to add a button on the output of the report (NOT an ALV REPORT)
On clicking on the button some functionality will happen.
Can anyone help me on this.
Regards
Sandipan
2008 Jun 13 10:07 AM
create a PF-STATUS for the program and list output screen number
PF-STATUS should contain a button and OK_CODE
Call the SET PF-STAUS before you output list
In AT USER-COMMAND
for the ok code of the button, code necessary
Hi,
I have a clssical report and i want to add a button on the output of the report (NOT an ALV REPORT)
On clicking on the button some functionality will happen.
Can anyone help me on this.
Regards
Sandipan
2008 Jun 13 10:07 AM
create a PF-STATUS for the program and list output screen number
PF-STATUS should contain a button and OK_CODE
Call the SET PF-STAUS before you output list
In AT USER-COMMAND
for the ok code of the button, code necessary
2008 Jun 13 10:08 AM
Hi Sandipan,
Use * SET PF-Status* to get the buttons on the output.
And write the functionality in Cases.
Suppose that you kept Back and ZZZ buttons in pf-status.
Ex:
Case Sy-ucomm.
When 'BACK'.
Leave to Screen 'XXX'.
When 'ZZZ'.
write functionality you want to happen.
Endcase.
Reward Points If Helpful.
Thanks,
Khan.
2008 Jun 13 10:09 AM
use the SET PF-STATUS command and in this PF-STATUS you can create the button. Assign it a OK-CODE and catch this in your program using the sy-ucomm variable.
you can write the SET PF-status command in the at selection-screen output event.
2008 Jun 13 10:10 AM
Hi,
when this is a customer report, then you can add a new function code to the screen status of the output screen. And in PAI you have to react in coding on this new function code.
See [Defining a Status|http://help.sap.com/saphelp_nw70/helpdata/EN/d1/801d36454211d189710000e8322d00/frameset.htm] and [Processing Screens|http://help.sap.com/saphelp_nw70/helpdata/EN/47/e07f682b9911d2954f0000e8353423/frameset.htm].
Regards Rudi
2008 Jun 13 10:10 AM
hi,
Try like this
TABLES : vbrk.
DATA : off TYPE i,
lin TYPE i,
fld TYPE char10.
DATA : BEGIN OF itab OCCURS 0,
vbeln LIKE vbrk-vbeln,
fkart LIKE vbrk-fkart,
fkdat LIKE vbrk-fkdat,
netwr LIKE vbrk-netwr,
kunag LIKE vbrk-kunag,
END OF itab.
TOP-OF-PAGE.
ULINE AT /1(80).
FORMAT COLOR 3 ON.
WRITE:/1 sy-vline,
3 'Billing Doc.',
18 sy-vline,
20 'Billing Type',
33 sy-vline,
35 'Billing Date',
48 sy-vline,
50 'Net Value',
68 sy-vline,
69 'Customer',
80 sy-vline.
ULINE AT /1(80).
FORMAT COLOR OFF.
START-OF-SELECTION.
SET PF-STATUS 'TEST'.
SELECT vbeln fkart fkdat netwr kunag FROM vbrk
INTO CORRESPONDING FIELDS OF TABLE itab.
LOOP AT itab.
WRITE:/1 sy-vline,
itab-vbeln UNDER 'Billing Doc.' HOTSPOT ON,
18 sy-vline,
itab-fkart UNDER 'Billing Type',
33 sy-vline,
itab-fkdat UNDER 'billing Date',
48 sy-vline,
itab-netwr UNDER 'Net Value' LEFT-JUSTIFIED,
68 sy-vline,
itab-kunag UNDER 'Customer' HOTSPOT ON,
80 sy-vline.
ENDLOOP.
ULINE AT /1(80).
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'BACK' OR 'UP' OR 'CANC'.
LEAVE PROGRAM.
ENDCASE.
reward if usefull.....
2008 Jun 13 10:10 AM
HI,
at start-of-selection.
you can write a set pf-status.
so create a GUI status.In that you can create a button in application toolbar.
and for code on clickin a button ,you can write it at user-command same like module pool...
hope this will help u..
2008 Jun 13 10:13 AM
hiii
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.
reward if useful
thx
twinkal
2008 Jun 13 10:16 AM
Hi Sandipan,
The output screen will automatically generate the default PF Status will display. in your report create own PF status and call in your report.
Example
REPORT zb_set.
DATA :n_c(10) TYPE n,
c_n(10) TYPE c.
START-OF-SELECTION.
SET PF-STATUS '100'.
n_c = '10'.
IF n_c IS INITIAL.
WRITE: 'Char'.
ELSE.
WRITE: n_c.
ENDIF.
Reward if found helpful
Regards,
Boobalan Suburaj
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |