‎2009 Mar 30 5:16 AM
Hi Experts,
I have one query. In my ALV output display, I am getting save button as disable mode.
Actually my user wants to save the layout once he hide the particular fields & all.
I have seen the code but there is as such no PF status is maintained for that report.
Can anybody suggest me what I supposed to do so that I can save the layout?
Thanks,
Neha
‎2009 Mar 30 6:55 AM
Hi Neha,
Declare i_callback_pf_status_set = 'SET_PF_STATUS' in CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'. Now declare Pf status.
form set_pf_status USING rt_extab TYPE slis_t_extab.
*- Pf status
set pf-status 'ZSTANDARD'.
endform.
**************************************************
In Pf status Zstandard.
go to extra than there choose adjust template. Now Activate it .
From this you can use max functionality of ALV including SAVE button.
Regards,
Himanshu
‎2009 Mar 30 5:21 AM
Hi,
Goto SE41, create a pf-status for your alv report program.
On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
Delete the unwanted buttons and also you can add new buttons if reqd.
Activate pf-status --> and apply in alv program.
Hope this helps you.
Regards,
Tarun
‎2009 Mar 30 5:22 AM
Use menu painter SE41 . create PF status with desired buttons and add it to your screen
Edited by: harsh bhalla on Mar 30, 2009 9:53 AM
‎2009 Mar 30 5:24 AM
In case of OOPs alv Please check field catalog or layout options.
‎2009 Mar 30 5:33 AM
Hi Neha,
ALV automatically sets a PF status (ie the row of buttons above the report). With which you can do a lot functions like sorting, mailing or saving as a local file.
I suggest you check your code once again or go through some sample codes you will find in wiki.
Otherwise you may alternatively set PF status in SE41 and copy the standard buttons from SAPLSALV to your PF status.
In SE41, Program = SAPLSALV, Status = STANDARD.
Press the 'Copy Status' button
Then in "to Program:" type your program name.
In "Status:" type your PFstatus name say Z_STANDARD.
Press Copy. Its created. Now you change accordingly if you need to.
Regards.
Edited by: rajan roy on Mar 30, 2009 7:12 AM
‎2009 Mar 30 6:47 AM
hi,
you have to create a pf-status as mentioned by the experts in the above replies.And then you have to include the following piece of code in your program to activate the pf-status.
FORM pf_status USING r_ucomm.
SET PF-STATUS <name of the created pf-status in single quotes> EXCLUDING r_ucomm.
ENDFORM.
And then you have to uncomment the 'i_callback_pf_status_set' parameter in the exporting parameter list of the 'Reuse_Alv_List_Display' function module, (if you are using it), and set its value to 'PF_STATUS' as given below:
i_callback_pf_status_set = 'PF_STATUS'
I hope this solves your problem.
thanks,
Abhijit
Edited by: Abhijit Banerjee on Mar 30, 2009 11:45 AM
‎2009 Mar 30 6:52 AM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_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 = it_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A' -- Add this in ur code
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 = it_final
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.
‎2009 Mar 30 6:55 AM
Hi Neha,
Declare i_callback_pf_status_set = 'SET_PF_STATUS' in CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'. Now declare Pf status.
form set_pf_status USING rt_extab TYPE slis_t_extab.
*- Pf status
set pf-status 'ZSTANDARD'.
endform.
**************************************************
In Pf status Zstandard.
go to extra than there choose adjust template. Now Activate it .
From this you can use max functionality of ALV including SAVE button.
Regards,
Himanshu
‎2009 Mar 31 6:37 AM
Hi Guys,
Thanks for your valuable reply. But still that "SAVE" button is in disable mode. Can you please suggest me how I can make it enabled?
Thanks,
Neha
‎2009 Mar 31 6:58 AM
Hi,
First of all, you should understand there is NO LINK between SAVE button and SAVING LAYOUT.
If the user wants to SAVE the layout, user has to press CHANGE LAYOUT button in ALV tool bar ( not in the Application Tool Bar ).
There user has to select the fields and can SAVE the layout using SAVE button in the POP-UP menu (Change Layout).
‎2009 Mar 31 7:18 AM
hi,
had u check with
i_save = 'A'
or else define SET_PF_STATUS in ur FM.
‎2009 Mar 31 7:23 AM
Hi,
Goto SE41, create a pf-status for your alv report program.
On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
Delete the unwanted buttons and also you can add new buttons if reqd.
Activate pf-status --> and apply in alv program.
Now refer the wiki code using the save layout option and use variant to display correspoding data:-
Refer to the use of variants.
Hope this helps you.
Regards,
Tarun
‎2009 Mar 31 7:01 AM
Hi,
You need to pass 'A' for all, "U' for User Specific to I_SAVE export parameter of ALV grid display FM.
Thanks,
Sriram Ponna.