Application Development 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: 

ALV button in Application tool bar ?

0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

hi

use this link

Cheers

Snehi

Former Member
0 Kudos

Hi

Check the below link it will helpful

http://saptechnical.com/Tutorials/ALV/HighlightVisitedRecord/Demo.htm

Regards,

Syf

Former Member
0 Kudos

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

Former Member
0 Kudos

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

SuhaSaha
Advisor
Advisor
0 Kudos

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