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

Button at application Toolbar in Output

Former Member
0 Likes
2,576

Hi friends,

In my classical report output,i want to add one button in application toolbar.so i have applied PF -STATUS for this. But when i am doing so..my standard buttons like back,cancel and save are automatically disabled..I dont want to write explicit code for back,save and cancel.. i want this button to work in addition to standard functionality..please guide me how to get this one..and also tell me to where write SET PF-STATUS 'STATUSNAME' in code..after which event..Also i have copied standard PF Status for it but it is not working

Thanks,

Gaurav

Edited by: Gaurav Kumar on May 25, 2009 3:11 PM

Edited by: Gaurav Kumar on May 25, 2009 3:12 PM

Hi friends,

In my classical report output,i want to add one button in application toolbar.so i have applied PF -STATUS for this. But when i am doing so..my standard buttons like back,cancel and save are automatically disabled..I dont want to write explicit code for back,save and cancel.. i want this button to work in addition to standard functionality..please guide me how to get this one..and also tell me to where write SET PF-STATUS 'STATUSNAME' in code..after which event..Also i have copied standard PF Status for it but it is not working

Thanks,

Gaurav

Edited by: Gaurav Kumar on May 25, 2009 3:11 PM

Edited by: Gaurav Kumar on May 25, 2009 3:12 PM

6 REPLIES 6
Read only

Former Member
0 Likes
1,125

Hi,

When you are creating SET PF-STATUS you need to create all the butons like BACK, CANCEL and then activate it. You will fet it an application toolbar. SET PF_STATUS better you can use it an

Initialization or Start-of-Selection event.

Regards

Thiru

Read only

Former Member
0 Likes
1,125

Hi,

This PF Status you can write any where for classical report. would be better to write before your write statement. Back, Exit , Cancel you will have to enable separately. After Enabling need not to write much code.

Just write this.



AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'back' OR 'exit' OR 'cancel'.
      CALL SCREEN 0.
  ENDCASE.

Regards

Vishnu Gupta

Read only

Former Member
0 Likes
1,125

Hi,

Write your set pf-status at the start-of-selection. i.e, when all the processing commands are done or at the start end-of-selection.

you have an option in set pf-status.

goto EXTRAS in the menubar and then Adjust template

there select the template status as List template Radio button. so that you can get all the standard functions function codes on the screen and it won't be necessary for you to maintain in your program.

get the standard function codes of the buttons from the below link so it is not necessary to write the code for them explicitly in your program.

[Function Codes of the Screen|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba34635c111d1829f0000e829fbfe/content.htm]

Then write the your custom function code

Thanks&Regards

Sarves

Read only

Former Member
0 Likes
1,125

Hi Gaurav,

I have worked on same application but for ALV. Hcave look on following code it might help you.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK =

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = v_repid

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

it_fieldcat = fcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = itab

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

&----


*& Form set_pf_status

&----


  • Set PF-STATUS for user's push button

----


FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZNEWSTATUS'.

ENDFORM. " PF_STATUS_NEW

&----


*& Form user_command

&----


  • Click on button gives popup information

----


FORM user_command USING ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

lv_ucomm

= sy-ucomm.

CASE lv_ucomm.

WHEN 'BUTTON'.

MESSAGE 'Working well' TYPE 'I'.

ENDCASE.

ENDFORM. "user_command

Hope it will resolve your prblm

Thanks

Lokesh.

Edited by: Lokesh Tarey on May 25, 2009 12:13 PM

Read only

Former Member
0 Likes
1,125

You need not write any code for Back, exit and cancel.

Just in the Status name them and activate them thats it and of course add them to your application toolbar.

and u can set the PF-STATUS at the time of displaying that is after writing the write statements.

Edited by: vijetasap on May 25, 2009 12:18 PM

Read only

Former Member
0 Likes
1,125

Hi,

Double click of SET PF-STATUS 'STATUS'. Go to function key and in the standard tool bar add what all buttons are needed over there in o/p screen.And you can add button in application toolbar there itself then activate it.There is no need to write code for activating standard toolbar buttons.Hope this helps.

Thanks and Regards,

Jayakrishnan R