Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

pf status and function codes

Former Member
0 Likes
2,358

Hi,

I have a report where in i have to add a new icon with a tick symbol along with the existing execute icon ie f8.I have copied the status of the program into another before adding the new icon and to that i have added the new icon and function code.

i have used set pf-status in the initialisation event.Now when i give the select options and press f8 it enters into the program but sy-ucomm is still empty and does not do the desired functionality.If i click the icon for test run it does not enter the program itself.Can anyone help me out on this.

The status is activated in se41.

Points will be rewarded.

Please help.

Regards,

Sowmya.

5 REPLIES 5
Read only

Former Member
Read only

Former Member
0 Likes
1,334

Hi Sowmya,

Use the following code to show button in tool bar.

Dont use 'Set pf-status'

  • Add button to application toolbar

SELECTION-SCREEN FUNCTION KEY 1. "Will have a function code of 'FC01'

INITIALIZATION.

MOVE 'icon_name'to SSCRFIELDS-FUNCTXT_01.

Reward if useful,

Regards,

Talwinder

Read only

0 Likes
1,334

HI,

Can you elaborate a little as to how to proceed.

Regards,

Sowmya.

Read only

Former Member
0 Likes
1,334

hi,

just try like that used in the report: demo_list_at_user_command

like:



START-OF-SELECTION.
  WRITE: 'Basic List',
       / 'SY-LSIND:', sy-lsind.

TOP-OF-PAGE.
  WRITE 'Top-of-Page'.
  ULINE.

TOP-OF-PAGE DURING LINE-SELECTION.
  CASE sy-pfkey.
    WHEN 'TEST'.
      WRITE 'Self-defined GUI for Function Codes'.
      ULINE.
  ENDCASE.

AT LINE-SELECTION.
  SET PF-STATUS 'TEST' EXCLUDING 'PICK'.
  PERFORM out.
  sy-lsind = sy-lsind - 1.

AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'FC1'.
      PERFORM out.
      WRITE / 'Button FUN 1 was pressed'.
    WHEN 'FC2'.
      PERFORM out.
      WRITE / 'Button FUN 2 was pressed'.
    WHEN 'FC3'.
      PERFORM out.
      WRITE / 'Button FUN 3 was pressed'.
    WHEN 'FC4'.
      PERFORM out.
      WRITE / 'Button FUN 4 was pressed'.
    WHEN 'FC5'.
      PERFORM out.
      WRITE / 'Button FUN 5 was pressed'.
  ENDCASE.
  sy-lsind = sy-lsind - 1.

FORM out.
  WRITE: 'Secondary List',
       / 'SY-LSIND:', sy-lsind,
       / 'SY-PFKEY:', sy-pfkey.
ENDFORM.

When you run the program, the system displays the following basic list with a the page header defined in the program:

You can trigger the AT LINE-SELECTION event by double-clicking a line. The system sets the status TEST and deactivates the function code PICK. The status TEST contains function codes FC1 to FC5. These are assigned to pushbuttons in the application toolbar. The page header of the detail list depends on the status. 

Here, double-clicking a line no longer triggers an event. However, there is now an application toolbar containing five user-defined pushbuttons. You can use these to trigger the AT USER-COMMAND event. The CASE statement contains a different reaction for each pushbutton. 

For each interactive event, the system decreases the SY-LSIND system field by one, thus canceling out the automatic increase. All detail lists now have the same level as the basic list and thus overwrite it. While the detail list is being created, SY-LSIND still has the value 1. 

Regards,

Renjith Michael.

Read only

ak_upadhyay
Contributor
0 Likes
1,334

Hi Sowmya,

Check ABAPDOCU, there are so many sample programs.

Regards

AK