08-12-2008 7:39 AM
Hello,
I want to keep a button in the ALV report screen application bar for this what is the function that i have to use ?
And when i click the button i should be able to communicate with another data ? Please help me to achieve this requirment.
Thanks
08-12-2008 7:43 AM
Hi ,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repname
i_callback_pf_status_set = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
form set_pf_status.
set pf-status 'SAT'. " Here u can create a button
endform
Edited by: A kumar on Aug 12, 2008 8:47 AM
08-12-2008 7:44 AM
08-12-2008 7:46 AM
Hi
Check the below link it will helpful
http://saptechnical.com/Tutorials/ALV/HighlightVisitedRecord/Demo.htm
Regards,
Syf
08-12-2008 7:47 AM
Hi,
First thing you copy the standard PF status to z pf-status and add the required buttons in that and use that include like this,
Form PFSTATUS
set pf-status 'ZPFSTATUS'. " Here u can create a button
ENDFORM.
Give this form name in the following FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repname
i_callback_pf_status_set = 'PFSTATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
AND in the USE_COMMAND form you write the code what you need to ferform after clicking that button,
Hope this will sove you problem
Regards,
KP
Edited by: krishna prasad on Aug 12, 2008 8:58 AM
08-12-2008 7:47 AM
Hi,
First thing you copy the standard PF status to z pf-status and add the required buttons in that and use that include like this,
Form PFSTATUS
set pf-status 'ZPFSTATUS'. " Here u can create a button
ENDFORM.
Give this form name in the following FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = repname
i_callback_pf_status_set = 'PFSTATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
AND in the USE_COMMAND form you write the code what you need to ferform after clicking that button,
Hope this will sove you problem
Regards,
KP
Edited by: krishna prasad on Aug 12, 2008 8:59 AM
08-12-2008 7:51 AM
Hello,
For this you need to create a GUI Status for this & attach this to the ALV.
1. Go to SE41 & copy the GUI 'STANDARD' of the program 'SAPLSALV' to 'ZSTANDARD' & assign it to ur program.
2. Then try this bit of code:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'F_PF_STATUS' "--> Perform to associate GUI-Status to the ALV
I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
IS_LAYOUT = FP_ST_LAYOUT
IT_FIELDCAT = FP_IT_FIELDCAT
I_SAVE = 'A'
TABLES
T_OUTTAB = FP_IT_OUTPUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Error in calling Standard ALV Functional Module
MESSAGE I019. "Error Occured in ALV Function Module
LEAVE LIST-PROCESSING.
ENDIF.
FORM F_PF_STATUS
USING FP_IT_EXTAB TYPE SLIS_T_EXTAB. "#EC CALLED
SET PF-STATUS L_C_STATUS EXCLUDING FP_IT_EXTAB.
ENDFORM.
In FP_IT_EXTAB add the buttons u want to delete.
Hope this helps.
BR,
Suhas