Tuesday, February 26, 2019

Interview Questions & Answers for SAP ABAP .



Interview Questions & Answers for SAP ABAP.

1. What guarantees the integration of all application modules?
The R/3 basis system guarantees the integration of all application modules.  The R/3 basis s/w provides the run time environment for the R/3 applications ensures optimal integration, defines a stable architectural frame for system enhancements, and contains the administration tools for the entire system.One of the main tasks of the basis system is to guarantee the portability of the complete system.

 2. What are the central interfaces of the R/3 system?
     Presentation Interface.
     Database Interface.
     Operating system Interface.
 3. Which interface controls what is shown on the p.c.?
     Presentation Interface.

 4. Which interface converts SQL requirements in the SAP development system to those of the database?
     Database Interface.

 5. What is SAP dispatcher?
     SAP dispatcher is the control agent that manages the resources for the R/3 applications.

 6. What are the functions of dispatcher?
     Equal distribution of transaction load to the work processes.
     Management of buffer areas in main memory.
     Integration of the presentation levels.
     Organization of communication activities.

 7. What is a work process?
     A work process is where individual dialog steps are actually processed and the work is done.  Each work process handles one type of request.

 8. Name various work processes of R/3 system?
    Dialog or Online (processes only one request at a time).
    Background (Started at a specific time)
    Update (primary or secondary)
    Enque (Lock mechanism).
    Spool (generated online or during back ground processing for printing).

 9. Explain about the two services that are used to deal with communication.
Message Service: Used by the application servers to exchange short internal messages, all system communications.
Gateway Service: Enables communication between R/3 and external applications using CPI-C protocol.

 10. Which work process triggers database changes?
Update work process.

 11. Define service (within R/3)?
A service is a process or group of processes that perform a specific system function and often provide an application-programming interface for other processes to call.

 12. What are the roll and page areas?
Roll and page areas are SAP R/3 buffers used to store user contexts (process requests).  The SAP dispatcher assigns process requests to work processes as they are queued in the roll and page areas.
Paging area holds data from the application programs.
Roll area holds data from previous dialog steps and data that characterize the user.

 13. What are the different layers in R/3 system?
Presentation Layer.
Application Layer.
Database Layer.

 14. What are the phases of background processing?
Job Scheduling.
Job Processing.
Job Overview.

 15. What components of the R/e system initiate the start of background jobs at the specified time?
The batch scheduler initiates the start of background job.  The dispatcher then sends this request to an available background work process for processing.

 16. Define Instance.
An instance is an administrative unit in which components of an R/3 systems providing one or more services are grouped together.  The services offered by an instance are started and stopped at random.  All components are parameterized using a joint instance profile.  A central R/3 system consists of a single instance in which all-necessary SAP services are offered.  Each instance uses separate buffer areas.

 17. From hardware perspective, every information system can be divided into three task areas Presentation, Application Logic and Data Storage.
The R/3 Basis software is highly suitable for use in multi-level client/server architectures.

 18. What are R/3 Basis configurations?
A central system with centrally installed presentation software.
Two-level client/server system with rolled out presentation software.
Two-level client/server system. Presentation and Application run on the same computer.
Three-level client/server system.  Presentation, Application and database each run on separate computers.

 19. What is a Service in SAP terminology?
A service refers to something offered by a s/w component.

 20. What is Server in SAP terminology?
A component can consist of one process or a group and is then called the server for the respective service.

 21. What is a client in SAP terminology?
A S/W component that uses the service (offered by a s/w component) is called a Client.  At the same time these clients may also be servers for other services.

 22.What is a SAP system?
The union of all s/w components that are assigned to the same databases is called as a SAP system.

 23. What is the means of communications between R/3 and external applications?
The means of communication between R/2,R/3 and external applications is via the CPI-C handler or SAP Gateway, using the CPI-C Protocol.

 24. What is the protocol used by SAP Gateway process?
The SAP Gateway process communicates with the clients based on the TCP/IP Protocol.

 25. Expand CPI-C.
Common Program Interface Communication.

 26. What is a Spool request?
Spool requests are generated during dialog or background processing and placed in the spool database with information about the printer and print format.  The actual data is places in the Tem Se (Temporary Sequential objects).

 27. What are different types of Log records?
V1 and V2.  V1 must be processed before V2.  But, we can have more than one V2 logs.

 28. What are the types of Update requests?
An update request can be divided into one primary (V1) and several Secondary update components (V2).  Time-critical operations are placed in V1 component and those whose timing is less critical are placed in V2 components.  If a V1 update fails, V2 components will not be processed.

 29. Dialog work processes perform only one dialog step and then available for the next request.

 30. Explain what is a transaction in SAP terminology.
In SAP terminology, a transaction is series of logically connected dialog steps.

 31. Explain how SAP GUI handles output screen for the user.
The SAP front-end s/w can either run on the same computer or on different computers provided for that purpose. User terminal input is accepted by the SAP terminal program SAP GUI, converted to SAP proprietary format and sent to the SAP dispatcher.  The dispatcher coordinates the information exchange between the SAP GUIs and the work processes.  The dispatcher first places the processing request in request queues, which it then processes.  The dispatcher dispatches the requests one after another, to the available work process.  The actual processing takes place in the work process.  When processing is complete, the result of a work process is returned via the dispatcher to the SAP GUI.  The SAP GUI interprets the received data and generates the output screen for the user.

1.       What is full form of BDC Session?
Batch Data Communication Session.

2.       What are the steps in a BDC session?
The first step in a BDC session is to identify the screens of the transaction that the program will process.  Next step is to write a program to build the BDC table that will be used to submit the data to SAP.  The final step is to submit the BDC table to the system in the batch mode or as a single transaction by the CALL TRANSACTION command.

3.       How do you find the information on the current screen?
The information on the current screen can be found by SYSTEM à STATUS command from any menu.

4.       How do you save data in BDC tables?
The data in BDC tables is saved by using the field name ‘BDC_OKCODE’ and field value of ‘/11’.

5.       What is the last entry in all BDC tables?
In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of ‘/11’.

6.       What is a multiple line field?
A multiple line field is a special kind of field which allows the user to enter multiple lines of data into it.

7.       How do you populate data into a multiple line field?
To populate data into a multiple line field, an index is added to the field name to indicate which line is to be populated by the BDC session (Line index).

8.       Write the BDC table structure.
BDC table structure
FIELD                     TYPE                            DESCRIPTION
Program                CHAR (8)                      Program name of transaction.
DynPro                  CHAR (4)                      Screen number of transaction.
DynBegin              CHAR (1)                      Indicator for new screen.
Fnam                     CHAR (35)                     Name of database field from screen.
Fval                       CHAR (80)                     Value to submit to field.

9.       Does the CALL TRANSACTION method allow multiple transactions to be processed by SAP?
No.  The CALL TRANSACTION method allows only a single transaction to be processed by SAP.

10.    Does the BDC-INSERT function allow multiple transactions to be processed by SAP?
Yes.

11.    What is the syntax for ‘CALL TRANSACTION’?
CALL TRANSACTION trans [using bdctab MODE mode].
Three possible entries are there for MODE.
                  A          -           Show all screens.
                  E          -           Show only screens with errors.
                  N          -           Show no screens.


SAP ABAP Interview Questions & Answers Details.



SAP ABAP Interview Questions & Answers Details.


 1. What is the difference between Check table and value table


 Check Table : Master Table
      Value Table: Table Across Which All the Values Are Selected.

 2. What are the events and the flow of the events in reports.

       Events in Order
       Initialization
       At selection-screen
       At selection-Screen 0n Block 
       Start-of-Selection
       Top-of-page
       End-of-page
       End-of-Selection

 3. What are the internal table events
      AT First
      At New 
      At End of 
      At Last

 4. If we applied at new event on a character column, what will the result?

  All character type fields (on the right) are filled with "*" after the current control

 5.What is the difference between select single and select upto.

         Select Single is not loop and it doesn> '> t contain EndSelect,
         Where as Upto Contains Endselect and it> '> s a loop.

 6. What are the type of BDC and differences? which is the best one? in which   synario each  will use?
        a> Call Transacation -> errors have to be explicitly handled -> Large Data
        b> Session -> Need Not Handle Errors -> Less Data, Time Consuming

 7. What is the differnce between open form and start form in scripts

   Open_form to Open particular Form
        Start_form to Open PARTICULAR Page in a specific Form

 8. What is the use of control form function in scripts?

       To Avoid Page Break

 9. What are the differnt types of internal tables?
        Standard
        Hashed >
        Indexed.

10. Which system varible can be used for handling the interactive reports?
      Ans :SY-LISEL

 11. How many levels of drill down reports are possible in interactive reports?
       Ans :20

 12. How many main windows are possible in a script?
      Ans :99

 13. Include structure in itab and insert data into int, apply collect
            statement and give the result.

 14. Which view will use single table in selection -
      Ans :A Projection view

 15. How we can represent a logical database in program
      Ans : Nodes.

 16. What is the result of Reset command
      Ans : 'Format reset' command sets the format to default.

 17. Can we place multiple tab control in a sub screen
      Ans : Yes

 18. How many main windows can we include in a page window
      Ans : 99

 19. How we can specify client id in our program. -
       SELECT ... FROM
       CLIENT SPECIFIED ...

 20. SET FIXED DECIMALS 2
       Data: sum type p value '3876.9898'.
       write:/ sum.

 Ans : Error !! No command like 'set fixed decimails'.

 21. loop at itab.
        WRITE_FORM 'ITEM_DATA'
         ----
        endloop.
        What will be the out put of the above statement

  Ans :print the values in the internal table through sap script.

 22. Can we call a sub rutine from a fucntion module
     Ans : Yes

 23. Can we call START-OF-SELECTION event in include file.
     Ans :Yes

 24. How we can place boarder in the form
    Ans : Using box command

 25. What is SAP Memory

 26. What will happend at the time of Sychronization buffering
        Ans : the data in all the buffers in all applications servers is
                 refreshed and hence the latest data is buffered

 27. Which is the default database for ALE

 28. In which table of SAP, date formats are stored

 29. What is the screen no for default selection screen
      Ans : 1000

 30. What is the basic list index
      Ans : zero

 31. How we can write a program variable in a script?
      Ans : write it like -- &program-variable&

 32. Can we make a drill down report into an interactive report?
      Ans :Yes

 33. How we can use Hide statement in program
      Ans :Hide statement should be used just after the write statement of
              the data that we want to store.

 34. How we can pass a reference parameter into a form
      Ans : Yes

 35. Which attribute is not available in data element , but which is
            available in field element
      Ans : Data element doent have check table

 36. Which is a good example for foreign key - CURRENCY TABLE

 37. What is mean by Cardinality
      Ans : Relationships

 38. What MOVE-CORRESPONDING statement will do
      Ans : Compares the field names for data transfer between two
                structures or internal tables or from table to internal table.

 39. How do you switch off automatic asynchronization
      Ans :

 40. Can we sort a sorted table?
     Ans : Yes

 41. While creating a view , will it create a view in underlying database?
     ANs: Yes

 42. Which protocall is using for IDOC?

 43. Internal table qustion with collect?
     1. what is the transaction code for material storage location with plant wise( i think MBSU) but at the time interview he was saying something which begins with VFO3
     or starts with V and his question was why u have created report for this even though u have transaction code.

    2.wht u have done sap scripts ? then i said i modified medruck form then he asked me what u have done in that ?my inserted company logo and added e-mail and at the footer i added date and time with page number.Then his question was u said ur working for supporting then y did u insert logo again : i said we modified the logo .

   3. what print program did u use for medruck? (ans: sapfm06p) but he asked me did u modify that program ? i said no i copied the program and made changes. Then his question was what include programms did u use in print program of sapfm06p
   4.what include program u use in BDC
   5.what is the technical settings of ur report ?ans from me was data class (master data) and size cateory (0). then asked me if i enter more than 20000 records then again i have change technical settings ?
    ans: i said no it automatically changes to 1
   6. what do u mean by internal document in SD flow?
   7. my report was sales details w.r.t all the customers form this he asked me that what u have done
   i said basic list consist of custommer number and sales org: and and few fields on double clicking custommer no: it gives complate information about customer
  • then he asked me how client know list of customer?


Thursday, February 21, 2019

Update Z-Table through Editable AlV Grid in SAP ABAP

Update Z-Table through Editable AlV Grid in SAP ABAP.

Read More Customer Exit ..........


REPORT ZQAM_PP_01.

INCLUDE ZQAM_PP_01_TOP.
INCLUDE ZQAM_PP_01_SEL.
INCLUDE ZQAM_PP_01_SUB.

START-OF-SELECTION.

  PERFORM get_data.
  PERFORM alv_fieldcat.
  PERFORM get_events.
  PERFORM sub_comment_build USING t_list_top_of_page.
  PERFORM alv_display.
***************************************************************

TOP PAGE
********************************************
*&---------------------------------------------------------------------*
*&  Include           ZQAM_PP_01_TOP
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Type-Pool Declaration
*&---------------------------------------------------------------------*
TYPE-POOLS: slis.
*&---------------------------------------------------------------------*
*& ALV Data Declaration
*&---------------------------------------------------------------------*
DATA: it_fieldcat            TYPE slis_t_fieldcat_alv.
DATA: wa_fieldcat            LIKE LINE OF it_fieldcat.
DATA: t_list_top_of_page     TYPE slis_t_listheader.
DATA: it_events              TYPE slis_t_event WITH HEADER LINE.
DATA: g_save                 TYPE c VALUE 'A'.
DATA: gt_sort                TYPE slis_t_sortinfo_alv.
DATA: gx_save                TYPE c VALUE 'A'.
DATA: gx_variant             TYPE disvariant.
DATA: g_variant              TYPE disvariant.
DATA: gs_layout              TYPE slis_layout_alv.
DATA: t_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: t_i_event              TYPE slis_alv_event.
*&---------------------------------------------------------------------*
*& External Table Declaration                                          *
*&---------------------------------------------------------------------*
TABLES: zqampp01,mara,makt.

*&---------------------------------------------------------------------*
*& Internal Table Declaration                                          *
*&---------------------------------------------------------------------*
TYPES: BEGIN OF ty_zqampp01,
         matnr      TYPE matnr,
         maktx      TYPE maktx,
         user_def1  TYPE zuser_def1,
         user_def2  TYPE zuser_def2,
         user_def3  TYPE zuser_def3,
         user_def4  TYPE zuser_def4,
         user_def5  TYPE zuser_def5,
         user_def6  TYPE zuser_def6,
         user_def7  TYPE zuser_def7,
         user_def8  TYPE zuser_def8,
         user_def9  TYPE zuser_def9,
         user_def10 TYPE zuser_def10,
*         user_def11 TYPE zuser_def11,
       END OF ty_zqampp01.

TYPES:BEGIN OF ty_mara,
        matnr TYPE matnr,
        mtart TYPE mtart,
      END OF  ty_mara.

TYPES:BEGIN OF ty_makt,
        matnr TYPE matnr,
        maktx TYPE maktx,
      END OF  ty_makt.

TYPES:
  ty_document_list TYPE  sodocchgi1,
  ty_packing_list  TYPE  sopcklsti1,
  ty_attachment    TYPE  solisti1,
  ty_receiver      TYPE  somlreci1,
  ty_message       TYPE  solisti1.

*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Variables Declaration                                               *
*&---------------------------------------------------------------------*
DATA: it_stru  TYPE STANDARD TABLE OF ty_zqampp01,
      it_stru1  TYPE STANDARD TABLE OF ty_zqampp01,
      wa_stru1 TYPE ty_zqampp01,
      wa_stru  TYPE ty_zqampp01.

DATA: it_mara TYPE STANDARD TABLE OF ty_mara,
      wa_mara TYPE ty_mara.

DATA: it_makt TYPE STANDARD TABLE OF ty_makt,
      wa_makt TYPE ty_makt.

DATA: id_tabix TYPE sy-tabix.


DATA: it_packing_list  TYPE STANDARD TABLE OF ty_packing_list  WITH HEADER LINE,
      it_receiver      TYPE STANDARD TABLE OF ty_receiver      WITH HEADER LINE,
      it_body_msg      TYPE STANDARD TABLE OF ty_message       WITH HEADER LINE,
      it_attachment    TYPE STANDARD TABLE OF ty_attachment    WITH HEADER LINE,
      it_document_list TYPE STANDARD TABLE OF ty_document_list WITH HEADER LINE.

DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER LINE,
      it_attach  TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER LINE.

DATA: mailtext TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
      mailrec  TYPE STANDARD TABLE OF somlreci1 WITH HEADER LINE.

DATA: wa_packing_list  TYPE ty_packing_list,
      wa_receiver      TYPE ty_receiver,
      wa_body_msg      TYPE ty_message,
      wa_attachment    TYPE ty_attachment,
      wa_document_list TYPE ty_document_list.
*CONSTANTS: c_check(1) VALUE 'X'.

DATA: ls_ans TYPE string.

DATA: l_resize  TYPE i,
      tab_line  TYPE i,
      l_snt_all TYPE c LENGTH 1.
*DATA: mail_data TYPE sodocchgi1.

*******************************************************************************
SELECTION PAGE
*******************************************************************************
*&---------------------------------------------------------------------*
*&  Include           ZQAM_PP_01_SEL
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_matnr FOR wa_mara-matnr. "material no input
SELECTION-SCREEN END OF BLOCK b1.
******************************************************************************
SUB PAGE
******************************************************************************
*&---------------------------------------------------------------------*
*&  Include           ZQAM_PP_01_SUB
*&---------------------------------------------------------------------*
*START-OF-SELECTION.

FORM get_data.

  SELECT matnr
         maktx
         user_def1
         user_def2
         user_def3
         user_def4
         user_def5
         user_def6
         user_def7
         user_def8
         user_def9
         user_def10
*         user_def11
    FROM zqampp01
    INTO TABLE it_stru
    WHERE matnr IN s_matnr.
  IF it_stru[] IS INITIAL.
    SELECT matnr
           mtart
      FROM mara
      INTO TABLE it_mara
      WHERE matnr IN s_matnr
      AND  mtart = 'YFGR'.
    IF it_mara[] IS NOT INITIAL.
      SELECT matnr
             maktx
    FROM makt
    INTO TABLE it_makt
     FOR ALL ENTRIES IN it_mara
    WHERE matnr = it_mara-matnr.

      LOOP AT it_mara INTO wa_mara.
        wa_stru-matnr = wa_mara-matnr.
        READ TABLE it_makt INTO wa_makt WITH KEY matnr = wa_mara-matnr.
        IF sy-subrc = 0.
          wa_stru-maktx = wa_makt-maktx.
        ENDIF.
        APPEND wa_stru TO it_stru.
        CLEAR:wa_stru.
        CLEAR:wa_makt.
      ENDLOOP.
    ENDIF.
  ENDIF.
ENDFORM.



FORM alv_fieldcat .
  DATA: counter TYPE i.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'MATNR'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Em_Name'.
  wa_fieldcat-no_zero   = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'MAKTX'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Em_Name'.
  wa_fieldcat-no_zero   = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF1'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 1'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF2'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 2'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF3'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 3'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.


  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF4'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 34'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF5'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 5'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF6'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 6'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF7'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 3'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF8'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 8'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF9'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 9'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

  counter = counter + 1.
  wa_fieldcat-col_pos    = counter.
  wa_fieldcat-fieldname  = 'USER_DEF10'.
  wa_fieldcat-tabname    = 'IT_STRU'.
  wa_fieldcat-seltext_l  = 'Col 10'.
  wa_fieldcat-no_zero    = 'X'.
  wa_fieldcat-edit        = 'X'.
  APPEND wa_fieldcat TO it_fieldcat.
  CLEAR wa_fieldcat.

*  counter = counter + 1.
*  wa_fieldcat-col_pos    = counter.
*  wa_fieldcat-fieldname  = 'USER_DEF11'.
*  wa_fieldcat-tabname    = 'IT_STRU'.
*  wa_fieldcat-seltext_l  = 'Col 11'.
*  wa_fieldcat-no_zero    = 'X'.
*  wa_fieldcat-edit        = 'X'.
*  APPEND wa_fieldcat TO it_fieldcat.
*  CLEAR wa_fieldcat.
ENDFORM.

FORM get_events .
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 0
    IMPORTING
      et_events       = it_events[]
    EXCEPTIONS
      list_type_wrong = 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.

  READ TABLE it_events WITH KEY name = slis_ev_top_of_page
                                INTO it_events.
  IF sy-subrc = 0.
    MOVE t_formname_top_of_page TO it_events-form.
    APPEND it_events.
  ENDIF.
ENDFORM.

*&---------------------------------------------------------------------*
*&      Form  SUB_COMMENT_BUILD
*&---------------------------------------------------------------------*
FORM sub_comment_build  USING  i_top_of_page TYPE slis_t_listheader.
  DATA: ls_line TYPE slis_listheader.
  DATA: wrk_name     TYPE string.

*  wrk_name = 'Squirrel Softech Pvt. Ltd.'.

  CLEAR ls_line.

  ls_line-typ  = 'H'.
*  ls_line-info = wrk_name.
  APPEND ls_line TO i_top_of_page.
  ls_line-typ  = 'H'.
  ls_line-info = 'Details Report'.
  APPEND ls_line TO i_top_of_page.
ENDFORM.                    " SUB_COMMENT_BUILD

*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = t_list_top_of_page.
ENDFORM.                    "top_of_page
*&---------------------------------------------------------------------*
*&      Form  ALV_DISPLAY
*&---------------------------------------------------------------------*
FORM alv_display .
  gs_layout-zebra                = 'X'.
  gs_layout-detail_popup         = 'X'.
  gs_layout-detail_initial_lines = 'X'.
  gs_layout-colwidth_optimize    = 'X'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      it_fieldcat              = it_fieldcat
      it_events                = it_events[]
      i_callback_program       = sy-repid
      is_layout                = gs_layout
      it_sort                  = gt_sort[]
      i_save                   = g_save
      is_variant               = gx_variant
      i_callback_pf_status_set = 'ZSAVE'
      i_callback_user_command  = 'USER_COMMAND'
    TABLES
      t_outtab                 = it_stru[].
  .
ENDFORM.                    " ALV_DISPLAY
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->RT_EXTAB   text
*----------------------------------------------------------------------*
FORM zsave USING rt_extab TYPE slis_t_extab.
  SET PF-STATUS 'ZSAVE'.
*  SET PF-STATUS 'START'.
ENDFORM.                    "text


*&---------------------------------------------------------------------*
*&      form  user_command
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->ucomm      text
*      -->selfield   text
*----------------------------------------------------------------------*
FORM user_command USING ucomm  TYPE sy-ucomm
                        selfield TYPE slis_selfield.

  DATA: gd_repid LIKE sy-repid,
        ref_grid TYPE REF TO cl_gui_alv_grid.

  IF ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        e_grid = ref_grid.
  ENDIF.
  IF NOT ref_grid IS INITIAL.
    CALL METHOD ref_grid->check_changed_data.
  ENDIF.
  CASE sy-ucomm.
    WHEN 'SAVE'.
      LOOP AT it_stru INTO wa_stru.
        SELECT matnr
               maktx
               user_def1
               user_def2
               user_def3
               user_def4
               user_def5
               user_def6
               user_def7
               user_def8
               user_def9
               user_def10
*               user_def11
          FROM zqampp01
          INTO TABLE it_stru
          WHERE matnr = wa_stru-matnr.
        IF sy-subrc = 0.
          UPDATE zqampp01
            SET matnr        = wa_stru-matnr
                maktx        = wa_stru-maktx
                user_def1    = wa_stru-user_def1
                user_def2    = wa_stru-user_def2
                user_def3    = wa_stru-user_def3
                user_def4    = wa_stru-user_def4
                user_def5    = wa_stru-user_def5
                user_def6    = wa_stru-user_def6
                user_def7    = wa_stru-user_def7
                user_def8    = wa_stru-user_def8
                user_def9    = wa_stru-user_def9
                user_def10   = wa_stru-user_def10
*                user_def11   = wa_stru-user_def11
                WHERE  matnr = wa_stru-matnr.
          IF sy-subrc = 0.
            COMMIT WORK AND WAIT.
          ENDIF.
        ELSE.
          zqampp01-matnr =   wa_stru-matnr.
          zqampp01-maktx =   wa_stru-maktx.
          zqampp01-user_def1 =  wa_stru-user_def1.
          zqampp01-user_def2 =  wa_stru-user_def2.
          zqampp01-user_def3 =  wa_stru-user_def3.
          zqampp01-user_def4 =  wa_stru-user_def4.
          zqampp01-user_def5 =  wa_stru-user_def5.
          zqampp01-user_def6 =  wa_stru-user_def6.
          zqampp01-user_def7 =  wa_stru-user_def7.
          zqampp01-user_def8 =  wa_stru-user_def8.
          zqampp01-user_def9 =  wa_stru-user_def9.
          zqampp01-user_def10 = wa_stru-user_def10.
*          zqampp01-user_def11 = wa_stru-user_def11.
          INSERT  zqampp01.
          IF sy-subrc = 0.
            COMMIT WORK AND WAIT.
          ENDIF.
        ENDIF.
      ENDLOOP.
  ENDCASE.
ENDFORM.

Read More Customer Exit ..........