Send sample prg for alv editable from ztable

Hi ,
Need of prg for alv editable . get data from ztable in standard tool bar i need to create record insert ,delete ,modify existing records .
Thanks in advance.
Regarding,
kumar

Hi Anil,
> Try like this code i wrote this code for fetch some records from database table and approve/ reject
> the records by clicking buttons.
REPORT  zcl_timesheet_approval MESSAGE-ID zcl_msg.
CLASS L_CL_EVENTS DEFINITION                                        *
Class for inserting buttons on the toolbar                          *
CLASS l_cl_events DEFINITION.
  PUBLIC SECTION.
    METHODS:
      toolbar FOR EVENT toolbar
              OF cl_gui_alv_grid
              IMPORTING e_object
                        e_interactive,
      user_command FOR EVENT user_command
                   OF cl_gui_alv_grid
                   IMPORTING e_ucomm .
ENDCLASS.                              " L_CL_EVENTS DEFINITION
CLASS L_CL_EVENTS IMPLEMENTATION                                    *
Implementation of class L_CL_EVENTS                                 *
CLASS l_cl_events IMPLEMENTATION.
  METHOD toolbar.
    PERFORM event_toolbar USING e_object.
  ENDMETHOD.                           " TOOLBAR
  METHOD user_command.
    PERFORM event_ucomm USING e_ucomm.
  ENDMETHOD.                           " USER_COMMAND
ENDCLASS.                              " L_CL_EVENTS IMPLEMENTATION
Tables decalration..................................................
TABLES:
    zcl_timesheet.                     " Employee master table
CONSTANTS:
   c_boolean_yes(1)     TYPE c         " Boolean - yes
                       VALUE 'X',
   c_approve_status(1)  TYPE c         " Approval status
                       VALUE 'A',
   c_rej_status(1)      TYPE c         " Rejected status
                       VALUE 'R',
   c_save_status(1)     TYPE c         " Save status
                       VALUE 'S',
   c_fcode_approve(7)   TYPE c         " Function code - APPROVE
                       VALUE 'APPROVE',
   c_fcode_rej(6)       TYPE c         " Function code - REJECT
                       VALUE 'REJECT',
   c_fcode_back(4)      TYPE c         " Function code - BACK
                       VALUE 'BACK',
   c_fcode_onli(4)      TYPE c         " Function code - EXECUTE
                       VALUE 'ONLI',
   c_fcode_exit(4)      TYPE c         " Function code - EXIT
                       VALUE 'EXIT',
   c_fcode_cancel(6)    TYPE c         " Function code - CANCEL
                       VALUE 'CANCEL',
   c_zero(1)            TYPE c         " Constant value 0
                       VALUE '0',
   c_alv_scr(7)         TYPE c         " GUI status : ALV screen
                       VALUE 'ALV_SCR'.
Type definition...................................................
Type definition of the structure to hold  data from table            *
zcl_timesheet.                                                      *
TYPES:
  BEGIN OF type_s_time,
    empid        TYPE zcl_timesheet-empid,
                                       " Employee ID
    workdate     TYPE zcl_timesheet-workdate,
                                       " Date
    groupid      TYPE zcl_timesheet-groupid,
                                       " Group ID
    projectid    TYPE zcl_timesheet-projectid,
                                       " Project ID
    projectname  TYPE zcl_timesheet-projectname,
                                       " Project name
    objectid     TYPE zcl_timesheet-objectid,
                                       " Object ID
    objectname   TYPE zcl_timesheet-objectname,
                                       " Object name
    activityid   TYPE zcl_timesheet-activityid,
                                       " Activity ID
    activityname TYPE zcl_timesheet-activityname,
                                       " Activity name
    timeworked   TYPE zcl_timesheet-timeworked,
                                       " Time spent on work
    description  TYPE zcl_timesheet-description,
                                       " Description
    taskstatus   TYPE zcl_timesheet-taskstatus,
                                       " Status of the proj
    billstatus   TYPE zcl_timesheet-billstatus,
                                       " Billing status
    appstatus    TYPE zcl_timesheet-appstatus,
                                       " Staus of the record
    wstatus      TYPE zcl_timesheet-wstatus,
                                       " Working status
    mngcomment   TYPE zcl_timesheet-mngcomment,
                                       " Managers comment
  END OF type_s_time.
Field-string declarations...........................................
DATA:
Field-string to build fieldcat.
   fs_fcat TYPE lvc_s_fcat,
Field-string for t_timesheet
   fs_timesheet TYPE zcl_timesheet.
Working variables...................................................
DATA:
   w_valid(1)   TYPE c,                " To get the flag from check_data
   w_display(1) TYPE c,                " Flag to display all records
   ok_code      TYPE syst-ucomm,       " Function code on dialog screens
   w_okcode     TYPE syst-ucomm,       " Temporary function code
   w_first(1)   TYPE c,                " To place buttons for first time
   w_submit(1)  TYPE c,                " Flag to display submitted records
   w_empid      TYPE zcl_emprecord-empid.
" Employee ID for GET parameter
Internal table declarations........................................
DATA:
Internal table to build fieldcat.
   t_fcat      TYPE lvc_t_fcat,
Internal table to display data.
   t_time      TYPE TABLE OF type_s_time,
Internal table to hold submitted data.
   t_timesheet TYPE TABLE OF zcl_timesheet.
For ALV ...........................................................
DATA:
To create instance for cl_gui_custom_container
  g_grid      TYPE REF TO cl_gui_custom_container,
To create instance for cl_gui_alv_grid
  g_alv       TYPE REF TO cl_gui_alv_grid,
To create instance for l_cl_events
  g_events    TYPE REF TO l_cl_events,
To assign name for custom container
  g_container TYPE scrfname VALUE 'CONTAINER',
To assign layout
  g_fcatlayo  TYPE lvc_s_layo.
Selection screen elements............................................
SELECTION-SCREEN BEGIN OF BLOCK blck WITH FRAME TITLE text-000.
SELECT-OPTIONS:
  s_group FOR zcl_timesheet-groupid    " Group ID
                         NO INTERVALS,
  s_prjid FOR zcl_timesheet-projectid, " Project ID
  s_empid FOR zcl_timesheet-empid,     " Employee ID
  s_date  FOR zcl_timesheet-workdate.  " Date
SELECTION-SCREEN END OF BLOCK blck.
SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-015.
PARAMETERS:
  p_app  RADIOBUTTON GROUP g1  USER-COMMAND app ,
                                       " To approve timesheet
  p_disp RADIOBUTTON GROUP g1.         " To display timesheet
SELECTION-SCREEN END OF BLOCK blck1.
           AT SELECTION-SCREEN EVENT                                 *
AT SELECTION-SCREEN.
To perform user actions on the selection screen
  PERFORM user_command.
MODULE  STATUS_0100  OUTPUT                                         *
This module will create the objects for the instance and display    *
the records                                                         *
MODULE status_0100 OUTPUT.
  SET PF-STATUS c_alv_scr.
  PERFORM set_titlebar USING w_display.
If program executed in foreground.
  IF sy-batch IS INITIAL.
If g_grid is empty.
    IF g_grid IS INITIAL.
To create object for instance grid
      CREATE OBJECT g_grid
        EXPORTING
          container_name = g_container.
To create object for object grid
      CREATE OBJECT g_alv
        EXPORTING
          i_parent = g_grid.
    ELSE.
      CALL METHOD g_alv->refresh_table_display.
    ENDIF.                             " IF G_GRID IS INITIAL
  ENDIF.                               " IF SY-BATCH IS INITIAL
  REFRESH t_fcat.
If w_display eq 'X' .
  IF w_display EQ c_boolean_yes.
To display all records except saved data
    PERFORM display_allrecords.
  ENDIF.                               " IF W_FLAG EQ C_BOOLEAN_YES
  IF w_submit EQ c_boolean_yes.
To display submitted records
    PERFORM submitted_records.
  ENDIF.                               " IF W_SUBMIT EQ C_BOOLEAN_YES
ENDMODULE.                             " STATUS_0100  OUTPUT
MODULE USER_COMMAND_0100  INPUT                                     *
To perform user actions in the screen 100                           *
MODULE user_command_0100 INPUT.
To update the data in the ALV grid
  PERFORM check_changed_data.
  w_okcode = ok_code.
  CLEAR ok_code.
  CASE w_okcode.
    WHEN c_fcode_back.
      LEAVE TO SCREEN 0.
    WHEN c_fcode_exit OR c_fcode_cancel.
      LEAVE PROGRAM.
  ENDCASE.                             " CASE W_OKCODE
ENDMODULE.                             " USER_COMMAND_0100
FORM GET_DATA                                                       *
To get the submitted data from zcl_timesheet                        *
No parameters are passsed to this subroutine                        *
FORM get_data .
  SELECT *
    FROM zcl_timesheet
    INTO TABLE t_timesheet
   WHERE empid     IN s_empid
     AND workdate  IN s_date
     AND groupid   IN s_group
     AND projectid IN s_prjid
     AND appstatus EQ c_boolean_yes.
  IF sy-subrc NE 0.
    MESSAGE e000 .
  ELSE.
    CALL SCREEN 100.
  ENDIF.                               " IF SY-SUBRC NE 0
ENDFORM.                               " GET_DATA
FORM BUILD_FCAT                                                     *
To build the field catalog giving managers comment in editable mode *
-->PR_Tabname   type lvc_tname                                      *
-->PR_Fieldname type lvc_fname                                      *
-->PR_Coltext   type lvc_txtcol                                     *
-->PR_Colpos    type lvc_colpos                                     *
FORM build_fcat USING pr_tabname   TYPE lvc_tname
                      pr_fieldname TYPE lvc_fname
                      pr_coltext   TYPE lvc_txtcol
                      pr_colpos    TYPE lvc_colpos.
  CLEAR fs_fcat.
  fs_fcat-tabname   = pr_tabname.
  fs_fcat-fieldname = pr_fieldname.
  fs_fcat-coltext   = pr_coltext.
  fs_fcat-col_pos   = pr_colpos.
  IF fs_fcat-fieldname EQ 'MNGCOMMENT'.
    fs_fcat-edit      = c_boolean_yes.
    fs_fcat-lowercase = c_boolean_yes.
    fs_fcat-dd_outlen = 60.
  ELSE.
    fs_fcat-edit      = space.
  ENDIF.                               " IF FS_FCAT-FIELDNAME...
  APPEND fs_fcat TO t_fcat.
ENDFORM.                               " BUILD_FCAT
  FORM BUILD_FCATD                                                   *
To build fieldcatalog in the display mode                           *
-->pr_Tabname   type lvc_tname                                      *
-->pr_Fieldname type lvc_fname                                      *
-->pr_Coltext   type lvc_txtcol                                     *
-->pr_Colpos    type lvc_colpos                                     *
FORM build_fcatd USING pr_tabname   TYPE lvc_tname
                       pr_fieldname TYPE lvc_fname
                       pr_coltext   TYPE lvc_txtcol
                       pr_colpos    TYPE lvc_colpos .
  CLEAR fs_fcat.
  fs_fcat-tabname   = pr_tabname.
  fs_fcat-fieldname = pr_fieldname.
  fs_fcat-coltext   = pr_coltext.
  fs_fcat-col_pos   = pr_colpos.
  fs_fcat-edit      = space.
  APPEND fs_fcat TO t_fcat.
ENDFORM.                               " BUILD_FCATD
FORM ALV_DISPLAY                                                    *
To display data in ALV                                              *
--> pr_table type standard table                                    *
--> pr_fcat  type lvc_t_fcat                                        *
FORM alv_display USING pr_table TYPE STANDARD TABLE
                       pr_fcat  TYPE lvc_t_fcat .
Local data declaration....
  DATA: lt_exclude TYPE ui_functions.
To exclude buttons on the ALV grid
  PERFORM exclude_tb_functions CHANGING lt_exclude.
To display ALV
  CALL METHOD g_alv->set_table_for_first_display
    EXPORTING
      i_default            = space
      is_layout            = g_fcatlayo
      it_toolbar_excluding = lt_exclude
    CHANGING
      it_outtab            = pr_table[]
      it_fieldcatalog      = pr_fcat[].
ENDFORM.                               " ALV_DISPLAY
FORM EVENT_TOOLBAR                                                  *
Setting toolbar in the alv grid                                     *
-->E_OBJECT TYPE REF TO CL_ALV_EVENT_TOOLBAR_SET                    *
FORM event_toolbar USING e_object
                         TYPE REF TO cl_alv_event_toolbar_set.
Local declaration for the button.
  DATA: ls_toolbar TYPE stb_button.
To add Approve button
  ls_toolbar-function  = c_fcode_approve.
  ls_toolbar-butn_type = c_zero.
  ls_toolbar-text      = text-001.
  APPEND ls_toolbar TO e_object->mt_toolbar.
To add Reject button
  CLEAR ls_toolbar.
  ls_toolbar-function  = c_fcode_rej.
  ls_toolbar-butn_type = c_zero.
  ls_toolbar-text      = text-013.
  APPEND ls_toolbar TO e_object->mt_toolbar.
ENDFORM.                               " EVENT_TOOLBAR
FORM EXCLUDE_TB_FUNCTIONS                                           *
To exclude buttons from ALV grid                                    *
<--> PR_EXCLUDE TYPE UI_FUNCTIONS                                   *
FORM exclude_tb_functions  CHANGING pr_exclude TYPE ui_functions.
Local data declaration...
  DATA ls_exclude TYPE ui_func.
To remove the buttons on the ALV grid.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
  APPEND ls_exclude TO pr_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
  APPEND ls_exclude TO pr_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
  APPEND ls_exclude TO pr_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
  APPEND ls_exclude TO pr_exclude.
  ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
  APPEND ls_exclude TO pr_exclude.
ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
FORM EVENT_UCOMM                                                    *
After Input in the ALV grid,if user select record and press         *
approve or reject then the record will get updated                  *
--> PR_ucomm type sy-ucomm                                          *
FORM event_ucomm USING pr_ucomm LIKE sy-ucomm.
  CASE pr_ucomm.
If e_ucomm contains 'APP' i.e.function code for Approve button
    WHEN c_fcode_approve.              " To approve selected record
      PERFORM app_timesheet USING c_approve_status.
If e_ucomm contains 'REJ' i.e. function code for Reject
    WHEN c_fcode_rej.                  " To reject selected record
      PERFORM app_timesheet USING c_rej_status.
  ENDCASE.                             " CASE E_UCOMM
ENDFORM.                               " EVENT_UCOMM
FORM APP_TIMESHEET                                                  *
To get the selected records and update the records in database      *
  --> pr_status type char01                                          *
FORM app_timesheet USING pr_status TYPE char01 .
Local data declaration......
  DATA:
   lt_marked_rows TYPE lvc_t_roid,     " Table to get rowid
   l_fs_marked_row LIKE LINE OF lt_marked_rows.
  " Field-string for lt_marked_rows
To get all the selected rows in the table lt_marked_rows
  CALL METHOD g_alv->get_selected_rows
    IMPORTING
      et_row_no = lt_marked_rows.
Reading each row id and updating the database.
  LOOP AT lt_marked_rows INTO l_fs_marked_row.
Reading the table t_timesheet with rowid
    READ TABLE t_timesheet INTO fs_timesheet INDEX
                                             l_fs_marked_row-row_id.
If record is there in the table.
    IF sy-subrc EQ 0.
      CLEAR fs_timesheet-appstatus.
      GET PARAMETER ID 'ZEMPID' FIELD w_empid.
Changing the appstatus.
      fs_timesheet-appstatus = pr_status.
      fs_timesheet-approvedby = w_empid.
Updating the database table.
      UPDATE zcl_timesheet FROM fs_timesheet.
      IF sy-subrc EQ 0.
        DELETE t_timesheet INDEX l_fs_marked_row-row_id.
        PERFORM refresh_table USING pr_status.
      ENDIF.                           " IF SY-SUBRC EQ 0.
    ENDIF.                             " IF SY-SUBRC EQ 0
  ENDLOOP.                             " LOOP AT LT_MARKED_ROWS...
ENDFORM.                               " APP_TIMESHEET
FORM CHECK_CHANGED_DATA                                             *
To change the data                                                  *
No parameters are passsed to this subroutine                        *
FORM check_changed_data .
To change the data.
  CALL METHOD g_alv->check_changed_data.
ENDFORM.                               " CHECK_CHANGED_DATA
FORM  DISPLAY_ALL                                                   *
To display all the records                                          *
No parameters are passsed to this subroutine                        *
FORM display_all .
  SELECT empid                         " Employee ID
         workdate                      " Workdate
         groupid                       " Groupid
         projectid                     " Project ID
         projectname                   " Project name
         objectid                      " Object ID
         objectname                    " Object name
         activityid                    " Activity ID
         activityname                  " Activity name
         timeworked                    " Time worked
         description                   " Description
         taskstatus                    " Task status
         billstatus                    " Bill status
         appstatus                     " Approved status
         wstatus                       " Working status
         mngcomment                    " Manager comment
    FROM zcl_timesheet
    INTO TABLE t_time
   WHERE empid     IN s_empid
     AND workdate  IN s_date
     AND groupid   IN s_group
     AND projectid IN s_prjid
     AND appstatus NE c_save_status.
  IF sy-subrc NE 0.
    MESSAGE e000.
  ELSE.
    CALL SCREEN 100.
  ENDIF.                               " IF SY-SUBRC NE 0
ENDFORM.                               " DISPLAY_ALL
FORM REFFRESH_TABLE                                                 *
To refresh output table and  issue message according p_status       *
-->PR_STATUS TYPE CHAR01                                            *
FORM refresh_table  USING pr_status TYPE char01.
To refresh output table.
  CALL METHOD g_alv->refresh_table_display.
Depending upon pr_status message is given.
  IF pr_status EQ c_approve_status.
    MESSAGE s001.
  ELSE.
    MESSAGE s002.
  ENDIF.                               " IF P_STATUS EQ C_APPROVE_STATUS
ENDFORM.                               " REFRESH_TABLE
FORM SET_TITLEBAR                                                   *
To set titlebar on the screen 100.                                  *
-->PR_STATUS TYPE CHAR01                                            *
FORM set_titlebar USING pr_status TYPE char01.
If pr_status eq 'X'.
  IF pr_status EQ c_boolean_yes.
    SET TITLEBAR c_alv_scr WITH text-017.
  ELSE.
    SET TITLEBAR c_alv_scr WITH text-018.
  ENDIF.                               " IF P_STATUS EQ C_BOOLEAN_YES
ENDFORM.                               " SET_TITLEBAR
FORM USER_COMMAND                                                   *
According to sy-ucomm the action is performed in the screen 100     *
No parameters are passsed to this subroutine                        *
FORM user_command .
  CASE sy-ucomm.
If p_app is selected, submitted data will be displayed for approval
    WHEN c_fcode_onli OR c_fcode_approve.
      CLEAR sy-ucomm.
To display the submitted records.
      IF p_app EQ c_boolean_yes.
        w_submit = c_boolean_yes.
To get submitted records
        PERFORM get_data.
      ENDIF.                           " IF P_APP EQ C_BOOLEAN_YES
To display all records according to selection.
      IF p_disp EQ c_boolean_yes.
        w_display = c_boolean_yes.
To display
        PERFORM display_all.
        CLEAR w_display.
      ENDIF.                           " IF P_DISP EQ C_BOOLEAN_YES
  ENDCASE.                             " CASE SY-UCOMM
ENDFORM.                               " USER_COMMAND
FORM  DISPLAY_ALLRECORDS                                            *
To display all the records in the display mode                      *
No parameters are passsed to this subroutine                        *
FORM display_allrecords .
  CLEAR w_display.
  PERFORM build_fcatd USING 'T_TIME' 'WORKDATE'     text-002 '1'.
  PERFORM build_fcatd USING 'T_TIME' 'EMPID'        text-009 '2'.
  PERFORM build_fcatd USING 'T_TIME' 'PROJECTID'    text-003 '3'.
  PERFORM build_fcatd USING 'T_TIME' 'PROJECTNAME'  text-004 '4'.
  PERFORM build_fcatd USING 'T_TIME' 'OBJECTID'     text-005 '5'.
  PERFORM build_fcatd USING 'T_TIME' 'OBJECTNAME'   text-006 '6'.
  PERFORM build_fcatd USING 'T_TIME' 'ACTIVITYID'   text-007 '7'.
  PERFORM build_fcatd USING 'T_TIME' 'ACTIVITYNAME' text-008 '8'.
  PERFORM build_fcatd USING 'T_TIME' 'TIMEWORKED'   text-010 '9'.
  PERFORM build_fcatd USING 'T_TIME' 'DESCRIPTION'  text-011 '10'.
  PERFORM build_fcatd USING 'T_TIME' 'APPSTATUS'    text-012 '11'.
  PERFORM build_fcatd USING 'T_TIME' 'BILLSTATUS'   text-016 '12'.
  PERFORM build_fcatd USING 'T_TIME' 'MNGCOMMENT'   text-014 '13'.
  PERFORM alv_display USING t_time t_fcat.
ENDFORM.                               " DISPLAY_ALLRECORDS
FORM SUBMITTED_RECORDS                                              *
To display submitted records for the manager to approve             *
No parameters are passsed to this subroutine                        *
FORM submitted_records .
  CLEAR w_submit.
To create object for instance g_events
  CREATE OBJECT g_events.
If w_first equal to space
  IF w_first IS INITIAL.
    SET HANDLER g_events->toolbar
            FOR g_alv.
    w_first = c_boolean_yes.
  ENDIF.                               " IF W_FIRST IS INITIAL..
  SET HANDLER g_events->user_command
          FOR g_alv.
  g_fcatlayo-sel_mode = c_approve_status.
  REFRESH t_fcat.
  PERFORM build_fcat USING 'T_TIMESHEET' 'WORKDATE'     text-002 '1'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'EMPID'        text-009 '2'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'PROJECTID'    text-003 '3'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'PROJECTNAME'  text-004 '4'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'OBJECTID'     text-005 '5'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'OBJECTNAME'   text-006 '6'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'ACTIVITYID'   text-007 '7'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'ACTIVITYNAME' text-008 '8'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'TIMEWORKED'   text-010 '9'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'DESCRIPTION'  text-011 '10'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'APPSTATUS'    text-012 '11'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'BILLSTATUS'   text-016 '12'.
  PERFORM build_fcat USING 'T_TIMESHEET' 'MNGCOMMENT'   text-014 '13'.
  PERFORM alv_display USING t_timesheet t_fcat.
ENDFORM.                               " SUBMITTED_RECORDS
Plzz Reward if it is useful,
Mahi.

Similar Messages

  • Send some sample program for ALV reports

    Hi all ,
    send some sample program for ALV reports for learing purpose
    tahnks.

    Hi ,
    Resource Master
    Program                     YPPCRR                  *
    Program type                Report Program                     *
    Title                       Resource Master Dara for Updation  *
    Author                      Naga Raju                          *
    Requested By                Balaji                             *
    Date Written                24.05.2007                         *
    Specification Id            F2-DP-FS-2-0002                    *
    Transport Request                                              *
    On-line Documentation
    Description
    This Program updates the Location Mater through the Transaction
    /SAPAPO/LOC3 Based on the User Selection
    Update
    Reset
    No Action
    Output
    ALV List output of the main Program
    ALV List output of the Error Log
    REPORT  YPPCRR NO STANDARD PAGE HEADING
                   LINE-SIZE 120
                   LINE-COUNT 62(4)
                   MESSAGE-ID yap..
    Global data
    Include where all the data declarations are coded.
      INCLUDE YPPCRR_data.
    *Initialization
    INITIALIZATION.
    perform init_variant.
    Constants
    CONSTANTS: c_formname_top_of_page TYPE slis_formname
    VALUE 'F_TOP_OF_PAGE'.
    Selection-Screen
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-040.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:p_prs RADIOBUTTON GROUP ztyp USER-COMMAND ucom DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 3(28) text-003.
    position 40.
    parameters: p_file1 TYPE rlgrap-filename.
    SELECTION-SCREEN END OF LINE.
    skip 5.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: p_aps RADIOBUTTON GROUP ztyp.
    SELECTION-SCREEN COMMENT 3(28) text-004.
    position 40.
    parameters: p_file2 type rlgrap-filename.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
         program_name        = syst-repid
      DYNPRO_NUMBER       = SYST-DYNNR
         field_name          = p_file1
      STATIC              = ' '
      MASK                = ' '
        CHANGING
          file_name           = p_file1
    EXCEPTIONS
      MASK_TOO_LONG       = 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.
    START-OF-SELECTION.
    if p_prs = 'X'.
         PERFORM f_read_datum1 TABLES t_res_head
                          USING p_file1
                          CHANGING w_subrc.
      elseif p_aps = 'X'.
         PERFORM f_read_datum2 TABLES t_res_head
                          USING p_file2
                          CHANGING w_subrc.
    endif.
    IF w_subrc = 0.
    Validations
    PERFORM VALIDATION.
    PERFORM display_alv.
    IF SY-UCOMM = '&F03'
    or SY-UCOMM = '&F12'
    or SY-UCOMM = '&F15'.
    LEAVE LIST-PROCESSING.
    ELSE.
    ENDIF.
    ELSE.
    Message s100 with text-002.
    ENDIF.
    END-OF-SELECTION.
    Forms part*
    INCLUDE YPPCRR_forms.
    *&  Include           YPPCRR_DATA
    Type-Pools
      TYPE-POOLS: slis.
    *TYPES
    DATA:  BEGIN OF tl_res_head.
            INCLUDE STRUCTURE ypp_res_head.
    DATA:  END OF tl_res_head.
    DATA:  BEGIN OF tl_res_head_val.
            INCLUDE STRUCTURE ypp_resv.
    DATA:  END OF tl_res_head_val.
    DATA : BEGIN OF ty_errlog ,
             counter type i,
             type(2) ,
             name(10) TYPE c,
             vrsioid(22) TYPE c,
             restype TYPE c,
             message(80) TYPE c,
           END OF ty_errlog.
    Global Variables
    DATA : gc_flag(1) TYPE c,
           w_val_err_flag(1) type c.
    DATA: w_filename TYPE rlgrap-filename,
          w_subrc TYPE sy-subrc,
          w_t_res_head TYPE slis_t_fieldcat_alv,
          wa_t_res_head TYPE slis_fieldcat_alv.
    DATA :  wa_date(10) TYPE c,
            wa_time(10) TYPE c,
           wa_title(40) TYPE c,
           wa_type(4) TYPE c  .
    DATA: BAPI_RUN_YES_NO TYPE C.
    *Structure
    *INTERNAL TABLES USED BY ALV
    DATA:
    it_fieldcat_alv  TYPE slis_t_fieldcat_alv,
    IT_FIELDCAT_ALV_ERR  TYPE SLIS_T_FIELDCAT_ALV,
    it_status TYPE slis_formname VALUE 'F_MAIN',
    it_user_command TYPE slis_formname VALUE 'F_USER_COMMAND',
    it_events        TYPE slis_t_event,
    it_event_exit    TYPE slis_t_event_exit,
    it_list_comments TYPE slis_t_listheader,
    it_excluding     TYPE slis_t_extab,
    it_sort          TYPE slis_t_sortinfo_alv.
    *Internal Table Declarations
    DATA : BEGIN OF t_imex OCCURS 0 ,
                    string(256) TYPE c,
           END OF t_imex.
    DATA : fcode TYPE TABLE OF sy-ucomm.
    DATA : fcode_bdc TYPE TABLE OF sy-ucomm.
    DATA : fcode_error TYPE TABLE OF sy-ucomm.
    DATA : fcode_final TYPE TABLE OF sy-ucomm.
    STRUCTURE and WORKARES
    *Internal Table Declarations
    DATA : t_res_head  like  tl_res_head occurs 0 WITH HEADER LINE.
    DATA : t_res_head_val like tl_res_head_val occurs 0 with header line.
    data :l_res_head LIKE LINE OF t_res_head.
    DATA : w_file TYPE string.
    *DATA : wa_vrsioid(22) type c,
          wa_locno(20) type c,
          wa_calendar(2) type c,
          wa_planner(3) type c.
    DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: RESOURCE_HEAD LIKE BAPI10004RESHEAD OCCURS 0 WITH HEADER LINE,
          RESOURCE_HEAD_X LIKE BAPI10004RESHEADX OCCURS 0 WITH HEADER LINE,
          RESOURCE_TEXT LIKE BAPI10004RESTEXT OCCURS 0 WITH HEADER LINE,
          RESOURCE_TEXT_X LIKE BAPI10004RESTEXTX OCCURS 0 WITH HEADER LINE.
    data : t_errlog like ty_errlog occurs 0 with header line.
    DATA : wk_lines TYPE i,
           wk_errlines TYPE i,
           wk_count TYPE i.
    DATA:   g_tabname TYPE slis_tabname VALUE 'T_RES_HEAD'.
    Variables to be used by ALV
    DATA:
      wk_variant          LIKE disvariant,
      wx_variant         LIKE disvariant,
      wk_variant_save(1)  TYPE c,
      wk_exit(1)          TYPE c,
      wk_repid            LIKE sy-repid,
      wk_user_specific(1) TYPE c,
      wk_callback_ucomm   TYPE slis_formname,
      wk_callback_status   TYPE slis_formname,
    wk_callback_status1  TYPE slis_formname,
      wk_print            TYPE slis_print_alv,
      wk_layout           TYPE slis_layout_alv,
      wk_html_top_of_page TYPE  slis_formname,
      wk_fieldcat_alv     LIKE LINE OF it_fieldcat_alv,
      wk_excluding        LIKE LINE OF it_excluding,
      wk_events           LIKE LINE OF it_events,
      wk_event_exit       LIKE LINE OF it_event_exit,
      wk_list_comments    LIKE LINE OF it_list_comments,
      wk_list1_comments    LIKE LINE OF it_list_comments,
      wk_list2_comments    LIKE LINE OF it_list_comments,
      wk_sort             LIKE LINE OF it_sort.
    *DATA :gc_delete_flag(1).
    *&  Include           YAPOLOC_FORMS
    FORM display_alv .
      PERFORM f_fieldcat_build.
      PERFORM f_event_build.
      PERFORM f_exclude_build.
      PERFORM f_print_build.
      PERFORM f_layout_build.
      PERFORM f_display_data.
    ENDFORM.                    " display_alv
    *&      Form  f_fieldcat_build
          text
    FORM f_fieldcat_build .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name   = wk_repid
          i_structure_name = 'YPP_RESV'
          i_inclname       = wk_repid
        CHANGING
          ct_fieldcat      = it_fieldcat_alv.
    ENDFORM.                    " F_FIELDCAT_BUILD
    *&      Form  F_EVENT_BUILD
          text
    >  p1        text*  <  p2        text
    FORM f_event_build .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events.
      READ TABLE it_events WITH KEY
      name = slis_ev_top_of_page INTO wk_events.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO wk_events-form.
        MODIFY it_events FROM wk_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " F_EVENT_BUILD
    *&      Form  F_EXCLUDE_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM f_exclude_build .
      wk_excluding = '&GRAPH'. "Graphic
      APPEND wk_excluding TO it_excluding.
    ENDFORM.                    " F_EXCLUDE_BUILD
    *&      Form  F_PRINT_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM f_print_build .
      wk_print-no_print_listinfos = 'X'.
    ENDFORM.                    " F_PRINT_BUILD
    *&      Form  F_LAYOUT_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM f_layout_build .
      wk_layout-zebra                = 'X'.
    WK_LAYOUT-COLWIDTH_OPTIMIZE    = 'X'.
      wk_layout-detail_popup         = 'X'.
      wk_layout-detail_initial_lines = 'X'.
      wk_layout-detail_titlebar      = 'Details '.
    ENDFORM.                    " F_LAYOUT_BUILD
    *&      Form  F_DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM f_display_data .
      wk_callback_ucomm = 'CALLBACK_UCOMM'.
      IF sy-ucomm = 'UPD' OR sy-ucomm = space .
        wk_callback_status   = 'CALLBACK_STATUS'.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id             = 'SIWB_WALLPAPER'
          i_callback_program          = wk_repid
         i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
          i_callback_pf_status_set    = wk_callback_status
          i_callback_user_command     = wk_callback_ucomm
          it_sort                     = it_sort
          i_default                   = 'X'
          i_save                      = 'A'
          is_variant                  = wk_variant
          is_layout                   = wk_layout
          it_fieldcat                 = it_fieldcat_alv
          it_events                   = it_events
          it_event_exit               = it_event_exit
          it_excluding                = it_excluding
          is_print                    = wk_print
        TABLES
          t_outtab                    = t_res_head_val.
    ENDFORM.                    " F_DISPLAY_DATA
    ALV for Error Log
    *&      Form  display_alv_ERR
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_err .
      PERFORM f_fieldcat_build_err.
      PERFORM f_event_build_err.
      PERFORM f_exclude_build_err.
      PERFORM f_print_build_err.
      PERFORM f_layout_build_err.
      PERFORM f_display_data_err.
    ENDFORM.                    " display_alv_ERR
    *&      Form  F_FIELDCAT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_fieldcat_build_err .
    BREAK-POINT.
      REFRESH it_fieldcat_alv.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = wk_repid
          i_internal_tabname = 'TY_ERRLOG'
      i_structure_name = 'YPP_ERR_LOG'
          i_inclname         = wk_repid
        CHANGING
          ct_fieldcat        = it_fieldcat_alv_err.
      LOOP AT it_fieldcat_alv INTO wk_fieldcat_alv.
        CASE wk_fieldcat_alv-fieldname.
          WHEN 'COUNTER'.
            wk_fieldcat_alv-seltext_s = text-023.
            wk_fieldcat_alv-seltext_m = text-023.
            wk_fieldcat_alv-seltext_l = text-023.
            wk_fieldcat_alv-reptext_ddic = text-023.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'TYPE'.
            wk_fieldcat_alv-seltext_s = text-009.
            wk_fieldcat_alv-seltext_m = text-009.
            wk_fieldcat_alv-seltext_l = text-009.
            wk_fieldcat_alv-reptext_ddic = text-009.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'NAME'.
            wk_fieldcat_alv-seltext_s = text-010.
            wk_fieldcat_alv-seltext_m = text-010.
            wk_fieldcat_alv-seltext_l = text-010.
            wk_fieldcat_alv-reptext_ddic = text-010.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'VRSIOID'.
            wk_fieldcat_alv-seltext_s = text-011.
            wk_fieldcat_alv-seltext_m = text-011.
            wk_fieldcat_alv-seltext_l = text-011.
            wk_fieldcat_alv-reptext_ddic = text-011.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'RESTYPE'.
            wk_fieldcat_alv-seltext_s = text-012.
            wk_fieldcat_alv-seltext_m = text-012.
            wk_fieldcat_alv-seltext_l = text-012.
            wk_fieldcat_alv-reptext_ddic = text-012.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN 'MESSAGE'.
            wk_fieldcat_alv-seltext_s = text-013.
            wk_fieldcat_alv-seltext_m = text-013.
            wk_fieldcat_alv-seltext_l = text-013.
            wk_fieldcat_alv-reptext_ddic = text-013.
            wk_fieldcat_alv-edit         = 'X'.
          WHEN OTHERS.
        ENDCASE.
        MODIFY it_fieldcat_alv FROM wk_fieldcat_alv.
      ENDLOOP.
    ENDFORM.                    " F_FIELDCAT_BUILD_err
    *&      Form  F_EVENT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_event_build_err .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events.
      READ TABLE it_events WITH KEY name = slis_ev_top_of_page
                                   INTO wk_events.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO wk_events-form.
        MODIFY it_events FROM wk_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " F_EVENT_BUILD_err
    *&      Form  F_EXCLUDE_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_exclude_build_err .
      wk_excluding = '&GRAPH'. "Graphic
      APPEND wk_excluding TO it_excluding.
    ENDFORM.                    " F_EXCLUDE_BUILD_err
    *&      Form  F_PRINT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_print_build_err .
      wk_print-no_print_listinfos = 'X'.
    ENDFORM.                    " F_PRINT_BUILD_err
    *&      Form  F_LAYOUT_BUILD_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_layout_build_err .
      wk_layout-zebra                = 'X'.
    WK_LAYOUT-COLWIDTH_OPTIMIZE    = 'X'.
      wk_layout-detail_popup         = 'X'.
      wk_layout-detail_initial_lines = 'X'.
      wk_layout-detail_titlebar      = 'Details '.
    ENDFORM.                    " F_LAYOUT_BUILD_err
    *&      Form  F_DISPLAY_DATA_err
          text
    -->  p1        text
    <--  p2        text
    FORM f_display_data_err .
      wk_callback_ucomm = 'CALLBACK_UCOMM'.
    IF SY-UCOMM ne '&F03'.
      wk_callback_status = 'CALLBACK_STATUS'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_background_id          = 'SIWB_WALLPAPER'
          i_callback_program       = wk_repid
          i_callback_pf_status_set = wk_callback_status
          i_callback_user_command  = wk_callback_ucomm
          it_sort                  = it_sort
          i_default                = 'X'
          i_save                   = 'A'
          is_variant               = wk_variant
          is_layout                = wk_layout
          it_fieldcat              = it_fieldcat_alv_err
          it_events                = it_events
          it_event_exit            = it_event_exit
          it_excluding             = it_excluding
          is_print                 = wk_print
        TABLES
          t_outtab                 = t_errlog.
        KEEP EERRLOG BUTTON
      SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY.
    ENDFORM.                    "f_display_data_err
    **&      Form  F_TOP_OF_PAGE
          text
    FORM f_top_of_page.
      CLEAR: it_list_comments[],
             wk_list_comments,
             wk_list1_comments,
             wk_list2_comments.
      wk_list_comments-typ  = 'H'. "H=Header,S=Selection, A=Action
      wk_list_comments-key  = ''.
      CASE sy-ucomm.
        WHEN ''.
          wk_list_comments-info = text-030.
        WHEN 'UPD'.
          IF t_errlog[] IS INITIAL.
            wk_list_comments-info = text-031.
          ELSE.
            wk_list_comments-info = text-032.
          ENDIF.
        WHEN 'ERRLOG'.
          wk_list_comments-info = text-032.
        WHEN '&F03'.
          wk_list_comments-info = text-031.
        WHEN '&F15'.
          wk_list_comments-info = text-031.
        WHEN '&F12'.
          wk_list_comments-info = text-031.
      ENDCASE.
      APPEND wk_list_comments TO it_list_comments.
      WRITE sy-datum TO wa_date.
      WRITE sy-uzeit TO wa_time.
      wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
      wk_list_comments-key  = ''.
      wk_list_comments-info = 'User:'.
      wk_list1_comments-info = sy-uname.
      CONCATENATE wk_list_comments wk_list1_comments
      INTO wk_list2_comments.
      APPEND wk_list2_comments TO it_list_comments.
      wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
      wk_list_comments-key  = ''.
      wk_list_comments-info = '                   Run Date : '.
      wk_list1_comments-info = wa_date.
      CONCATENATE wk_list_comments wk_list1_comments
      INTO wk_list2_comments .
      APPEND wk_list2_comments TO it_list_comments.
      wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
      wk_list_comments-key  = ''.
      wk_list_comments-info = 'Run Time : '.
      wk_list1_comments-info = wa_time.
      CONCATENATE wk_list_comments wk_list1_comments
      INTO wk_list2_comments .
      APPEND wk_list2_comments TO it_list_comments.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
         I_LOGO             = 'ENJOYSAP_LOGO'
          it_list_commentary =  it_list_comments.
    ENDFORM.                    "F_TOP_OF_PAGE
          FORM USER_COMMAND_SAMPLE                                  *
    -->  UCOMM                                                     *
    -->  SELFIELD                                                  *
    FORM callback_ucomm USING ucomm LIKE sy-ucomm
                         selfield TYPE slis_selfield.
      DATA: v_langu(2) ,
             v_loctype TYPE  /sapapo/c_loctype.
      data err_flg(1).
      IF  bapi_run_yes_no IS INITIAL.
        CASE sy-ucomm.
          WHEN 'UPD'.
            bapi_run_yes_no = 'X'.
            LOOP AT t_res_head_val  WHERE val_err_msg  EQ space.
              v_langu = 'EN'.
               refresh tables
              REFRESH : resource_head ,
                        resource_head_x ,
                        resource_text ,
                        resource_text_x,
                        t_return.
              CLEAR   : resource_head ,
                        resource_head_x ,
                        resource_text ,
                        resource_text_x,
                        t_return .
              resource_head-resource   = t_res_head-name .
              resource_head-restype    = t_res_head-restype.
              resource_head-location   = t_res_head-locno.
              CLEAR : v_loctype .
              SELECT SINGLE loctype  FROM  /sapapo/loc CLIENT SPECIFIED
                     INTO v_loctype
                     WHERE  mandt    = sy-mandt
                     AND    locno    = t_res_head-locno.
              resource_head-loctype  = v_loctype.
              resource_head-calendar   = t_res_head-calendar.
              resource_head-type       = t_res_head-type.
              IF t_res_head-type = '03'.
                resource_head-dimension_bucket = t_res_head-dimension_bucket.
              ELSE.
                resource_head-dimension_bucket = space.
              ENDIF.
              APPEND resource_head.
              CLEAR  resource_head.
              resource_head_x-resource = t_res_head-name.
              resource_head_x-restype  = 'X'.
              resource_head_x-location = 'X'.
              resource_head_x-loctype  = 'X'.
              resource_head_x-calendar = 'X'.
              resource_head_x-type     = 'X'.
              IF t_res_head-type = '03'.
                resource_head_x-dimension_bucket = 'X'.
              ELSE.
                resource_head_x-dimension_bucket = space.
              ENDIF.
              APPEND resource_head_x.
              CLEAR  resource_head_x.
              resource_text-resource = t_res_head-name.
              resource_text-langu    = v_langu.
              resource_text-res_short_text = t_res_head-text.
              APPEND resource_text.
              CLEAR  resource_text.
              resource_text_x-resource = t_res_head-name.
              resource_text_x-langu    = v_langu.
              resource_text_x-res_short_text = 'X'.
              APPEND resource_text_x.
              CLEAR  resource_text_x.
               call bapi
              CALL FUNCTION 'BAPI_RSSRVAPS_SAVEMULTI_30A'
                EXPORTING
                  logical_system                      = 'AD2CLNT200'
                 business_system_group               =  'BSG001'
                 commit_control                      = 'E'
               NO_CREATE                           = ' '
               TABLES
                 resource_head                       =  resource_head
                 resource_head_x                     =  resource_head_x
                 resource_text                       =  resource_text
                 resource_text_x                     =  resource_text_x
                 return                              =  t_return.
              IF sy-subrc = 0.
                LOOP AT t_return WHERE type = 'E'
                              OR type = 'A'.
                  MOVE t_res_head_val-counter TO t_errlog-counter.
                  MOVE t_res_head_val-type TO t_errlog-type.
                  MOVE t_res_head_val-name TO t_errlog-name.
                  MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
                  MOVE t_res_head_val-restype TO t_errlog-restype.
                  MOVE t_return-message TO t_errlog-message.
                  APPEND t_errlog.
                  CLEAR t_errlog..
                ENDLOOP.
    IF not t_errlog[] is initial..
               IF sy-subrc = 0.
                ERROR POP UP
                  MESSAGE  text-007 type 'I'.
                ELSE.
                   err_flg = 'X'.
               SUCC POP UP
                 MESSAGE text-008 type 'I'.
                ENDIF.
              ELSE.                                             "NE 0
                LOOP AT t_return WHERE type = 'E'
                              OR type = 'A'.
                  MOVE t_res_head_val-counter TO t_errlog-counter.
                  MOVE t_res_head_val-type TO t_errlog-type.
                  MOVE t_res_head_val-name TO t_errlog-name.
                  MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
                  MOVE t_res_head_val-restype TO t_errlog-restype.
                  MOVE t_return-message TO t_errlog-message.
                  APPEND t_errlog.
                  CLEAR t_errlog..
             ENDLOOP.
                IF sy-subrc = 0.
                ELSE.
                  MOVE t_res_head_val-counter TO t_errlog-counter.
                  MOVE t_res_head_val-type TO t_errlog-type.
                  MOVE t_res_head_val-name TO t_errlog-name.
                  MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
                  MOVE t_res_head_val-restype TO t_errlog-restype.
                  MOVE 'Error in Creation' TO t_errlog-message.
                  APPEND t_errlog.
                  CLEAR t_errlog..
                ENDIF.
              ENDIF.
          ENDLOOP.
            gc_flag = 'X'.
            REFRESH fcode.
       if err_flg = 'X'.
                  MESSAGE text-008 type 'I'.
       endif.
        ENDCASE.
      ENDIF.
      IF NOT t_errlog[] IS INITIAL.
        wk_list_comments-info = text-032.
        APPEND wk_list_comments TO it_list_comments.
        APPEND 'UPD' TO fcode_error.
        APPEND 'ERRLOG' TO fcode_error.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_error.
        PERFORM display_alv_err.
      ELSE.
      ENDIF.
    ENDFORM.                    "CALLBACK_UCOMM=
    *&      Form  CALLBACK_STATUS
          text
         -->RT_EXTAB   text
    FORM callback_status USING rt_extab TYPE slis_t_extab.
    IF  bapi_run_yes_no IS NOT INITIAL .
        IF t_errlog[] IS INITIAL.
          REFRESH fcode.
          APPEND 'UPD' TO fcode.
          APPEND 'ERRLOG' TO fcode.
            SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG'.
          SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode IMMEDIATELY .
        ENDIF.
      ELSE.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG' IMMEDIATELY .
      ENDIF.
    ENDFORM.                    "CALLBACK_STATUS
    *&      Form  CALLBACK_STATUS1
          text
         -->RT_EXTAB   text
    FORM callback_status1 USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
    ENDFORM. " CALLBACK_STATUS
    *&      Form  CALLBACK_STATUS2
          text
         -->RT_EXTAB   text
    FORM callback_status2 USING rt_extab TYPE slis_t_extab.
      REFRESH fcode_final.
      IF sy-ucomm NE '&F03'.
        APPEND 'UPD'  TO fcode_final.
        APPEND 'ERRLOG' TO fcode_final.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_final.
      ELSE.
        SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
      ENDIF.
    ENDFORM.                    "CALLBACK_STATUS2
    *&      Form  callback_ucomm_E
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM callback_ucomm_e USING ucomm LIKE sy-ucomm
                         selfield TYPE slis_selfield.
      CASE sy-ucomm.
        WHEN 'ERRLOG' .
          PERFORM display_alv_err.
        WHEN '&F03'.
          SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY .
          PERFORM display_alv .
      ENDCASE.
    ENDFORM.                    "CALLBACK_UCOMM=
    *&      Form  init_variant
          text
    -->  p1        text
    <--  p2        text
    FORM init_variant .
      CLEAR: wk_variant.
      wk_repid              = sy-repid.
      wk_variant-report     = wk_repid.
      wk_variant-username   = sy-uname.
      wk_variant_save       = 'A'. "All types
    ENDFORM.                    " init_variant
    *&      Form  f_read_datum1
          text
         -->P_T_RES_HEAD  text
         -->P_P_FILE1  text
         <--P_W_SUBRC  text
    FORM f_read_datum1  TABLES   p_t_res_head STRUCTURE ypp_res_head
                        USING    p_p_file1
                        CHANGING p_w_subrc.
      DATA : iexcel LIKE zexcel_read OCCURS 0 WITH HEADER LINE.
      CLEAR  p_w_subrc.
      CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_p_file1
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = 62
          i_end_row               = 50000
        TABLES
          intern                  = iexcel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        p_w_subrc = 0 .
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT iexcel WHERE row > 2.
        IF iexcel-col = '0001'.
          p_t_res_head-type = iexcel-value.
        ENDIF.
        IF iexcel-col = '0002'.
          p_t_res_head-name = iexcel-value.
        ENDIF.
        IF iexcel-col = '0003'.
          p_t_res_head-vrsioid = iexcel-value.
        ENDIF.
        IF iexcel-col = '0004'.
          p_t_res_head-restype = iexcel-value.
        ENDIF.
        IF iexcel-col = '0005'.
          p_t_res_head-locno = iexcel-value.
        ENDIF.
        IF iexcel-col = '0006'.
          p_t_res_head-tzone = iexcel-value.
        ENDIF.
        IF iexcel-col = '0007'.
          p_t_res_head-calendar = iexcel-value.
        ENDIF.
        IF iexcel-col = '0008'.
          p_t_res_head-planner = iexcel-value.
        ENDIF.
        IF iexcel-col = '0009'.
          p_t_res_h

  • Please send sample document for understanding the requirement for reports

    Hi
    Can some body send sample document for the understanding the requiremets of reports in BI
    I nee to prepare sample document for understanding the requirement.
    please help on this.
    Regards,
    Anand Reddy

    hai experts,
            please  share the code how to enable the selections  at the rsa3 level ,if the generic extractor is based on function module.
         thanks in advance

  • A sample prg for fun module Z_GET_N_APPROVER

    hi,
    i need a sample prog for the fun module GET_N_APPROVER.

    Is it a standard one? the same suggests that its a custom built one? if you need help with this you may have to post the code of this FM
    Regards
    Raja

  • Sample pgm for moving data from table control to internal table

    Hi Experts,
          I am newbi to ABAP. I don't have good material for Table control . Appreciate if you direct me to some good source of knowledge on Table control.
    The problem at hand : I am trying to move info/data from table control (in screen painter/ input and output mode ) to ITAB but couldn't . Sample pgm if possible.
    <b>Modify ITAB index TC-Current_Line .</b>
    The above statement is not inserting new lines to ITAB . Help me!
    Thanks for your time

    hi,
    do like this...
    <b>PROCESS AFTER INPUT.</b>
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'
      LOOP AT itab_det.
        CHAIN.
         FIELD itab_det-comp_code.
          FIELD itab_det-bill_no.
          FIELD itab_det-bill_date.
          FIELD itab_det-vend_cust_code.
          FIELD itab_det-bill_amt.
          MODULE <b>tab1_modify</b> ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD itab_det-mark
          MODULE tab1_mark ON REQUEST.
      ENDLOOP.
    <b>MODULE tab1_modify INPUT.</b>
      APPEND itab_det.
    <b>ENDMODULE.                    "TAB1_MODIFY INPUT</b>

  • How to set variant for ALV grid from ABAP

    Hello,
    I have a program which displays some data with ALV grid. Then after some operation I would like to set different layout for the grid, but not by choosing it manually but by the program. I thought that it would be enough to use the method SET_VARIANT, so I'm setting DISVARIANT structure properly, using SET_VARIANT method and after that I'm calling REFRESH_TABLE_DISPLAY but layout is not changed. What else should I do? Is that possible?
    Best regards,
    Marcin

    Hi,
    Check this
    * While declaring select-options
    parameters: p_vari        like ltdx-variant.  " Layout
    * then add the following code in
    at selection-screen on value-request for p_vari.
      perform f_variant_f4 using p_vari.
    * Code for f_variant_f4
    form f_variant_f4 using  p_vari.
    * private variables
      data : v_exit    type c.
      clear gs_variantt.
      v_variant_save = 'U'.
      call function 'LVC_VARIANT_F4'
        exporting
          is_variant    = gs_variant
          i_save        = v_variant_save
        importing
          e_exit        = v_exit
          es_variant    = gs_variantt
        exceptions
          not_found     = 1
          program_error = 2
          others        = 3.
      if sy-subrc ne c_0.
        message i999(yscc) with text-064.    " No Layout Available for F4
      endif.
      if v_exit is initial.
        gs_variant-variant = gs_variantt-variant.
        p_vari             = gs_variantt-variant.
      endif.
    endform.                                 " F_variant_f4
    * In PBO
        call method grid1->set_table_for_first_display
          exporting
            is_layout                     = gs_layout
            is_variant                    = gs_variant
            i_save                        = 'A'
            it_toolbar_excluding          = i_exclude[]
          changing
            it_outtab                     = i_output[]
            it_fieldcatalog               = i_fieldcat[]
          exceptions
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            others                        = 4.

  • Need sample prog for ALV reporting

    Hi All,
    I need some sample ALV programs, Please mail docs  to below
    avinavpratapsinghDOTseATmail.com
    Thanks n Rgds,
    Kali

    Hi,
    check link.
    link:[https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/sampleALVHEIRARCHYreportprogram]
    link:[www.blogcatalog.com/blogs/all-sap-abap-programming/posts/tag/abap%20alv%20reports%20sample%20codes/ ]
    hope it'll help.
    Regards,
    Sneha.

  • Problem with alv edit and save

    hi all,
           can anyone find me a solution for alv edit and save...the issue is that i will be editing and just clicking on save button withot any row selction and the data changed should be updated in database.
                                                                                    sunil.

    Hi Bhaskar,
    To make fields editable in ALV, while creating the field catalog for ALV, use:-
    wa_field-edit = 'X'. " to make a field editable
    To check the data changed in ALV, use code:-
    ALV GRID Display
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program                = sy_repid " report id
        i_callback_user_command           = 'USER_COMMAND' " to handle user command
        it_fieldcat                       = it_field " for field catalog
        it_sort                           = it_sort " for sort records info
      TABLES
        t_outtab                          = it_final "internal table with records
      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.
    Sub-routine USER_COMMAND
    FORM user_command USING v_okcode LIKE sy-ucomm selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      v_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE v_okcode.
    * when the function code is EXECUTE then process the selected records
        WHEN 'EXECUTE'.
    *to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          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.
    * refresh the ALV Grid output from internal table
          selfield-refresh = c_check.
    ENDCASE.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Template for ALV

    anyone have a template for ALV with FM reuse_alv_grid
    PLS////

    Hope you mean to ask a sample program for ALV GRID report
    Here you go.
    RANGES: r_fiscal_period     FOR  s600-spmon.
    DATA:   gt_fieldcat         TYPE slis_t_fieldcat_alv,
            gt_fcat             TYPE slis_t_fieldcat_alv,
            gs_fieldcat         LIKE LINE OF gt_fieldcat,
            gs_fcat             LIKE LINE OF gt_fcat,
            gt_fldcat           TYPE lvc_t_fcat,
            gs_fldcat           TYPE lvc_s_fcat,
            gt_layout           TYPE slis_layout_alv,
            gt_events           TYPE slis_t_event,
            gt_list_top_of_page TYPE slis_t_listheader,
            gv_repid            LIKE sy-repid,
            gv_beg_period       LIKE /irm/s_ipcisel-etprd,
            gv_line(2)          TYPE c.
    DATA:   gv_year(4)          TYPE c,
            gv_month(2)         TYPE c,
            gv_count            TYPE i,
            gv_total            TYPE mc_umnetwr,
            gv_num_lines        TYPE i,
            gv_text1(100)       TYPE c.
    DATA:   gt_dyn_table TYPE REF TO data,
            gs_dyn_line  TYPE REF TO data.
    FIELD-SYMBOLS: <fs_quota>   TYPE STANDARD TABLE,
                   <fs_amount>,
                   <fs_quota_wa>.
    *                C O N S T A N T S
    CONSTANTS: c_600                  TYPE tabname VALUE 'S600',
               c_601                  TYPE tabname VALUE 'S601',
               c_602                  TYPE tabname VALUE 'S602',
               c_603                  TYPE tabname VALUE 'S603',
               c_a00                  TYPE vrsio   VALUE 'A00',
               c_01(2)                TYPE c       VALUE '01',
               c_formname_top_of_page TYPE slis_formname
                                      VALUE 'TOP_OF_PAGE'.
    *   I N T E R N A L  T A B L E S     &      W O R K  A R E A S
    *structure to hold the quotas
    TYPES: BEGIN OF ty_quotas,
             umnetwr   TYPE mc_umnetwr,                  "Net Value
           END OF ty_quotas.
    *list of months
    DATA: BEGIN OF gs_months,
            field_1      LIKE s600-umnetwr,
            field_2      LIKE s600-umnetwr,
            field_3      LIKE s600-umnetwr,
            field_4      LIKE s600-umnetwr,
            field_5      LIKE s600-umnetwr,
            field_6      LIKE s600-umnetwr,
            field_7      LIKE s600-umnetwr,
            field_8      LIKE s600-umnetwr,
            field_9      LIKE s600-umnetwr,
            field_10     LIKE s600-umnetwr,
            field_11     LIKE s600-umnetwr,
            field_12     LIKE s600-umnetwr,
            total        LIKE s600-umnetwr,
          END OF gs_months.
    DATA: gs_quotas TYPE ty_quotas,
          gt_quotas LIKE gs_quotas OCCURS 0 WITH HEADER LINE.
    *            S E L E C T I O N - S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-013.
    PARAMETER: p_lis  TYPE tabname,                "plan input
               p_date LIKE /irm/s_ipcisel-etprd,   "end period
               p_emp  TYPE /irm/ip_ktonr,          "sales participant
               p_terr LIKE ztip_sales-zzterritory, "territory
               p_dis  TYPE zzdistrict,             "district
               p_reg  TYPE zzregion.               "region
    SELECTION-SCREEN END OF BLOCK bl1.
    *          S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
    *clear all tables, work areas, variables etc
      PERFORM clear_variables.
    *get all the months in the period range
      PERFORM get_periods.
    *retrieve component quotas
      PERFORM component_quota_amt.
    *build field catalogue using internal table
      PERFORM field_catalog_create.
    *build dynamic table
      PERFORM build_dynamic_table.
    *build layout for the ALV list
      PERFORM build_layout.
    *event table to trigger the TOP OF PAGE event to display the heading
      PERFORM eventtab_build USING gt_events[].
    *subroutine for displaying the header which contains the number of
    *datasets selected or displayed
      PERFORM header_build  USING gt_list_top_of_page[].
    *ALV grid display
      PERFORM display_alv_grid.
    *&      Form  clear_variables
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM clear_variables.
      CLEAR:     gs_quotas,
                 gv_count,
                 gv_beg_period,
                 gv_total.
      REFRESH:   gt_quotas.
      MOVE sy-repid TO gv_repid.
    ENDFORM.                    " clear_variables
    *&      Form  get_periods
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_periods.
    *get the fiscal year
      gv_month = p_date+4(2).
      gv_year  = p_date+0(4).
      MOVE gv_month TO gv_count.
      CONCATENATE gv_year c_01 INTO gv_beg_period.
      r_fiscal_period-low    = gv_beg_period.
      r_fiscal_period-high   = p_date.
      r_fiscal_period-sign   = 'I'.
      r_fiscal_period-option = 'BT'.
      APPEND r_fiscal_period.
    ENDFORM.                    " get_periods
    *&      Form  field_catalog_create
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM field_catalog_create.
      DESCRIBE TABLE gt_quotas LINES sy-tabix.
      gv_num_lines = sy-tabix.
      gv_num_lines = gv_num_lines - 1.
      DO gv_num_lines TIMES.
        MOVE sy-index TO gv_line.
        CONCATENATE 'FIELD_' gv_line INTO gs_fldcat-fieldname.
        APPEND gs_fldcat TO gt_fldcat.
      ENDDO.
      MOVE 'TOTAL' TO gs_fldcat-fieldname.
      APPEND gs_fldcat TO gt_fldcat.
    *build field catalog and change the field texts of some of the amount
    *fields more specific
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = gv_repid
                i_internal_tabname     = 'GS_MONTHS'
                i_inclname             = gv_repid
                i_bypassing_buffer     = 'X'
           CHANGING
                ct_fieldcat            = gt_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      LOOP AT gt_fieldcat INTO gs_fieldcat.
    *condition to check for building a dynamic ALV grid
        CHECK sy-tabix LE gv_count.
        CASE gs_fieldcat-fieldname.
          WHEN 'FIELD_1'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-001 TO gs_fcat-seltext_l.
            MOVE text-001 TO gs_fcat-seltext_m.
            MOVE text-001 TO gs_fcat-seltext_s.
            MOVE text-001 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_2'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-002 TO gs_fcat-seltext_l.
            MOVE text-002 TO gs_fcat-seltext_m.
            MOVE text-002 TO gs_fcat-seltext_s.
            MOVE text-002 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_3'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-003 TO gs_fcat-seltext_l.
            MOVE text-003 TO gs_fcat-seltext_m.
            MOVE text-003 TO gs_fcat-seltext_s.
            MOVE text-003 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_4'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-004 TO gs_fcat-seltext_l.
            MOVE text-004 TO gs_fcat-seltext_m.
            MOVE text-004 TO gs_fcat-seltext_s.
            MOVE text-004 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_5'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-005 TO gs_fcat-seltext_l.
            MOVE text-005 TO gs_fcat-seltext_m.
            MOVE text-005 TO gs_fcat-seltext_s.
            MOVE text-005 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_6'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-006 TO gs_fcat-seltext_l.
            MOVE text-006 TO gs_fcat-seltext_m.
            MOVE text-006 TO gs_fcat-seltext_s.
            MOVE text-006 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_7'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-007 TO gs_fcat-seltext_l.
            MOVE text-007 TO gs_fcat-seltext_m.
            MOVE text-007 TO gs_fcat-seltext_s.
            MOVE text-007 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_8'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-008 TO gs_fcat-seltext_l.
            MOVE text-008 TO gs_fcat-seltext_m.
            MOVE text-008 TO gs_fcat-seltext_s.
            MOVE text-008 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_9'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-009 TO gs_fcat-seltext_l.
            MOVE text-009 TO gs_fcat-seltext_m.
            MOVE text-009 TO gs_fcat-seltext_s.
            MOVE text-009 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_10'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-010 TO gs_fcat-seltext_l.
            MOVE text-010 TO gs_fcat-seltext_m.
            MOVE text-010 TO gs_fcat-seltext_s.
            MOVE text-010 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_11'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-011 TO gs_fcat-seltext_l.
            MOVE text-011 TO gs_fcat-seltext_m.
            MOVE text-011 TO gs_fcat-seltext_s.
            MOVE text-011 TO gs_fcat-reptext_ddic.
          WHEN 'FIELD_12'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-012 TO gs_fcat-seltext_l.
            MOVE text-012 TO gs_fcat-seltext_m.
            MOVE text-012 TO gs_fcat-seltext_s.
            MOVE text-012 TO gs_fcat-reptext_ddic.
        ENDCASE.
        APPEND gs_fcat   TO gt_fcat.
      ENDLOOP.
      LOOP AT gt_fieldcat INTO gs_fieldcat.
        CASE gs_fieldcat-fieldname.
          WHEN 'TOTAL'.
            MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
            MOVE text-015 TO gs_fcat-seltext_l.
            MOVE text-015 TO gs_fcat-seltext_m.
            MOVE text-015 TO gs_fcat-seltext_s.
            MOVE text-015 TO gs_fcat-reptext_ddic.
            APPEND gs_fcat   TO gt_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " field_catalog_create
    *&      Form  component_quota_amt
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM component_quota_amt.
    *convert the user to a valid format
      PERFORM partid_input_conversion CHANGING p_emp.
      IF p_lis EQ c_600.
    *Employee Monthly Quota Targets
        SELECT   umnetwr
          INTO   TABLE gt_quotas
          FROM   s600                      "Employee Monthly Quota Targets
         WHERE   ssour  EQ space
           AND   vrsio  EQ c_a00
           AND   spmon  IN r_fiscal_period
           AND   pvrtnr EQ p_emp.
      ELSEIF p_lis EQ c_601.
    *Territory monthly quota targets
        SELECT   umnetwr
          INTO   TABLE gt_quotas
          FROM   s601                      "Territory monthly quota targets
         WHERE   ssour      EQ space
           AND   vrsio      EQ c_a00
           AND   spmon      IN r_fiscal_period
           AND   zzterritor EQ p_terr.
      ELSEIF p_lis EQ c_602.
    *District Monthly Quota Targets
        SELECT   umnetwr
          INTO   TABLE gt_quotas
          FROM   s602                      "District  Monthly Quota Targets
         WHERE   ssour      EQ space
           AND   vrsio      EQ c_a00
           AND   spmon      IN r_fiscal_period
           AND   zzdistrict EQ p_dis.
      ELSEIF p_lis EQ c_603.
    *Region Monthly Quota Targets
        SELECT   umnetwr
          INTO   TABLE gt_quotas
          FROM   s603                      "Region Monthly Quota Targets
         WHERE   ssour      EQ space
           AND   vrsio      EQ c_a00
           AND   spmon      IN r_fiscal_period
           AND   zzregion   EQ p_reg.
      ENDIF.
      LOOP AT gt_quotas INTO gs_quotas.
        gv_total = gv_total + gs_quotas-umnetwr.
      ENDLOOP.
      MOVE gv_total    TO gs_quotas-umnetwr.
      APPEND gs_quotas TO gt_quotas.
    ENDFORM.                    " component_quota_amt
    *&      Form  build_dynamic_table
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_dynamic_table.
    *Create dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
                   EXPORTING
                      it_fieldcatalog = gt_fldcat
                   IMPORTING
                      ep_table        = gt_dyn_table.
      ASSIGN gt_dyn_table->* TO <fs_quota>.
      CREATE DATA gs_dyn_line LIKE LINE OF <fs_quota>.
      ASSIGN gs_dyn_line->* TO <fs_quota_wa>.
      LOOP AT gt_quotas INTO gs_quotas.
        ASSIGN COMPONENT sy-tabix OF STRUCTURE <fs_quota_wa> TO <fs_amount>.
        <fs_amount> = gs_quotas-umnetwr.
      ENDLOOP.
      IF sy-subrc = 0.
        APPEND <fs_quota_wa> TO <fs_quota>.
      ENDIF.
    ENDFORM.                    " build_dynamic_table
    *&      Form  display_alv_grid
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_alv_grid.
      IF NOT <fs_quota> IS INITIAL.
    * ALV grid display
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
                  i_callback_program = gv_repid
                  is_layout          = gt_layout
                  it_fieldcat        = gt_fcat
    *              it_sort            = gt_sortcat
                  i_save             = 'A'
                  it_events          = gt_events
             TABLES
                  t_outtab           = <fs_quota>
             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.
      ELSE.
        MESSAGE i013(zip).
      ENDIF.
    ENDFORM.                    " display_alv_grid
    *&      Form  build_layout
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_layout.
      gt_layout-zebra             = 'X'.
      gt_layout-no_vline          = ' '.
      gt_layout-reprep            = 'X'.
      gt_layout-detail_popup      = 'X'.
      gt_layout-window_titlebar   = text-014.
      gt_layout-no_scrolling      = ' '.
      gt_layout-detail_titlebar   = text-014.
      gt_layout-numc_sum          = 'X'.
      gt_layout-colwidth_optimize = 'X'.
    ENDFORM.                    " build_layout
    *&      Form  partid_input_conversion
    *       text
    *      <--P_P_EMP  text
    FORM partid_input_conversion CHANGING p_emp.
      DATA: lv_pernr  TYPE pernr_d.
      lv_pernr  = p_emp.
      p_emp     = lv_pernr.
    ENDFORM.                    " partid_input_conversion
    *&      Form  eventtab_build
    *       text
    *      -->P_GT_EVENTS[]  text
    FORM eventtab_build USING p_lt_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
    *top of page event is read here to display the heading
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = p_lt_events.
      READ TABLE p_lt_events WITH KEY name =  slis_ev_top_of_page
                             INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_formname_top_of_page TO ls_event-form.
        MODIFY p_lt_events FROM  ls_event TRANSPORTING form
                           WHERE name =  slis_ev_top_of_page.
      ENDIF.
    ENDFORM.                    " eventtab_build
    *&      FORM  TOP-OF-PAGE
    *       text
    FORM top_of_page.
      IF NOT gt_quotas[] IS INITIAL.
    * function module which displayes the number of records selected in the
    *  header part
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
             EXPORTING
                  it_list_commentary = gt_list_top_of_page.
      ENDIF.
    ENDFORM.                    " TOP-OF-PAGE
    *&      Form  header_build
    *       text
    *      -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM header_build USING p_lt_list_top_of_page TYPE slis_t_listheader.
      DATA: ls_line       TYPE slis_listheader,
            lv_amount(20) TYPE c.
      MOVE gv_total TO lv_amount.
      CONCATENATE text-016 lv_amount INTO gv_text1.
      CONCATENATE gv_text1 'USD' INTO gv_text1 SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = gv_text1.
      APPEND ls_line TO p_lt_list_top_of_page.
    ENDFORM.                    " header_build
    Thanks,

  • Optimizing for AVCHD editing

    I am trying to switch to Adobe Premiere Pro CS4 4.0.0 for my editing from Final Cut Pro but working with AVCHD files is a real bear. I don't mind so muc having to initially Render the Work Area in order to make editing smoother, but every minor edit requires you to re-render the clip, which for me averages 10 minutes. If I have to do this 5-6 times per video, I have added an hour of waiting around to my workflow. Are there any settings, preferences, or best practices for working with AVCHD files that would help make this process closer to the experience I have with Final Cut Pro? I am not opposed to even converting the videos to a different format if that would help so long as it doesn't dramatically affect the workflow time. Right now we would rather spend money on a high end PC than on a high end Mac, but if we can't make editing easier on a PC we will be forced to stick with Final Cut Pro.

    Look at the system configurations at http://ppbm4.com benchmark to see what is in your terms high end. Do the benchmark yourself and submit the results to Bill (you can also send them to me by private mail or here if you want).  That way you will know how your system performs and whether further tuning is needed to handle your AVCHD material.

  • Need sample code for Using BADI ME_PROCESS_REQ_CUST

    Dear all,
    Initially my requirement is to Validate the Document Type of Purchase Request ion as per material.
    I have created a implementation for BADI : ME_PROCESS_REQ_CUST .
    im new to OOPS-ABAP, so pls send *sample code for how to use these methods PROCESS_ITEM,
    like declarations, assignment of data into internal table  for further validation*.
    Regards,
    NIranjan.G

    Hi,
    get the item data ....
         *DATA : lt_item TYPE MEREQ_ITEM,
                       ls_item liek line of it_item*
             CALL METHOD im_item->GET_DATA
               RECEIVING
                 RE_DATA = lt_item .
    you will get the data in lt_item.. table
    Thanks,
    Shailaja Ainala.

  • Support for ALV Reports

    Dear Friends
    Please provide me the detailed info and the links  regarding the ALV Reports.
    Thanks

    Hi,
    Theriotical information regarding ALV u can find it in help.sap.com
    Some of the sites for ALV's
    In this u can find sample codes for ALV*
    http://abapprogramming.blogspot.com/search/label/ABAP%20ALV%20REPORTS%20%20SAMPLE%20CODES
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/logo-in-function-reuse_alv_commentary_write-93246
    http://sap4.com/wiki/index.php?title=REUSE_ALV_COMMENTARY_WRITE

  • Best macbook pro for gopro editing

    hi. i am new to the editing world and would like to get a macbook pro, i would use it for homevideo editing from a gopro, holding music and possibly watching the odd movie on it.
    i have no clue on what sort of macbook pro id need but id like a retina display?  what are the pros and cons of retina? and i would also like the macbook pro to not be slow or lag or crash while im edititng.
    so if someone out there could write back with exact specifications to what they think would be the best macbook pro for me that would be great.
    thanks
    Ross

    The best one is the model without the word "Book" in it... 
    You don't say what you want to edit, but in general, editing is a horsepower game so you'll want a lot of RAM, a fast system disk/SSD and the fastest processors and video board available. Don't expect to do much on the battery because all those resources (plus your external media drives) will severely limit your battery life.
    You may also want an external monitor and plan on either USB 3.0 or Thunderbolt external drives for media and scratch storage. The bigger, the better.
    Hope this helps

  • Export book for digital editions crashes In Design

    When I create a book file and then select "Export Book for Digital Editions…" InDesign always crashes.
    But when I create a single InDesign file and select "Export for Digital Editions…" (from the File) menu everything works OK.
    InDesign does create an epub file from the book file but it obviously shouldn't crash and can I be sure that everything is OK with the epub file?
    I've manually deleted InDesign preferences - selected different options in the "Export Book" dialog - logging in as a different user - but still getting the same result…
    has anyone got a suggestion ? -
    thanks - Bedwyr
    InDesign CS4 - V6.0.6 - MacBook Pro - Mac OS X 10.6.6

    google r6025 runtime error and you'll see a lot of advice for tracking down and correcting the problem.

  • How I can export files from CS5.5 to send for further editing in CS6 and no lose quality?

    how I can export files from CS5.5 to send for further editing in CS6 and no lose quality?

    If all you need for further editing is the contents of your Timeline,
    then you should follow Harm's sage advice.
    Lagarith Lossless Video Codec
    http://lags.leetcode.net/codec.html
    Ut Video Codec Suite
    http://www.videohelp.com/tools/Ut-Video-Codec-Suite
    But, if you will need all of your source media files to continue the edit,
    you should consider using the Project Manager.
    Trim or copy your project
    By using the Project Manager, you will be continuing the edit
    with the original media files and there will be no quality loss.
    Be aware that once you have edited the project in CS6,
    it will be problematic (but not impossible) to return to edit in CS5.5.

Maybe you are looking for