2009 Sep 22 7:30 AM
hi GUYS,
I am developing a report .
HI guys,
I am writing a report in the selection screen of the report ....when the user presses 'F6' key in the zprjno field - i should popup some message.
the following is my code......but my report not recognises the "pf status"
for your information i have assigend 'f6" key. in pf status function key options.
correct me where i went wrong.
REPORT Z_TEST_3.
START-OF-SELECTION.
parameters : zprjno type ztable-zinput_fld.
parameters : zmatrix type ztable-zcodematrix.
parameters : zrem type ztable-zrem.
set PF-STATUS 'STATUS1'.
at user-command.
if sy-ucomm = 'F6'.
break-point.
endif.
hi GUYS,
I am developing a report .
HI guys,
I am writing a report in the selection screen of the report ....when the user presses 'F6' key in the zprjno field - i should popup some message.
the following is my code......but my report not recognises the "pf status"
for your information i have assigend 'f6" key. in pf status function key options.
correct me where i went wrong.
REPORT Z_TEST_3.
START-OF-SELECTION.
parameters : zprjno type ztable-zinput_fld.
parameters : zmatrix type ztable-zcodematrix.
parameters : zrem type ztable-zrem.
set PF-STATUS 'STATUS1'.
at user-command.
if sy-ucomm = 'F6'.
break-point.
endif.
2009 Sep 22 7:39 AM
Try this.
parameters: date like pa0001-begda.
start-of-selection.
write: 'Test'.
set PF-STATUS 'ZSTATUS'.
at user-command.
Case sy-ucomm.
When 'MSG'. -------> give MSG text for f6 in pf status
message 'check pf status in Se41' type 'I'.
endcase.
Now if u press f6 after executing the report you get the message.
2009 Sep 22 8:09 AM
hi ,
Your suggestions were useful.. it worked out....but i need to write - statement and after executing the same ...... if i press F6 key it is working..... but my requirment is before executing. ( in the selection screen itself - if i press F6 , please comment the write statement as follows and try pressing F6 KEY.
parameters : zprjno type ztable_fpro-zinput_fld.
parameters : zmatrix type ztable_fpro-zcodematrix.
parameters : zrem type ztable_fpro-zrem.
write : 'test'. "you please comment this line and try pressing F6 KEY - Nothing is happening"
set PF-STATUS 'STATUS1'.
at user-command.
if sy-ucomm = 'MSG'.
break-point.
endif.
2009 Sep 22 8:17 AM
Giriznet,
can you please explain a bit more. i couldnot understand the requirement.
write is used in LISTs not in screens.
you can use
"selection-screen comment 1(30) text-001" to write things in selection scren
2009 Sep 22 8:26 AM
This documentation explains everthing.Pl check it
link:[set pf statusin selection screen|http://help.sap.com/saphelp_nw04/helpdata/en/e7/0eb237e29bc368e10000009b38f8cf/content.htm]
2009 Sep 22 8:30 AM
You need to use AT SELECTION-SCREEN OUTPUT event along
with this FM RS_SET_SELSCREEN_STATUS.
2009 Sep 22 8:35 AM
PARAMETERS : p1 type char10.
SET PF-STATUS 'PPP'.
WRITE: 'hello'.
at USER-COMMAND.
if sy-ucomm = 'MYKEY'.
MESSAGE 'Hello There' type 'I'.
endif.this is my code... here... i have creted PF status PPP and assigned 'MYKEY' as fcode to F6 in the function keys.
and here first it displays the 'hello' and then when you press F6 it displays the message
2009 Sep 22 7:44 AM
It's not the key pressed that is set in sy-ucomm but is the FCODE that you assign in your pf-status.
if sy-ucomm = <fcode>.
...
endif.
2009 Sep 22 7:44 AM
have you activated your PF status?
if yes, then check whats the FCODE assigned to F6 for you. you should check this FCODE at user command.
if sy-ucomm = '<FCODE>' . " the function code
message ....
endif.
2009 Sep 22 7:51 AM
Check ur pf-status STATUS1 and see whether the F6 key is activated or not.
What is the Function Code that u are using for F6 key.
in ur code write this
if sy-ucomm = 'fncode'. (name of function code assigned to F6 key)
break.
endif.
Also while debugging u can check sy-ucomm field what value is getting there on F6 press