‎2008 Apr 09 1:38 PM
Hello.
I use these functions to create an output tree:
'RS_TREE_CONSTRUCT', 'RS_TREE_LIST_DISPLAY'
Is there any way to add a button to the output so when they click it, the program closes?
Greets
‎2008 Apr 09 1:45 PM
In RS_TREE_LIST_DISPLAY fill the CALLBACK_PROGRAM, CALLBACK_USER_COMMAND and CALLBACK_GUI_STATUS parameters.
Parameters for USER_COMMAND are
FORM user_command tables node STRUCTURE seucomm
using command
changing exit
list_refresh.There are no parameter for CALLBACK_GUI_STATUS. (Just do a SET PF-STATUS)
You already receive a parameter F15 back from RS_TREE_LIST_DISPLAY if user press the EXIT key (Yellow arrow)
Regards
‎2008 Apr 09 1:45 PM
In RS_TREE_LIST_DISPLAY fill the CALLBACK_PROGRAM, CALLBACK_USER_COMMAND and CALLBACK_GUI_STATUS parameters.
Parameters for USER_COMMAND are
FORM user_command tables node STRUCTURE seucomm
using command
changing exit
list_refresh.There are no parameter for CALLBACK_GUI_STATUS. (Just do a SET PF-STATUS)
You already receive a parameter F15 back from RS_TREE_LIST_DISPLAY if user press the EXIT key (Yellow arrow)
Regards
‎2008 Apr 09 1:52 PM
‎2008 Apr 09 2:19 PM
- Option 1
Use the F15 parameter, and if checked after call tree display, exit program (in your caller program)
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
...
IF F15 = 'X'.
LEAVE PRORAM.
ENDIF.If F15 is checked, user pressed EXIT, else user pressed BACK.
- Option 2
Creat two forms in your caller program, USER_COMMAND and SET_PF_STATUS
In the form PF-STATUS, execute a SET PF-STATUS you have to create on your caller program. (double-clic on the status name or use SE41)
FORM set_pf_status.
SET PF-STATUS 'XXX'.
ENDFORM.In the form USER_COMMAND check the function used and exit program if the desired key is pressed.
FORM user_command TABLES node STRUCTURE seucomm
USING command
CHANGING exit
list_refresh.
CASE command.
WHEN 'BACK'.
exit = 'X'.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDFORM.When calling RS_TREE_LIST_DISPLAY pass the caller program name (do not use sy-repid, move it to a variable) and the name of the forms
w_pgmid = sy-repid.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = w_pgmid
callback_user_command = 'USER_COMMAND'
callback_gui_status = 'SET_PF_STATUS'.
(...)Regards
‎2008 Apr 09 1:46 PM
Hi Dear,
All ready there is button in standard SAP.
Click on Cancel button (F12) or
Exit button (Shift+f3).
REWARD IF USEFUL