‎2008 Dec 04 7:24 AM
Hi,
I have to develop a report which will get no of queries (sq01) generated in SAP system, then I( have to segregate it to the Functional area which I have done, now on my final output list, I am having a description like
*No. of queries generated * some number.
similarly it will display for each functional area, now my problem is, when I click on particular decription it should get the data related to that area, how can I get this done.
Best Regards.
‎2008 Dec 04 7:45 AM
Hi Vikram Kagada,
To use USER COMMAND.
First you need to create a PF-STATUS and set this pf in your report program.
Create some buttons. For each button, there is a function code associated.
Now, you need to handle the click event of the buttons at event 'AT USER-COMMAND' using their function code.
When you click any button, system field sy-ucomm will store its function code.
You can use this dummy code:-
REPORT z_demo.
data : ok_code type sy-ucomm.
ok_code = sy-ucomm.
START-OF-SELECTION.
set pf-status 'Z_PF'. "this is the pf-status associated with the report program.
AT USER-COMMAND.
case ok_code.
when 'ADD'. "for button having function code ADD
*code
when 'DEL'. "for button having function code DEL
*code
endcase.
Hope this solves your problem.
Thanks & Regards.
Tarun Gambhir.
‎2008 Dec 04 7:45 AM
Hi Vikram Kagada,
To use USER COMMAND.
First you need to create a PF-STATUS and set this pf in your report program.
Create some buttons. For each button, there is a function code associated.
Now, you need to handle the click event of the buttons at event 'AT USER-COMMAND' using their function code.
When you click any button, system field sy-ucomm will store its function code.
You can use this dummy code:-
REPORT z_demo.
data : ok_code type sy-ucomm.
ok_code = sy-ucomm.
START-OF-SELECTION.
set pf-status 'Z_PF'. "this is the pf-status associated with the report program.
AT USER-COMMAND.
case ok_code.
when 'ADD'. "for button having function code ADD
*code
when 'DEL'. "for button having function code DEL
*code
endcase.
Hope this solves your problem.
Thanks & Regards.
Tarun Gambhir.
‎2008 Dec 04 7:52 AM
Hi,
One point missed in Tarun's reply is,
You can make use of GET CURSOR FIELD fname VALUE fval. to get the field name and field value after the user clicks on the screen.
Thanks,
Lakshmi
‎2008 Dec 04 7:48 AM
Hi,
Thanks for the reply but I am not having button, I was able to resolve it, I have used CP.