SAP Virtual/Onsite Trainings

Document Categories:

What's New?

Contribute?

Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Enable or Disable Function Keys on the application tool bar and menu painter

By Prasanna, Infosys

Introduction:

Enable or display the function keys or pushbuttons on the application tool or menu painter.

Step 1:

Create a program with name ZPROG_FKEY through transaction SE38.

Step 2:

Write the following code inside the program.

TYPE-POOLS: SLIS.
TABLES: T001T.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_BUKRS TYPE BUKRS.
SELECTION-SCREEN END OF BLOCK B1.


DATA: LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: IT_T001T TYPE STANDARD TABLE OF T001T.

START-OF-SELECTION.
  PERFORM GET_DATA.
  PERFORM BUILD_FCAT.
  PERFORM DISPLAY_DATA.

*&---------------------------------------------------------------------*
*&      FORM  GET_DATA
*&---------------------------------------------------------------------*
*       GET COMPANY CODE INFORMATIONS
*----------------------------------------------------------------------*
FORM GET_DATA .

  SELECT * FROM T001T
    INTO TABLE IT_T001T
    WHERE BUKRS = P_BUKRS.
ENDFORM.                    " GET_DATA
*&---------------------------------------------------------------------*
*&      FORM  BUILD_FCAT
*&---------------------------------------------------------------------*
*       Build Fieldcatalog for alv display
*----------------------------------------------------------------------*
FORM BUILD_FCAT .

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      I_PROGRAM_NAME         = SY-REPID
      I_STRUCTURE_NAME       = 'T001T'
    CHANGING
      CT_FIELDCAT            = LT_FIELDCAT[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE = 1
      PROGRAM_ERROR          = 2
      OTHERS                 = 3.
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

ENDFORM.                    " BUILD_FCAT

*&---------------------------------------------------------------------*
*&      FORM  DISPLAY_DATA
*&---------------------------------------------------------------------*
*       DISPLAY REPORT OUTPUT
*----------------------------------------------------------------------*

FORM DISPLAY_DATA .

  DATA: LS_LAYOUT TYPE SLIS_LAYOUT_ALV.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM       = SY-REPID
      I_CALLBACK_PF_STATUS_SET = 'SET_STATUS'
      IS_LAYOUT                = LS_LAYOUT
      IT_FIELDCAT              = LT_FIELDCAT
    TABLES
      T_OUTTAB                 = IT_T001T
    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.

ENDFORM.                    " DISPLAY_DATA

*&---------------------------------------------------------------------*
*&      FORM  SET_STATUS
*&---------------------------------------------------------------------*
*            RT_EXTAB -> EXCLUDING TABLE
*----------------------------------------------------------------------*
FORM SET_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB
  SET PF-STATUS 'PF_STATUS'
ENDFORM.
 

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image