2012 Oct 23 9:31 PM
Hi Experts,
I've developed a report to display header and its line items for data archiving. I've problem in implementing i_callback_pf_status_set & i_callback_user_command parameters when calling the function module REUSE_ALV_HIERSEQ_LIST_DISPLAY
I've created separate subroutines to handle this but it overrides the expand and collapse functionality in the output and SY-UCOMM values is replaced by the user command defined in subroutine.
Coding:
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_sort = gt_sort[]
i_save = g_save
i_tabname_header = g_tabname_header
i_tabname_item = g_tabname_item
is_keyinfo = gs_keyinfo
TABLES
t_outtab_header = header_tab
t_outtab_item = line_item_tab.
*----------------------------------------------------------------------*
* Form SET_PF_STATUS *
*----------------------------------------------------------------------*
* Set PF Status *
*----------------------------------------------------------------------*
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'DATAFLOW' EXCLUDING extab.
ENDFORM. " SET_PF_STATUS
*&---------------------------------------------------------------------*
*& Form user_command
*&---------------------------------------------------------------------*
* User Command
*----------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'CHART'.
MESSAGE 'Under Development' TYPE 'I'.
WHEN 'TOGGLE'.
MESSAGE 'Development in progress' TYPE 'I'.
WHEN OTHERS.
ENDCASE.
ENDFORM. "user_command
Whenever i click on expand . collapse i get message 'Under Development' which is assigned for sy-comm CHART. Can anyone help me out to solve this issue.
2012 Oct 24 3:39 PM
I'm not sure I understand what the issue is. Do you want to prevent user command CHART from calling the callback routine? Do you want to change the user command in the callback routine? Please restate more clearly.
2012 Oct 24 3:51 PM
I want to prevent user command CHART from calling the callback routine, when i click on expand/collapse option, it always calls the USER_ COMMAND subroutine and executes the CHART user command.
I should be able to use the standard functionality I.E expand / collapse in output along with custom defined user commands in the report.
2012 Oct 24 4:07 PM
If CHART is a standard user command, be sure that it is not specified in the parameter IT_EVENT_EXIT of the FM call. If it is a custom user command, it will always call the USER_COMMAND callback subroutine. If you want to make a custom GUI Status element that you've created call the standard functionality, you should be able to specify the standard user command for that functionality in your custom GUI Status.
2012 Oct 24 4:17 PM
CHART is a custom user command.
Can you please guide me through on how to implement "If you want to make a custom GUI Status element that you've created call the standard functionality, you should be able to specify the standard user command for that functionality in your custom GUI Status."
I've not done this before, this is my first time.
2012 Oct 25 2:41 PM
Wherever you specified CHART as a user command (i'm guessing you assigned it to a function in the GUI status) you should instead specify the standard user command for Expand. If you read the documentation for the I_CALLBACK_PF_STATUS_SET parameter of FM REUSE_ALV_HIERSEQ_LIST_DISPLAY, you will see that the standard user commands are defined in GUI Status STANDARD of Function Group SALV. If you look at this GUI Status, you will see that the user command for Expand is &XPA. So in your custom GUI status you should specify &XPA instead of CHART.
In the future, you should do what the documentation recommends, which is to start by making a copy of the STANDARD gui status in your own program, and modifying the copied GUI status, instead of starting from scratch. This way you have all of the standard functionality present, and you can add or remove the per your specific requirements.