Module pool to maintiane table ztavble

hi
can anyone send me complete code to refer for maintaining a ztable
following validation are required like
1) sortiing
deletein and addition save etc all as in table maintianece i need to code by module pool becasue in table maintainece sorting coding is not possible...
also validation are
1) whne user enters ship to info name 1 should automatically be populated from kna1 on pressing enter how to acheive this by module pool
2) email verification format should be correct? how to acheive this by module pool
3) sorting on basis of all fields
regards
Nishant

Hi Nishanth,,,
I also developed the same kind of Program for maintaining the Ztable...
Jus create a new GUI Staus...with the required functions....
Refer the below code:
   REPORT                     : Z0BRAP_TAX_EXCEPTION .
TITLE                      : Tax Exceptions Table
AUTHOR                     : Swaminathan PJ
DATE                       : 04/12/2006
DDN NUMBER                 : SAP-BR-TB0020
TRANSPORT REQUEST NUMBER   : D12K912309
REFERENCE                  :
DESCRIPTION
Program Z0BRAP_TAX_EXCEPTION is an Report program to update the table
ZTBRAP_TAX_EXCPT,here user can Create/Change/Display the table entrie
s and can perform the following functions (Filter,Sort,Summation and
Subtotal).
AMENDMENTS
CHANGES REF         DATE         PERSON         Tran.Req. Number
DESCRIPTION:
               Include for Global Declarations                       *
   INCLUDE: znbrap_tax_exception_top.                                           " Include for Global Declarative elements
     Include
All the subroutines are include
   INCLUDE znbrap_tax_exception.                                                " Include for all Subroutines
     START OF SELECTION
   START-OF-SELECTION.
  Main Subroutine
     PERFORM  procMain.
                     End of Selection                                *
   END-OF-SELECTION.
INCLUDE                    : ZNBRAP_TAX_EXCEPTION_TOP
TITLE                      : Data Declarations
AUTHOR                     :
DATE                       : 04.12.2006
TRANSPORT REQUEST NUMBER   : D12K912309
DESCRIPTION
Global Data Declarations for Z0BRAP_TAX_EXCEPTION
AMENDMENTS
CHANGES REF         DATE         PERSON         Tran.Req. Number
DESCRIPTION:
ALV Declarations
TYPE-POOLS: slis.
Types contains the structure of the table
*TYPES :   BEGIN OF gy_tax_exception.
           INCLUDE STRUCTURE ztbrap_tax_excpt.
             mandt           TYPE   mandt,
             zmonat          TYPE   monat,
             zbukrs          TYPE   bukrs,
             zlifnr          TYPE   lifnr,
             zexctype        TYPE   zebrap_exctype,
             zstcd1          TYPE   stcd1,
             zaugdt_other    TYPE   budat,
             zbelnr          TYPE   belnr,
             zdmbtr          TYPE   dmbtr,
             zwhtinssca      TYPE   dmbtr,
             zuserch         TYPE   syuname,
             zdate_change    TYPE   datum,
             ztime_change    TYPE   uzeit,
*TYPES:          END OF gy_tax_exception.
Tables for the structure defined above
*TYPES : gy_tax_exception_tab  TYPE STANDARD TABLE OF gy_tax_exception.
Internal Table
DATA: gt_tax_excpt_tab        TYPE   STANDARD TABLE OF ztbrap_tax_excpt WITH HEADER LINE, "Global internal table for Tax exceptions data
      gt_fieldcat                   TYPE   slis_fieldcat_alv OCCURS 0 WITH HEADER LINE.         "Global internal table for fieldcat
*&  Include           ZNBRAP_TAX_EXCEPTION                             *
*&      Form  procMain
      text
-->  p1        text
<--  p2        text
FORM procMain .
Set PF-Status
  perform procInitialize.
Select Tax Exceptions Data
  perform procGetTaxExceptionsData.
Display ALV Report with Tax Exceptions Data
  perform procDisplayTaxExceptionsData.
ENDFORM.                    " procMain
      FORM initialize                                               *
form procInitialize.
  CONSTANTS :
  lc_pfstatus               TYPE    abnkr VALUE 'ZTAX_EXCEPTION'. "Pf Status
Set status
  set pf-status lc_pfstatus.
endform.                    "procInitialize
      FORM retrieve_data                                            *
      Retrieve data from SAP                                        *
form procGetTaxExceptionsData.
  REFRESH: gt_tax_excpt_tab.
  select * from ztbrap_tax_excpt
    appending corresponding fields of table gt_tax_excpt_tab.
endform.                    "procGetTaxExceptionsData
Called by REUSE_ALV_GRID_DISPLAY when user interacts.               *
In this case, there are a number of buttons / menu options for      *
user to select for non-standard functions:                          *
o Single Display                                                    *
o Single Change                                                     *
o Single create                                                     *
o Single Delete                                                     *
      --> lv_ucomm                                                  *
      --> LW_SELFIELD                                               *
form user_command using lv_ucomm like sy-ucomm
                  lw_selfield type slis_selfield.
Work area
  DATA: lw_update_tax_excpt TYPE    ztbrap_tax_excpt. " work area for tax exceptions data
  DATA: lw_tax_exception    TYPE    ztbrap_tax_excpt. " work area for tax exceptions data
Variables
  DATA: lv_key              TYPE    abkrs ,                 "key fields
        lv_non_key          TYPE    abkrs,                  "Non Key Fields
        lv_insert           TYPE    ablnv,                  "Insert
        lv_change           TYPE    ablnv,                  "Change
        lv_entry            TYPE    ablnv,                  "Popup title
        lv_display          TYPE    ablnv,                  "Display
        lv_delete           TYPE    ablnv,                  "Delete
        lv_mode             TYPE    ablnv .                 "Menu options
Constants
  CONSTANTS:
       lc_new               TYPE    alind VALUE 'ZNEW',     "Fcode for new
       lc_update            TYPE    alind VALUE 'ZBR',      "Fcode for change
       lc_view              TYPE    alind VALUE 'ZDISP',    "Fcode for display
       lc_delete            TYPE    alind VALUE 'ZDEL ',    "Fcode for delete
       lc_show_field        TYPE    abkrs VALUE '00',       "Show field
       lc_hide_field        TYPE    abkrs VALUE '02'.       "Hide field
Clear Local Work Area
  CLEAR :
       lw_update_tax_excpt.
Clear Local Variables
  CLEAR :
       lv_key,
       lv_non_key,
       lv_mode,
       lv_insert,
       lv_delete,
       lv_change,
       lv_display.
Retrieve data for selected line & store it in a temp structure.
  READ TABLE gt_tax_excpt_tab index lw_selfield-tabindex .
  if sy-subrc is not initial and lv_ucomm <> lc_new  and lv_ucomm(6) <> 'DELETE'.
    message w123(m&).   " Position the cursor on a valid line
    exit.
  endif.
Moving the contents to workarea
MOVE gt_tax_excpt_tab-zmonat         TO lw_update_tax_excpt-zmonat.
MOVE gt_tax_excpt_tab-zbukrs         TO lw_update_tax_excpt-zbukrs.
MOVE gt_tax_excpt_tab-zlifnr         to lw_update_tax_excpt-zlifnr.
MOVE gt_tax_excpt_tab-zexctype       to lw_update_tax_excpt-zexctype.
MOVE gt_tax_excpt_tab-zstcd1         to lw_update_tax_excpt-zstcd1.
MOVE gt_tax_excpt_tab-zaugdt_other   to lw_update_tax_excpt-zaugdt_other.
MOVE gt_tax_excpt_tab-zbelnr         to lw_update_tax_excpt-zbelnr.
MOVE gt_tax_excpt_tab-zdmbtr         to lw_update_tax_excpt-zdmbtr.
MOVE gt_tax_excpt_tab-zwhtinssca     to lw_update_tax_excpt-zwhtinssca.
MOVE gt_tax_excpt_tab-zuserch        to lw_update_tax_excpt-zuserch.
MOVE gt_tax_excpt_tab-zdate_change   to lw_update_tax_excpt-zdate_change.
MOVE gt_tax_excpt_tab-ztime_change   to lw_update_tax_excpt-ztime_change.
Move the text for Add,Change,Display
  Move text-019 To lv_insert.
  Move text-020 To lv_change.
  Move text-021 To lv_display.
  Move text-023 To lv_delete.
Now see which button / menu option user has selected
  case lv_ucomm.
    when lc_view.               "Display a single entry
      lv_mode    = lv_display.
      lv_key     = lc_hide_field.     "hide key fields
      lv_non_key = lc_hide_field.     "hide non key fields
      perform procFindKeyFields
                     using lw_update_tax_excpt lv_mode lv_insert lv_delete
                           lv_change lv_display lv_key lv_non_key lw_selfield.
    when lc_update .          "Update a single entry (show non-key fields)
      lv_mode    = lv_change.
      lv_key     = lc_hide_field.    "hide key fields
      lv_non_key = lc_show_field.    "show non-key fields
      perform procFindKeyFields
                     using lw_update_tax_excpt lv_mode lv_insert lv_delete
                           lv_change lv_display lv_key lv_non_key lw_selfield.
    when lc_new. "Add a single new entry (show all fields)
      lv_mode    = lv_insert.
      lv_key     = lc_show_field.
      lv_non_key = lc_show_field.
      clear lw_update_tax_excpt.  "Empty structure to give new entry.
      perform procFindKeyFields
                     using lw_update_tax_excpt lv_mode lv_insert lv_delete
                           lv_change lv_display lv_key lv_non_key lw_selfield.
    WHEN lc_delete.               " Delete current entry
      lv_mode   = lv_delete.
      lv_key    = lc_hide_field.
      lv_non_key = lc_hide_field.
     perform procFindKeyFields
                     using lw_update_tax_excpt lv_mode lv_insert lv_delete
                           lv_change lv_display lv_key lv_non_key lw_selfield.
  endcase.
endform.                    "user_command
      FORM procFindKeyFields                                        *
-->  lw_tax_excpt                                                  *
-->  lw_update_tax_excpt                                           *
-->  lv_ret                                                        *
form procFindKeyFields  using  lw_update_tax_excpt structure  ztbrap_tax_excpt
                               lv_mode
                               lv_insert
                               lv_delete
                               lv_change
                               lv_display
                               lv_key
                               lv_non_key
                               lw_selfield type slis_selfield.
Work area
  DATA:lw_key_table         TYPE    dfies occurs 0 with header line,      "Work area for for key fields
       lw_tax_excpt         TYPE    sval  occurs 0 with header line.      "Work area for tax exceptions data
Variables
  DATA: lv_ret              TYPE    char1,                                "Return parameter
        lv_title            TYPE    text60,                               "Popup title
        lv_excpt_type       TYPE    ZEBRAP_EXCTYPE,                       "Exception type
        lv_entry            TYPE    ablnv,                                "Popup text
        lv_vendor           TYPE    lifnr,                                "Vendor
        lv_vendor_no        TYPE    lifnr,                                "Vendor
        lv_co_code          TYPE    bukrs,                                "Company code
        lv_comp_code        TYPE    bukrs,                                "Company code
        lv_answer           TYPE    aavis.                                "Return parameter
Constants
  CONSTANTS:
        lc_ref_tab          TYPE    ablnv VALUE 'T001',                   "Reference table
        lc_ref_fld          TYPE    ablnv VALUE 'WAERS',                  "Reference field
        lc_hide_fld         TYPE    abkrs VALUE '04',                     "Hide field
        lc_client           TYPE    amert VALUE 'MANDT',                  "Client
        lc_user             TYPE    amert VALUE 'ZUSERCH',                "User
        lc_date             TYPE    amert VALUE 'ZDATE_CHANGE',           "Date
        lc_time             TYPE    amert VALUE 'ZTIME_CHANGE',           "Time
        lc_taxno            TYPE    amert VALUE 'ZSTCD1',                 "Tax Number
        lc_vendor           TYPE    amert VALUE 'ZLIFNR',                 "Vendor
        lc_exception_typ    TYPE    amert VALUE 'ZEXCTYPE',               "Exception type
        lc_clearing_dt      TYPE    amert VALUE 'ZAUGDT_OTHER',           "Clearing date
        lc_period           TYPE    amert VALUE 'ZMONAT',                 "Period
        lc_co_code          TYPE    amert VALUE 'ZBUKRS',                 "Company code
        lc_gross_amt        TYPE    amert VALUE 'ZDMBTR',                 "Gross amount
        lc_excpt_amt        TYPE    amert VALUE 'ZWHTINSSCA',             "Exception amount
        lc_period_def       TYPE    abkrs VALUE '00',                     "Default value for period
        lc_amount_def       TYPE    amert VALUE '0.00',                   "Default value for amount
        lc_date_def         TYPE    amert VALUE '00000000',               "Default value for date
        lc_exctype_mf       TYPE    abkrs VALUE 'MF',                     "Exception type value
        lc_exctype_gr       TYPE    abkrs VALUE 'GR',                     "Exception type value
        lc_field_obl        TYPE    aavis VALUE 'X',                      "Obligatory
        lc_cancel           TYPE    aavis VALUE 'X',                      "Obligatory
        lc_return           TYPE    aavis VALUE 'A',                      "Return parameter
        lc_mandatory        TYPE    aavis VALUE '?',                      "Mandatory
        lc_space            TYPE    abkrs VALUE ' ',                      "Space
        lc_notsupported     TYPE    agitt VALUE 1,                        "Exception for FM
        lc_others           TYPE    agitt VALUE 2,                        "Exception for FM
        lc_error            TYPE    agitt VALUE 1,                        "Exception for FM
        lc_confirm          TYPE    agitt VALUE 1,                        "Exception for FM
        lc_text             TYPE    agitt VALUE 1,                        "Exception for FM
        lc_start_column     TYPE    abkrs VALUE '50',                     "Start column
        lc_start_row        TYPE    aavis VALUE '7',                      "Start column
        lc_tabname          TYPE    amert VALUE 'ZTBRAP_TAX_EXCPT',       "Table name,
        lc_column           TYPE    SY-CUCOL VALUE 25,                    "Start column
        lc_row              TYPE    SY-CUROW VALUE 6.                     "Start row
Clear Local Work Area
  CLEAR :
       lw_tax_excpt,
       lw_key_table .
Clear Local Variables
  CLEAR :
        lv_ret,
        lv_title,
        lv_excpt_type,
        lv_vendor,
        lv_vendor_no,
        lv_co_code,
        lv_comp_code,
        lv_answer.
Field symbol
  field-symbols:            <lf_tax_excpt>,                                         "Tax exceptions values
                            <lf_tax_excpt_value>.
Move the text for entry
  Move text-022 To lv_entry.
  REFRESH lw_tax_excpt.
  lw_tax_excpt-field_obl = lc_field_obl.
  lw_tax_excpt-tabname =   lc_tabname.
Determine which are key fields in the table. This is necessary to
control which fields are available for display
  call function 'GET_KEY_FIELDS_OF_TABLE'
    EXPORTING
      tabname       = lw_tax_excpt-tabname
      mandt_needed  = lc_field_obl
    TABLES
      key_fieldtab  = lw_key_table
    EXCEPTIONS
      not_supported = lc_notsupported
      others        = lc_others.
  if sy-subrc is not initial.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.
  loop at gt_fieldcat.
    case gt_fieldcat-fieldname.
Supress fields you don't want to show
      when lc_client or  lc_user or lc_date or lc_time.
      when OTHERS.
        READ TABLE lw_key_table with key fieldname = gt_fieldcat-fieldname.
        if sy-subrc is initial.
          lw_tax_excpt-field_attr = lv_key.
          lw_tax_excpt-field_obl = lc_field_obl.
        else.
          lw_tax_excpt-field_attr = lv_non_key.
          lw_tax_excpt-field_obl = lc_space.
        endif.
        lw_tax_excpt-fieldname = gt_fieldcat-fieldname.
        assign component lw_tax_excpt-fieldname of
                        structure lw_update_tax_excpt to <lf_tax_excpt>.
        lw_tax_excpt-value =    <lf_tax_excpt>.
        lw_tax_excpt-fieldtext = gt_fieldcat-seltext_l.
Remove the condition obligatory
        IF lw_tax_excpt-fieldname = lc_taxno.
          lw_tax_excpt-field_obl = lc_space.
        ENDIF.
        append lw_tax_excpt.
    endcase.
  endloop  .
Appending the reference table and field for amount field
  if lv_mode = lv_insert.
    lw_tax_excpt-tabname    = lc_ref_tab.
    lw_tax_excpt-fieldname  = lc_ref_fld.
    lw_tax_excpt-field_attr = lc_hide_fld.
    append lw_tax_excpt.
  endif.
IF lv_mode  NE lv_delete.
Show selected entry
  CONCATENATE lv_mode lv_entry INTO lv_title SEPARATED BY space.
  do.
    call function 'POPUP_GET_VALUES'
      EXPORTING
        popup_title     = lv_title
        start_column    = lc_start_column
        start_row       = lc_start_row
      IMPORTING
        returncode      = lv_ret
      TABLES
        fields          = lw_tax_excpt
      EXCEPTIONS
        error_in_fields = lc_error
        others          = lc_others.
Exit if Error, Display or Delete
    if sy-subrc is not initial or lv_ret = lc_return
                               or lv_mode = lv_display
                               or lv_mode = lv_delete..
      exit.
    endif.
Validate fields involved in ADDING NEW ENTRY
    IF lv_mode  = lv_insert .         "ADD new Entry
Validate the field Period
      READ TABLE lw_tax_excpt with key fieldname = lc_period.
      IF lw_tax_excpt-value EQ lc_period_def.
        PERFORM procWarnuser USING  text-001 text-003 .
        CONTINUE.
      ENDIF.
Validate the field Company code
      READ TABLE lw_tax_excpt with key fieldname = lc_co_code.
      lv_co_code = lw_tax_excpt-value.
      select single bukrs from t001 into lv_comp_code
      where bukrs = lv_co_code.
      IF sy-subrc is not initial.
        PERFORM procWarnuser USING  text-001 text-028 .
        CONTINUE.
      ENDIF.
Validate the field Vendor
      READ TABLE lw_tax_excpt with key fieldname = lc_vendor.
      lv_vendor = lw_tax_excpt-value.
      select single lifnr from lfa1 into lv_vendor_no
      where lifnr = lv_vendor.
      IF sy-subrc is not initial.
        PERFORM procWarnuser USING  text-001 text-024 .
        CONTINUE.
      ENDIF.
Store the value of exception type in a variable
      READ TABLE lw_tax_excpt with key fieldname = lc_exception_typ.
      lv_excpt_type = lw_tax_excpt-value.
Validate the field Tax number1 other entities
      READ TABLE lw_tax_excpt with key fieldname = lc_taxno.
      IF lv_excpt_type EQ lc_exctype_mf or  lv_excpt_type EQ lc_exctype_gr.
        IF lw_tax_excpt-value EQ space.
          PERFORM procWarnuser USING  text-001 text-002 .
          CONTINUE.
        ENDIF.
      ENDIF.
Validate the field Clearing date
      READ TABLE lw_tax_excpt with key fieldname = lc_clearing_dt.
      IF lw_tax_excpt-value EQ lc_date_def.
        PERFORM procWarnuser USING  text-001 text-004.
        CONTINUE.
      ENDIF.
Validate the field Gross amount
      READ TABLE lw_tax_excpt with key fieldname = lc_gross_amt.
      condense lw_tax_excpt-value no-gaps.
      IF lw_tax_excpt-value EQ lc_amount_def OR
         lw_tax_excpt-value EQ space.
        PERFORM procWarnuser USING  text-001 text-005.
        CONTINUE.
      ENDIF.
Validate the field Exception amount
      READ TABLE lw_tax_excpt with key fieldname = lc_excpt_amt.
      condense lw_tax_excpt-value no-gaps.
      IF lw_tax_excpt-value EQ lc_amount_def OR
         lw_tax_excpt-value EQ space.
        PERFORM procWarnuser USING  text-001 text-006.
        CONTINUE.
      ENDIF.
      delete lw_tax_excpt index 10.
    ENDIF.
  all checks successful !!!!
    exit.
  enddo.
endif.
IF lv_mode  EQ  lv_delete.
CONCATENATE lv_mode lv_entry INTO lv_title SEPARATED BY space.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
       TITLEBAR                    = lv_title
       text_question               = text-025
       TEXT_BUTTON_1               = text-026
       TEXT_BUTTON_2               = text-027
       DISPLAY_CANCEL_BUTTON       = lc_space
       START_COLUMN                = lc_column
       START_ROW                   = lc_row
     IMPORTING
       ANSWER                      = lv_answer
     EXCEPTIONS
       TEXT_NOT_FOUND              = lc_text
       OTHERS                      = lc_others
    IF sy-subrc is not initial.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
ENDIF.
Need to pop-out of the sub if "cancel" was selected
  if lv_ret = lc_return or lv_mode = lv_display.
    exit.
  endif.
copy contents of pop-up back into structure
  loop at lw_tax_excpt.
    check lw_tax_excpt-value <> lc_mandatory.
    assign component lw_tax_excpt-fieldname
                     of structure lw_update_tax_excpt to <lf_tax_excpt_value>.
    <lf_tax_excpt_value> = lw_tax_excpt-value.
  endloop.
update the database accordingly.
  case lv_mode.
    when lv_insert.           "Insert
Give other required field values
      lw_update_tax_excpt-mandt        = sy-mandt.   "Client
      lw_update_tax_excpt-zuserch      = sy-uname.   "User
      lw_update_tax_excpt-zdate_change = sy-datum.   "Date
      lw_update_tax_excpt-ztime_change = sy-uzeit.   "Time
      INSERT into ztbrap_tax_excpt values lw_update_tax_excpt.
      message s036(zmbrap).
    WHEN lv_change.            "Change
Give other required field values
      lw_update_tax_excpt-mandt        = sy-mandt.   "Client
      lw_update_tax_excpt-zuserch      = sy-uname.   "User
      lw_update_tax_excpt-zdate_change = sy-datum.   "Date
      lw_update_tax_excpt-ztime_change = sy-uzeit.   "Time
      MODIFY ztbrap_tax_excpt FROM lw_update_tax_excpt.  "Update record
      message s037(zmbrap).
    WHEN lv_delete.             "Delete
      IF lv_answer = lc_confirm.
      DELETE FROM ztbrap_tax_excpt WHERE
              zmonat       =   lw_update_tax_excpt-zmonat       AND
              zbukrs       =   lw_update_tax_excpt-zbukrs       AND
              zlifnr       =   lw_update_tax_excpt-zlifnr       AND
              zexctype     =   lw_update_tax_excpt-zexctype     AND
              zstcd1       =   lw_update_tax_excpt-zstcd1       AND
              zaugdt_other =   lw_update_tax_excpt-zaugdt_other AND
              zdmbtr       =   lw_update_tax_excpt-zdmbtr       AND
              zwhtinssca   =   lw_update_tax_excpt-zwhtinssca.
      message s038(zmbrap).
      ENDIF.
  endcase.
Now do refresh ...
  if sy-subrc is not initial.
    rollback work.
    message e033(zmbrap).
  else.
    perform procGetTaxExceptionsData.
    commit work.
    perform procGetTaxExceptionsData.
    lw_selfield-refresh    = lc_field_obl.
    lw_selfield-col_stable = lc_field_obl.
    lw_selfield-row_stable = lc_field_obl.
  endif.
endform.                    "procFindKeyFields
      FORM procDisplayTaxExceptionsData                             *
Produce ALV report                                                  *
form procDisplayTaxExceptionsData.
Variables
  DATA: lv_layout         TYPE       slis_layout_alv,                                 "Layout
        lv_dispvariant    TYPE       disvariant,                                      "For display
        lv_events         TYPE       slis_t_event,                                    "Events
        lv_grid_settings  TYPE       lvc_s_glay,                                      "Grid settings
        lv_event          TYPE       slis_alv_event.                                  "Events
Constants
  CONSTANTS:
        lc_user_command   TYPE       slis_formname VALUE 'USER_COMMAND',              "User command
        lc_pf_status      TYPE       slis_formname VALUE 'PF_STATUS_SET_SHOW_LIST',   "Pf status
        lc_top_of_page    TYPE       slis_formname VALUE 'TOP_OF_PAGE',               "Top of page
        lc_tab_name       TYPE       tabname       VALUE  'ZTBRAP_TAX_EXCPT',         "Table name
        lc_stripes        TYPE       aavis         VALUE 'X',                         "Stripes
        lc_save           TYPE       aavis         VALUE 'A',                         "Save
        lc_repid          TYPE       sy-repid      VALUE sy-repid,                    "Program name
        lc_inconsistent   TYPE       agitt         VALUE 1,                           "Exception for FM
        lc_program        TYPE       agitt         VALUE 2,                           "Exception for FM
        lc_others         TYPE       agitt         VALUE 3.                           "Exception for FM
Clear Local Variables
  CLEAR:
        lv_layout,
        lv_dispvariant,
        lv_events,
        lv_grid_settings,
        lv_event.
*Set up ALV structures
  lv_dispvariant-report   = lc_repid.
gv_repid = sy-repid.
  lv_dispvariant-username = sy-uname.
*Set alternate stripes for ALV report
  lv_layout-zebra = lc_stripes .
  lv_grid_settings-coll_top_p = lc_stripes .
*Set up exit structure for top of coverpage
  lv_event-name = slis_ev_top_of_coverpage.
  lv_event-form = slis_ev_top_of_coverpage.
  append  lv_event to lv_events.
*Set up exit for top of page
  lv_event-name = slis_ev_top_of_page.
  lv_event-form = slis_ev_top_of_page.
  append  lv_event to lv_events.
*Build field catalog for List Viewer
  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = lc_repid
      i_inclname             = lc_repid
      i_structure_name       = lc_tab_name
    CHANGING
      ct_fieldcat            = gt_fieldcat[]
    EXCEPTIONS
      inconsistent_interface = lc_inconsistent
      program_error          = lc_program
      others                 = lc_others.
field controls
  PERFORM procBuildFieldcat.
Call ABAP/4 List Viewer
  check not gt_fieldcat[] is initial.
  call function 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = lc_repid
      i_callback_user_command  = lc_user_command
      i_callback_pf_status_set = lc_pf_status
      i_callback_top_of_page   = lc_top_of_page
      is_variant               = lv_dispvariant
      i_grid_settings          = lv_grid_settings
      is_layout                = lv_layout
      it_fieldcat              = gt_fieldcat[]
      it_events                = lv_events
      i_save                   = lc_save  " A = All => Standard & User
    TABLES
      t_outtab                 = gt_tax_excpt_tab.
endform.                    "procDisplayTaxExceptionsData
**&      Form  PF_STATUS_SET_SHOW_LIST
      Set modified standard status for list
form pf_status_set_show_list
                 using lw_excpt_tab TYPE slis_t_extab.
Workarea
  DATA : lw_tax_tab       TYPE       slis_extab.                                      "Type group Slis
Constants
  DATA : lc_pfstat        TYPE       amert    VALUE 'ZTAX_EXCEPTION',                 "Pf status
         lc_prog          TYPE       sy-repid VALUE sy-repid,                         "Program name
         lc_fcode         TYPE       gui_code VALUE 'SELI'.                           "Function code
Clear Workarea
  CLEAR :lw_tax_tab.
  lw_tax_tab-fcode = lc_fcode.
  append lw_tax_tab to lw_excpt_tab.
  set pf-status lc_pfstat of program lc_prog excluding lw_excpt_tab.
endform.                               "PF_STATUS_SET_SHOW_LIST
**&      Form  procBuildFieldcat
      text
-->  p1        text
<--  p2        text
form procBuildFieldcat .
Constants
  CONSTANTS :
        lc_co_code          TYPE    amert VALUE 'ZBUKRS',                             "Company code
        lc_vendor           TYPE    amert VALUE 'ZLIFNR',                             "Vendor
        lc_docu_no          TYPE    amert VALUE 'ZBELNR',                             "Document Number
        lc_user             TYPE    amert VALUE 'ZUSERCH',                            "User
        lc_date             TYPE    amert VALUE 'ZDATE_CHANGE',                       "Date
        lc_time             TYPE    amert VALUE 'ZTIME_CHANGE',                       "Time
        lc_taxno            TYPE    amert VALUE 'ZSTCD1',                             "Tax Number
        lc_exception_typ    TYPE    amert VALUE 'ZEXCTYPE',                           "Exception type
        lc_clearing_dt      TYPE    amert VALUE 'ZAUGDT_OTHER',                       "Clearing date
        lc_period           TYPE    amert VALUE 'ZMONAT',                             "Period
        lc_gross_amt        TYPE    amert VALUE 'ZDMBTR',                             "Gross amount
        lc_excpt_amt        TYPE    amert VALUE 'ZWHTINSSCA'.                         "Exception amount
Set the Fieldtext for the Dictionary fields
  LOOP AT gt_fieldcat.
    gt_fieldcat-key = space.
    CASE gt_fieldcat-fieldname.
      WHEN lc_period.
        gt_fieldcat-seltext_l = text-007.
        MODIFY gt_fieldcat.
      WHEN lc_co_code.
        gt_fieldcat-seltext_l = text-008.
        MODIFY gt_fieldcat.
      WHEN lc_vendor.
        gt_fieldcat-seltext_l = text-009.
        MODIFY gt_fieldcat.
      WHEN lc_exception_typ.
        gt_fieldcat-seltext_l = text-010.
        MODIFY gt_fieldcat.
      WHEN lc_taxno.
        gt_fieldcat-seltext_l = text-011.
        MODIFY gt_fieldcat.
      WHEN lc_clearing_dt.
        gt_fieldcat-seltext_l = text-012.
        MODIFY gt_fieldcat.
      WHEN lc_docu_no.
        gt_fieldcat-seltext_l = text-013.
        MODIFY gt_fieldcat.
      WHEN lc_gross_amt.
        gt_fieldcat-seltext_l = text-014.
        gt_fieldcat-outputlen = 12.
        MODIFY gt_fieldcat.
      WHEN lc_excpt_amt.
        gt_fieldcat-seltext_l = text-015.
        MODIFY gt_fieldcat.
      WHEN lc_user.
        gt_fieldcat-seltext_l = text-016.
        MODIFY gt_fieldcat.
      WHEN lc_date.
        gt_fieldcat-seltext_l = text-017.
        MODIFY gt_fieldcat.
      WHEN lc_time.
        gt_fieldcat-seltext_l = text-018.
        MODIFY gt_fieldcat.
    ENDCASE.
  ENDLOOP.
endform.                    " procBuildFieldcat
*&      Form  procWarnuser
      Warn User - Give error message
     -->P_TEXT      text
     -->P_TEXT      text
     -->P_lw_tax_excpt_VALUE  text
FORM procWarnuser  USING    uv_title TYPE itex132
                            uv_text1 TYPE itex132.
Constants
  CONSTANTS :
        lc_start_column       TYPE    SY-CUCOL VALUE 25,                             "Start column
        lc_start_row          TYPE    SY-CUROW VALUE 15.                             "Start row

Similar Messages

  • Module pool prorgam in table control designing

    Hi ,
    I have created the table control in module pool program.(Screen added in VA01 header level under addition data2)
    I have given the option for table control for Single line selection and W/Sel colum .
    My requirement is if i enter the data in table cotrol( SO creation)  or if data alreday Coming in table cotrol  (for So Change mode).Should allow to select the row.if table control doesn't have data for line wise.shouldn't t allow to select the Row selection.
    I tried to set the table control line selection mode option with  TABLE1-LINE_SEL_MODE = 0 through program.Its not allowing to select any row like with data also not allowing  to select and without data also its not allowing to select the data.
    How to set the functinality for same.
    Its very urgent Requirement.
    Regards
    DIvakar Reddy K.

    Hi Divakar,
    In the PBO of the screen, you need to write below code:
      PROCESS BEFORE OUTPUT.
      MODULE STATUS_0100.
        LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.
      ENDLOOP.
    Please refer to program DEMO_DYNPRO_TABCONT_LOOP_AT.

  • Module pool program, table control edit

    Hi,
    I am doing module pool programming with table control.  I have a table control on my screen which is assigned to scarr table with ‘New’, ‘Modify’, ‘Save’, and ‘Delete’ buttons.  When I click on ‘New’ and ‘Save’, the new record is adding to the table where as for ‘Modify’, I selected a row, edited, and clicked on save.  Only the internal table is getting modified at the time but not the original table.  How to update the table in database? Delete is also not working.  Please give some idea on this or links related to table control with sample code.
    Thanks in advance.

    Hi,
    modify <table name>.
    it will do it
    Regards

  • Problem in module pool with table control scrolling

    hi,
    i am using the table control in module pool,in the table control i have radion button for all the rows.
    After i got the data into the table control ,if i select radio button and if i press vertical scroll bar button, that radio button is deselecting,how to solve this issue.
    Please help me.

    Hi
    Generally we don't keep radiobuttons in table control for selecting the records
    We keep check boxes for selecting the records
    Radio button is used to select a single from a group of records and at a time only one is selected, where as checkboxes at a time you can select a single or multiple.
    So use checkboxes and code correctly see the doc for Table control
    syntax:
    CONTROLS .
    if you only want to determine the row of the table control. SY´-SUBRC allows you to check if the cursor is placed in a row of a table control.
    u need to comment the performs of table control fields and write ur own perform statements. And u have to declare the table control fields as separate internal tables.
    Go through this urls.
    www.****************
    www.sap-img.com
    Check the below links.
    http://www.planetsap.com/howdo_a.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/content.htm
    http://sap.niraj.tripod.com/id25.html
    Reward points if useful
    Regards
    Anji

  • Table maintenance by using module pool program

    Hi
    Please give me step by step procedure to generate table maintenance by using module pool program

    While creating table maintenance, you can go thro' the module pool program used for that.In that,in PBO part,just try making particular field active = 1 inside loop at screen.
    Girish Kumar Lo...  
    Posts: 1,518
    Questions: 2
    Registered: 4/19/07
    Forum points: 1,982 
       Re: Regarding Table maintanence generator  
    Posted: Jun 26, 2007 9:02 AM    in response to: Younus Khan       Reply      E-mail this post 
    here is the code for that
    REPORT ZTAB_MAINT
           NO STANDARD PAGE HEADING
           MESSAGE-ID ZZ.
                      T Y P E  D E C L A R A T I O N S
    *--Types declaration for selection to be passed as parameter into
    *--VIEW_MAINTENANCE_CALL FM
    TYPES: BEGIN OF TP_RANGETAB.
            INCLUDE STRUCTURE VIMSELLIST.
    TYPES: END OF TP_RANGETAB.
                   D A T A  D E C L A R A T I O N S
    DATA: V_MATNR TYPE MATNR,              " Material Number
          V_WERKS TYPE WERKS_D,              " Plant
          V_KONOB TYPE KONOB,              " Product allocation object
          V_ZCPLT(40) TYPE C.              " Message
           I N T E R N A L  T A B L E  D E C L A R A T I O N S
    Internal table to subroutine code
    *Internal table used as selection for VIEW_MAINTENANCE_CALL FM
    DATA: IT_RANGETAB TYPE STANDARD TABLE OF TP_RANGETAB WITH HEADER LINE.
    *--Internal table used for getting the tablefields
    DATA: BEGIN OF IT_HEADER OCCURS 1.
            INCLUDE STRUCTURE VIMDESC.
    DATA: END   OF IT_HEADER.
    *--Name Tabel
    DATA: BEGIN OF IT_NAMTAB OCCURS 50.
            INCLUDE STRUCTURE VIMNAMTAB.
    DATA: END   OF IT_NAMTAB.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_MATNR OCCURS 0,
            MATNR TYPE MATNR,
          END OF IT_MATNR.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_WERKS OCCURS 0,
            WERKS TYPE WERKS,
          END OF IT_WERKS.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_KONOB OCCURS 0,
            KONOB TYPE KONOB,
          END OF IT_KONOB.
    *--Used for handling 'BT' option
    DATA: BEGIN OF IT_ZCPLT OCCURS 0,
            ZCPLT(40) TYPE C,
          END OF IT_ZCPLT.
                       I N P U T  S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK SELSCR WITH FRAME TITLE TEXT-001.
    RANGES: R_MATNR FOR V_MATNR.
    RANGES: R_WERKS FOR V_WERKS.
    RANGES: R_KONOB FOR V_KONOB.
    RANGES: R_ZCPLT FOR V_ZCPLT.
    Select Options
    SELECT-OPTIONS: S_MATNR FOR V_MATNR NO-EXTENSION,     " Material
                    S_WERKS FOR V_WERKS NO-EXTENSION,     " Plant
                    S_KONOB FOR V_KONOB NO-EXTENSION,
                                            " Product allocation object
                    S_ZCPLT FOR V_ZCPLT NO-EXTENSION.     " Plant
    SELECTION-SCREEN END OF BLOCK SELSCR.
                 A T  S E L E C T I O N  S C R E E N
    AT SELECTION-SCREEN.
    Validate user inputs
      PERFORM FRM_VALIDATIONS.
                S T A R T  O F  S E L E C T I O N
    START-OF-SELECTION.
    Fetch Data from Data Base
      PERFORM FRM_GET_DATA.
                         S U B  R O U T I N E S
    *&      Form  frm_get_data
          Call the function module VIEW_MAINTENNACE_CALL to get data
          based on selection criteria
    FORM FRM_GET_DATA .
      CALL FUNCTION 'VIEW_GET_DDIC_INFO'
        EXPORTING
          VIEWNAME = 'ZTAB'
        TABLES
          X_HEADER = IT_HEADER
          X_NAMTAB = IT_NAMTAB
          SELLIST  = IT_RANGETAB
        EXCEPTIONS
          NO_TVDIR_ENTRY = 1
          TABLE_NOT_FOUND = 2.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Error in ZTAB table'(005).
      ENDIF.
      CLEAR: IT_RANGETAB,
             IT_RANGETAB[].
      LOOP AT IT_NAMTAB.
        CASE IT_NAMTAB-VIEWFIELD.
          WHEN 'MATNR'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'MATNR'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_MATNR.
              CASE S_MATNR-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_MATNR-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_MATNR,
                         R_MATNR[].
                  R_MATNR-SIGN = 'I'.
                  R_MATNR-OPTION = 'BT'.
                  R_MATNR-LOW = S_MATNR-LOW.
                  R_MATNR-HIGH = S_MATNR-HIGH.
                  APPEND R_MATNR.
                  SELECT MATNR
                         INTO TABLE IT_MATNR
                         FROM ZTAB
                         WHERE MATNR IN R_MATNR.
                  DELETE ADJACENT DUPLICATES FROM IT_MATNR COMPARING MATNR
                  LOOP AT IT_MATNR.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_MATNR-MATNR.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_MATNR-OPTION.
                  IT_RANGETAB-VALUE    = S_MATNR-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
          WHEN 'WERKS'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'WERKS'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_WERKS.
              CASE S_WERKS-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_WERKS-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_WERKS,
                         R_WERKS[].
                  R_WERKS-SIGN = 'I'.
                  R_WERKS-OPTION = 'BT'.
                  R_WERKS-LOW = S_WERKS-LOW.
                  R_WERKS-HIGH = S_WERKS-HIGH.
                  APPEND R_WERKS.
                  SELECT WERKS
                         INTO TABLE IT_WERKS
                         FROM MARC
                         WHERE WERKS IN R_WERKS.
                  DELETE ADJACENT DUPLICATES FROM IT_WERKS COMPARING WERKS
                  LOOP AT IT_WERKS.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_WERKS-WERKS.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_WERKS-OPTION.
                  IT_RANGETAB-VALUE    = S_WERKS-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
          WHEN 'KONOB'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'KONOB'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_KONOB.
              CASE S_KONOB-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_KONOB-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_KONOB,
                         R_KONOB[].
                  R_KONOB-SIGN = 'I'.
                  R_KONOB-OPTION = 'BT'.
                  R_KONOB-LOW = S_KONOB-LOW.
                  R_KONOB-HIGH = S_KONOB-HIGH.
                  APPEND R_KONOB.
                  SELECT KONOB
                         INTO TABLE IT_KONOB
                         FROM T190
                         WHERE KONOB IN R_KONOB.
                  DELETE ADJACENT DUPLICATES FROM IT_KONOB COMPARING KONOB
                  LOOP AT IT_KONOB.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_KONOB-KONOB.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_KONOB-OPTION.
                  IT_RANGETAB-VALUE    = S_KONOB-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
          WHEN 'ZCPLT'.
            CLEAR IT_RANGETAB.
            IT_RANGETAB-VIEWFIELD = 'ZCPLT'.
            IT_RANGETAB-TABIX     = SY-TABIX.
            IT_RANGETAB-DDIC      = IT_NAMTAB-READONLY.
            LOOP AT S_ZCPLT.
              CASE S_ZCPLT-OPTION.
                WHEN 'EQ'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'EQ'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
                WHEN 'BT'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'GE'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = 'LE'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-HIGH.
                  APPEND IT_RANGETAB.
                WHEN 'NB'.
                  CLEAR: R_ZCPLT,
                         R_ZCPLT[].
                  R_ZCPLT-SIGN = 'I'.
                  R_ZCPLT-OPTION = 'BT'.
                  R_ZCPLT-LOW = S_ZCPLT-LOW.
                  R_ZCPLT-HIGH = S_ZCPLT-HIGH.
                  APPEND R_ZCPLT.
                  SELECT ZCPLT
                         INTO TABLE IT_ZCPLT
                         FROM ZTAB
                         WHERE ZCPLT IN R_ZCPLT.
                  DELETE ADJACENT DUPLICATES FROM IT_ZCPLT COMPARING ZCPLT
                  LOOP AT IT_ZCPLT.
                    IT_RANGETAB-AND_OR    = 'AND'.
                    IT_RANGETAB-OPERATOR = 'NE'.
                    IT_RANGETAB-VALUE    = IT_ZCPLT-ZCPLT.
                    APPEND IT_RANGETAB.
                  ENDLOOP.
                WHEN 'NE'.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR  = 'NE'.
                  IT_RANGETAB-VALUE     = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
                WHEN OTHERS.
                  IT_RANGETAB-AND_OR    = 'AND'.
                  IT_RANGETAB-OPERATOR = S_ZCPLT-OPTION.
                  IT_RANGETAB-VALUE    = S_ZCPLT-LOW.
                  APPEND IT_RANGETAB.
              ENDCASE.
            ENDLOOP.
        ENDCASE.
      ENDLOOP.
      IF S_ZCPLT[] IS INITIAL.
        CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
          EXPORTING
            ACTION      = 'U'
            VIEW_NAME   = 'ZTAB'
          TABLES
            DBA_SELLIST = IT_RANGETAB
          EXCEPTIONS
            CLIENT_REFERENCE                     = 1
            FOREIGN_LOCK                         = 2
            INVALID_ACTION                       = 3
            NO_CLIENTINDEPENDENT_AUTH            = 4
            NO_DATABASE_FUNCTION                 = 5
            NO_EDITOR_FUNCTION                   = 6
            NO_SHOW_AUTH                         = 7
            NO_TVDIR_ENTRY                       = 8
            NO_UPD_AUTH                          = 9
            ONLY_SHOW_ALLOWED                    = 10
            SYSTEM_FAILURE                       = 11
            UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
            VIEW_NOT_FOUND                       = 13
            MAINTENANCE_PROHIBITED               = 14
            OTHERS                               = 15.
        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.
        CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
          EXPORTING
            ACTION      = 'U'
            VIEW_NAME   = 'ZTAB_ZTEST'
          TABLES
            DBA_SELLIST = IT_RANGETAB
          EXCEPTIONS
            CLIENT_REFERENCE                     = 1
            FOREIGN_LOCK                         = 2
            INVALID_ACTION                       = 3
            NO_CLIENTINDEPENDENT_AUTH            = 4
            NO_DATABASE_FUNCTION                 = 5
            NO_EDITOR_FUNCTION                   = 6
            NO_SHOW_AUTH                         = 7
            NO_TVDIR_ENTRY                       = 8
            NO_UPD_AUTH                          = 9
            ONLY_SHOW_ALLOWED                    = 10
            SYSTEM_FAILURE                       = 11
            UNKNOWN_FIELD_IN_DBA_SELLIST         = 12
            VIEW_NOT_FOUND                       = 13
            MAINTENANCE_PROHIBITED               = 14
            OTHERS                               = 15.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDFORM.                    " frm_get_data
    *&      Form  frm_validations
          Validating field values
    FORM FRM_VALIDATIONS .
    Material number should not be validated (10/17/2005)
      CLEAR V_MATNR.
      SELECT SINGLE MATNR
                    INTO V_MATNR
                    FROM MARA
                    WHERE MATNR IN S_MATNR.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Material not found'.
      ENDIF.
      CLEAR V_WERKS.
      SELECT SINGLE WERKS
                    INTO V_WERKS
                    FROM ZTAB
                    WHERE WERKS IN S_WERKS.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Plant (WERKS) not found'(002).
      ENDIF.
      CLEAR V_KONOB.
      SELECT SINGLE KONOB
                    INTO V_KONOB
                    FROM ZTAB
                    WHERE KONOB IN S_KONOB.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH ' Product allocation object not found'(003).
      ENDIF.
      CLEAR V_WERKS.
      SELECT SINGLE WERKS
                    INTO V_WERKS
                    FROM ZTAB
                    WHERE WERKS IN S_ZCPLT.
      IF SY-SUBRC <> 0.
        MESSAGE E002 WITH 'Plant (ZCPLT) not found'(004).
      ENDIF.
    ENDFORM.                    " frm_validations
    reward points if it is usefull ...
    Regarding Table maintanence generator

  • Select current line through push button in module pool

    Hi,
    I have created one module pool program with table control. There I have inserted on push button where some logic is deployed.
    Logic :-
    If I push button on current line or any line, that line should be selected in the program. So that I can move that line to next internal table.
    But, it always shows first line.
    Please suggest the same.

    hi amol,
    GET CURSOR only works on the number of table control lines that can be displayed on screen at any one time.  So, if your screen can display only 4 lines, all you'll ever get from GET CURSOR is a number 1 to 4.  
    But your screen also knows which of your table control records is currently displayed as the top line of your table control.  This information is held in field TC_ITEMS-TOP_LINE (where TC_ITEMS is the name of your table control).  By combining these two bits of information, you can find the correct line number of your selected record. 
    For example in the case you describe where you are clicking on line 5 but GET CURSOR thinks it is line 4 because your screen has moved down a record, I would think that TC_ITEMS-TOP_LINE would be 2.  Add 4 and 2 together, subtract 1 and you'll get your correct line number.
    hope it helps,
    vikas

  • Reg  module pool programming

    Hi,
    iam developing object on modulepool.
    can u pls send examples objects on modulepools.
    thank

    hi ,
    Here you go ....
    Creation of table controls in mpools
    Here you go with the  complete steps  for creating module pool programs  using table control:
    open se51, choose the icon like a table for table control . drag it and then place it in your screen . click on F6 and you will get a screen where youi need to provide the table name / field name that ( fields ) you are going to use in the screen and table control. after giving the ztable name click on get it from dictionary . you will get the list of available fields in a table. next choose the fields you wish to place in the table control , and if you want to place all fields in your table control then select every fields . after this you will get a structure which you should drag place inside the table control area .
    double click on the table control , set the proper attributes, tickmark the horizontal and vertical scroll bars to appear in your TC in the screen . save , check and activate ..
    following are the sample code you should follow to display datas in your table control ..
    write the following code in the flow logic of the screen ............
    process before output.
    module tc_01_init.
    loop at g_tc_01_itab
    into g_tc_01_wa
    with control tc_01
    cursor tc_01-current_line.
    module tc_01_move.
    module tc_01_get_lines.
    endloop.
    module status_0001.
    process after input.
    loop at g_tc_01_itab.
    chain.
    field sflight-carrid.
    field sflight-connid.
    field sflight-fldate.
    module tc_01_modify on chain-request.
    endchain.
    endloop.
    module tc_01_user_command.
    Write the following code in your Zmodulepool program !!
    program z_tst_mpool_tc_01.
    data: begin of l_tab_sflight occurs 10,
    carrid like sflight-carrid,
    connid like sflight-connid,
    fldate like sflight-fldate,
    end of l_tab_sflight.
    tables: sflight.
    types: begin of t_tc_01,
    carrid like sflight-carrid,
    connid like sflight-connid,
    fldate like sflight-fldate,
    end of t_tc_01.
    data: g_tc_01_itab type t_tc_01 occurs 0,
    g_tc_01_wa type t_tc_01. "work area
    data: g_tc_01_copied. "copy flag
    controls: tc_01 type tableview using screen 0001.
    data: g_tc_01_lines like sy-loopc.
    data: ok_code like sy-ucomm.
    include z_tst_mpool_tc_01_pbo .
    include z_tst_mpool_tc_01_pai .
    include z_tst_mpool_tc_01_incl01 .
    include z_tst_mpool_tc_01_status_0001.
    include Z_TST_MPOOL_TC_01_PBO .
    inside include
    module tc_01_init output.
    if g_tc_01_copied is initial.
    select * from sflight
    into corresponding fields
    of table g_tc_01_itab.
    g_tc_01_copied = 'X'.
    refresh control 'TC_01' from screen '0001'.
    endif.
    endmodule.
    module tc_01_move output.
    move-corresponding g_tc_01_wa to sflight.
    endmodule.
    module tc_01_get_lines output.
    g_tc_01_lines = sy-loopc.
    endmodule.
    Revert if further assistance needed ...
    Regards,
    Ranjita

  • Dropdown list in module pool program

    Hi,
    I need to display a dropdown list for LFA1-LIFNR in my module pool program.
    In the screen painter I have added an Input/Output field with name LFA1-LIFNR and corresponding to the Dropdown option I have selected Listbox. When I execute the program empty dropdown list is coming. It is not taking the values of LIFNR from the table LFA1. Please let me know the solution for this.
    Thanks,
    Neethu.

    Hello Abaper,
    You have very well designed the drop-down box that is to be reflected in your program. The next thing for you to do is use any 1 method for populating the values i.e. using the function module F4IF_INT_TABLE_VALUE_REQUEST or VRM values. I prefer to use the the F4IF_INT_TABLE_VALUE_REQUEST as it is easy to use and understand. If you use the following function module then you need to call in a module under the flow logic of the screen i.e. PROCESS ON VALUE REQUEST.
    Let me just illustrate you with the syntax -
    Module Pool Code
    *internal table declaration
    TYPES : BEGIN OF ty_lifnr,
                     lifnr TYPE lfa1-lifnr,
    END OF ty_lifnr.
    DATA : itab_lifnr TYPE STANDARD TABLE OF ty_lifnr.
    *Dialog Modules for PBO
    *Dialog Module for PAI
    MODULE cancel INPUT.
       LEAVE PROGRAM.
    *Dialog Module Process on value reuest
    MODULE create_dropdownbox INPUT.
       SELECT lifnr
       FROM LFA1
       INTO CORRESPONDING FIELDS OF TABLE itab_lifnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
             retfield      = 'LIFNR'
             value_org = 'S'
       TABLES
             value_tab = itab_lifnr
       EXCEPTIONS
    ENDMODULE.
    Now for the Flow Logic -
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
       MODULE cancel AT EXIT-COMMAND.
       MODULE user_command_0100.
    PROCESS ON VALUE REQUEST.
       FIELD lfa1-lifnr MODULE create_dropdownbox.
    Hope this helps ! Let me know if any other doubts arises.

  • Need module pool pgm

    hi friends ,
    i need module pool pgm with table control
    it should allow user to enter data and that data should be stored in
    ZTABLE.plz don't give demo pgm.if any one has developed give brief idea
    thaks in advance
    regards,
    soorya

    hi Soorya ,
        First of all you can get many module pool programs in the SDN search itelf .
    Anyways here is one samplw program for your reference :
    Creation of table controls in mpools
    Here you go with the  complete steps  for creating module pool programs  using table control:
    open se51, choose the icon like a table for table control . drag it and then place it in your screen . click on F6 and you will get a screen where youi need to provide the table name / field name that ( fields ) you are going to use in the screen and table control. after giving the ztable name click on get it from dictionary . you will get the list of available fields in a table. next choose the fields you wish to place in the table control , and if you want to place all fields in your table control then select every fields . after this you will get a structure which you should drag place inside the table control area .
    double click on the table control , set the proper attributes, tickmark the horizontal and vertical scroll bars to appear in your TC in the screen . save , check and activate ..
    following are the sample code you should follow to display datas in your table control ..
    write the following code in the flow logic of the screen ............
    process before output.
    module tc_01_init.
    loop at g_tc_01_itab
    into g_tc_01_wa
    with control tc_01
    cursor tc_01-current_line.
    module tc_01_move.
    module tc_01_get_lines.
    endloop.
    module status_0001.
    process after input.
    loop at g_tc_01_itab.
    chain.
    field sflight-carrid.
    field sflight-connid.
    field sflight-fldate.
    module tc_01_modify on chain-request.
    endchain.
    endloop.
    module tc_01_user_command.
    Write the following code in your Zmodulepool program !!
    program z_tst_mpool_tc_01.
    data: begin of l_tab_sflight occurs 10,
    carrid like sflight-carrid,
    connid like sflight-connid,
    fldate like sflight-fldate,
    end of l_tab_sflight.
    tables: sflight.
    types: begin of t_tc_01,
    carrid like sflight-carrid,
    connid like sflight-connid,
    fldate like sflight-fldate,
    end of t_tc_01.
    data: g_tc_01_itab type t_tc_01 occurs 0,
    g_tc_01_wa type t_tc_01. "work area
    data: g_tc_01_copied. "copy flag
    controls: tc_01 type tableview using screen 0001.
    data: g_tc_01_lines like sy-loopc.
    data: ok_code like sy-ucomm.
    include z_tst_mpool_tc_01_pbo .
    include z_tst_mpool_tc_01_pai .
    include z_tst_mpool_tc_01_incl01 .
    include z_tst_mpool_tc_01_status_0001.
    include Z_TST_MPOOL_TC_01_PBO .
    inside include
    module tc_01_init output.
    if g_tc_01_copied is initial.
    select * from sflight
    into corresponding fields
    of table g_tc_01_itab.
    g_tc_01_copied = 'X'.
    refresh control 'TC_01' from screen '0001'.
    endif.
    endmodule.
    module tc_01_move output.
    move-corresponding g_tc_01_wa to sflight.
    endmodule.
    module tc_01_get_lines output.
    g_tc_01_lines = sy-loopc.
    endmodule.
    hope this will be helpful to you ...
    Revert for further assistance if needed ...
    Regards,
    Ranjita

  • Modul pool scrreen related query

    hi abapers,
    please solve my query regarding module pool.
    i have a module pool screen with table grid and i use upload and download function define on push button, when i press first time upload button my data can easily upload to table grid,
    but when i use mouse scroll button then again data can uploaded on table grid.
    please tale me if  any statement or function is exist to handle this problem.
    thanks,
    Abhi

    HI  I HAVE WRITTEN THIS CODE.
    { MODULE USER_COMMAND_5000_TRC_DETL INPUT.
    CASE SY-UCOMM.    
        WHEN 'UPLOAD'.
          PERFORM DATA_UPLOAD.
          CLEAR SY-UCOMM.
    WHEN 'DOWNLOAD'.
          PERFORM DOWNLOAD.
    ENDCASE.
    FORM DATA_UPLOAD .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          FIELD_NAME = 'P_FILE'
        IMPORTING
          FILE_NAME  = P_FILE.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
         EXPORTING
        I_FIELD_SEPERATOR        =
           I_LINE_HEADER            =  'X'
           I_TAB_RAW_DATA           =  IT_RAW       " WORK TABLE
           I_FILENAME               =  P_FILE "'C:\UPLOAD1.XLS'
         TABLES
           I_TAB_CONVERTED_DATA     = IT_FINAL[]    "ACTUAL DATA
        EXCEPTIONS
           CONVERSION_FAILED        = 1
           OTHERS                   = 2.
    IF SY-SUBRC <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. }
    Edited by: Abhilash on Apr 16, 2009 12:03 PM

  • Module pool object

    hi everyone  can u people  give 
    me a simple module pool object which  has some business functionality  that is easy to understand.
    i need to keep this object in my resume  please kindly help me pals

    Hi,
    Here i am sending the code for One Object which uses Table Control.
    MAIN Program :
    Module pool       : SAPMZ50871_SD_TABLECONTROL                     *
    Title             : Table Control                                  *
    Author            : SANDEEP REDDY                                  *
    Date of Creation  : December 10, 2007                              *
                           Modification Log                             *
    Author                :                                            *
    Date of Change        :                                            *
    Functional Specs #    :                                            *
    Correction Request #  :                                            *
    Description of Change :                                            *
    INCLUDE mz50871_sd_tablecontroltop.            " Global Data
    INCLUDE mz50871_sd_tablecontrol_usei01.        " PAI Modules
    INCLUDE mz50871_sd_tablecontrol_popo01.        " PBO Modules
    *&      Module  EXIT  INPUT
    MODULE exit INPUT.
      CASE okcode.
        WHEN 'CANCEL' OR 'TOP' OR 'BACK'.
          LEAVE PROGRAM.
          CLEAR okcode.
      ENDCASE.
    ENDMODULE.                 " EXIT  INPUT
    *&      Module  GUISTATUS2  OUTPUT
    MODULE guistatus2 OUTPUT.
      SET PF-STATUS 'MENU1'.
    ENDMODULE.                 " GUISTATUS2  OUTPUT
    *&      Module  GUISTATUS3  OUTPUT
    MODULE guistatus3 OUTPUT.
      SET PF-STATUS 'MENU1'.
    ENDMODULE.                 " GUISTATUS3  OUTPUT
    PAI Include :
       INCLUDE MZ50871_SD_TABLECONTROL_USEI01 .
    *&      Module  USER_COMMAND_0100  INPUT
    MODULE user_command_0100 INPUT.
      CASE okcode.
        WHEN 'DISP'.
          SELECT vbeln
                 erdat
                 ernam
                 vbtyp
                 auart
                 kunnr
             FROM vbak
             INTO CORRESPONDING FIELDS OF TABLE it_vbak
             WHERE kunnr = v_kunnr.
          IF sy-subrc NE 0.
            MESSAGE i020(z50871msg) WITH 'Sales Header Data Is Not Available'.
          ELSE.
            tbc1-lines = sy-dbcnt.
            CALL SCREEN '200'.
          ENDIF.
          CLEAR okcode.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  VALIDATE_KUNNR  INPUT
    MODULE validate_kunnr INPUT.
      SELECT SINGLE * FROM kna1 WHERE kunnr = v_kunnr.
      IF sy-subrc = 0.
        v_kunnr1 =  kna1-kunnr.
        v_name1 = kna1-name1.
      ELSE.
        MESSAGE i020(z50871msg) WITH 'Customer Does Not Exist'.
        LEAVE TO SCREEN '100'.
      ENDIF.
    ENDMODULE.                 " VALIDATE_KUNNR  INPUT
    *&      Module  MODIFY_ITAB  INPUT
    MODULE modify_itab INPUT.
      MODIFY it_vbak INDEX tbc1-current_line.
    ENDMODULE.                 " MODIFY_ITAB  INPUT
    *&      Module  user_command_0200  INPUT
    MODULE user_command_0200 INPUT.
      CASE okcode.
        WHEN 'ITEM'.
          READ TABLE it_vbak WITH KEY check = 'X'.
          IF sy-subrc = 0.
            SELECT posnr
                   matnr
                   matkl
                   posar
               FROM vbap
               INTO TABLE it_vbap
               WHERE vbeln = it_vbak-vbeln.
            IF sy-subrc NE 0.
              MESSAGE i020(z50871msg) WITH 'Sales Item Data Is not Available'.
            ELSE.
              v_vbeln = it_vbak-vbeln.
              CALL SCREEN '300'.
            ENDIF.
          ELSE.
            MESSAGE i020(z50871msg) WITH 'Please Select Sales Document Number'.
          ENDIF.
        WHEN 'BACK'.
          LEAVE TO SCREEN '100'.
          CLEAR okcode.
        WHEN 'TOP' OR 'CANCEL'.
          LEAVE PROGRAM.
          CLEAR okcode.
      ENDCASE.
    ENDMODULE.                 " user_command_0200  INPUT
    *&      Module  user_command_0300  INPUT
    MODULE user_command_0300 INPUT.
      CASE okcode.
        WHEN 'BACK'.
          LEAVE TO SCREEN '200'.
          CLEAR it_vbap[].
          CLEAR okcode.
        WHEN 'CANCEL' OR 'TOP'.
          CLEAR : it_vbak[] , it_vbap[].
          LEAVE PROGRAM.
          CLEAR okcode.
      ENDCASE.
    ENDMODULE.                 " user_command_0300  INPUT
    PBO Include :
          INCLUDE MZ50871_SD_TABLECONTROL_POPO01 .
    *&      Module  POPULATE_TBC1  OUTPUT
    MODULE populate_tbc1 OUTPUT.
      vbak-vbeln = it_vbak-vbeln.
      vbak-erdat = it_vbak-erdat.
      vbak-ernam = it_vbak-ernam.
      vbak-vbtyp = it_vbak-vbtyp.
      vbak-auart = it_vbak-auart.
      vbak-kunnr = it_vbak-kunnr.
    ENDMODULE.                 " POPULATE_TBC1  OUTPUT
    *&      Module  GUISTATUS1  OUTPUT
    MODULE guistatus1 OUTPUT.
      SET PF-STATUS 'MENU1'.
    ENDMODULE.                 " GUISTATUS1  OUTPUT
    *&      Module  POPULATE_TBC2  OUTPUT
    MODULE populate_tbc2 OUTPUT.
      vbap-posnr = it_vbap-posnr.
      vbap-matnr = it_vbap-matnr.
      vbap-matkl = it_vbap-matkl.
      vbap-posar = it_vbap-posar.
    ENDMODULE.                 " POPULATE_TBC2  OUTPUT
    TOP Include :
    *& Include MZ50871_SD_TABLECONTROLTOP
    PROGRAM  sapmz50871_sd_tablecontrol.
                 Tables
    TABLES : kna1, vbak, vbap.
            Structure Declarations
            Internaltable Table Declarations
    TYPES : BEGIN OF st_vbak,
             check TYPE c,
             vbeln TYPE vbak-vbeln,              "Sales Document Number
             erdat TYPE vbak-erdat,              "Date on which the record was created
             ernam TYPE vbak-ernam,              "Name of Person who Created the Object
             vbtyp TYPE vbak-vbtyp,              "SD document category
             auart TYPE vbak-auart,              "Sales Document Type
             kunnr TYPE vbak-kunnr,              "Customer Number
            END OF st_vbak.
    TYPES : BEGIN OF st_vbap,
             posnr TYPE vbap-posnr,            "Sales Document Item
             matnr TYPE vbap-matnr,            "Material Number
             matkl TYPE vbap-matkl,            "Material Group
             posar TYPE vbap-posar,            "Item Type
            END OF st_vbap.
    DATA : it_vbak TYPE STANDARD TABLE OF st_vbak WITH HEADER LINE,
           it_vbap TYPE STANDARD TABLE OF st_vbap WITH HEADER LINE.
    *global varible declarations
    DATA : v_kunnr TYPE kna1-kunnr,           "Customer Number
           v_name1 TYPE kna1-name1,           "Customer Name
           v_kunnr1 TYPE kna1-kunnr,          "Customer Number
           v_vbeln TYPE vbak-vbeln,           "Sales Document Number
           okcode TYPE sy-ucomm.
              Table Control Declarations
    CONTROLS : tbc1 TYPE TABLEVIEW USING SCREEN '200',
               tbc2 TYPE TABLEVIEW USING SCREEN '300'.
    Functionality
    In the first screen : it will ask for Customer Number. if you enter any customer number it wil display sales header details related to that customer in table control in the next screen.
    In that screen : tehre wil be one push button "display item detail".
    you need to select sales order number, and you need to press that push button. then in the next screen it wil display item detaails related to that sales order number.
    hope it helps you.
    copy this code , and chk for functionality once.
    <REMOVED BY MODERATOR>
    Regards
    Sandeep REddy
    Edited by: Alvaro Tejada Galindo on May 22, 2008 4:58 PM

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • How to use table maintenance view in module pool screen

    hi ,
    want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.

    You can simply call it via SM30.   Or you can call the table maintence view from any program(report or module pool) using a function module.
      call function 'VIEW_MAINTENANCE_CALL'
           exporting
                action                       = 'U'
                view_name                    = 'Z_Table_Name'
           exceptions
                client_reference             = 1
                foreign_lock                 = 2
                invalid_action               = 3
                no_clientindependent_auth    = 4
                no_database_function         = 5
                no_editor_function           = 6
                no_show_auth                 = 7
                no_tvdir_entry               = 8
                no_upd_auth                  = 9
                only_show_allowed            = 10
                system_failure               = 11
                unknown_field_in_dba_sellist = 12
                view_not_found               = 13
                others                       = 14.
    Regards,
    RIch Heilman

  • Module pool - table control - update ztable

    hello , i doing a module pool that will have few screens , now i have one screen with a table control that fetch the data from a ztable when screen is call the table control is showing the data and is in grey and no editable i add a pf-status for change that mode i can delete the row from the table control but i don't figure out how update to the ztable when i press save , i wan't too another button for add a new row ( and remain the already in grey ) for add new entrie in the table and update the ztable
    pd: sorry for my bad english
    this is my code:
    TOP:
    PROGRAM  z_pp_lote_etiquetas MESSAGE-ID zz.
    TABLES:zc2p_lote_etique,
           zc2p_lider_modul.
    DATA: ok_code LIKE sy-ucomm.
    DATA save_ok LIKE sy-ucomm.
    * internal table
    DATA: it_zc2p_lote_etique LIKE STANDARD TABLE OF zc2p_lote_etique.
    DATA: it_zc2p_lider_modul TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    DATA: it_zc2p_lider_modul_del TYPE STANDARD TABLE OF zc2p_lider_modul WITH HEADER LINE.
    **************Workarea
    DATA: wa_c2p_lote_etique TYPE zc2p_lote_etique.
    DATA: wa_c2p_lider_modul TYPE zc2p_lider_modul.
    DATA: wa_c2p_lider_modul_del TYPE zc2p_lider_modul.
    DATA: sel.
    DATA: MARK.
    DATA: init.
    DATA:  col TYPE scxtab_column.
    DATA: lines TYPE i.
    * Variable Declaration
    DATA : flg, "Flag to set the change mode
    ln TYPE i. "No. of records
    * Table Control Declartion.
    CONTROLS: zc2p_lider_crtl TYPE TABLEVIEW USING SCREEN '101'.
    **PROCESS BEFORE OUTPUT INCLUDE **
    *&  Include           Z_PP_LOTE_ETIQUETAS_O01
    *& Module set_status OUTPUT
    * Setting the GUI status
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_MENU'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    ENDMODULE. " set_status OUTPUT screen 100
    *  MODULE status_0101 OUTPUT
    * Setting the GUI status
    MODULE status_0101 OUTPUT.
      SET PF-STATUS 'Z_PP_LOT_ETIQ_ME_101'.
      SET TITLEBAR 'Z_PP_LOT_ETIQ'.
    * Data retreving
      if init is INITIAL.
      select * from zc2p_lider_modul into CORRESPONDING FIELDS OF TABLE it_zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES ln.
        zc2p_lider_crtl-lines = ln + 10.
        init = 'X'.
    endif.
    ENDMODULE.                    "status_0101 OUTPUT
    module change_sdyn_conn output.
    * you can change the content of current table control line via
    * sdyn_conn
      READ TABLE it_zc2p_lider_modul INTO zc2p_lider_modul INDEX zc2p_lider_crtl-current_line.
    endmodule.                             " FILL_TABLE_CONTROL  OUTPUT
    MODULE set_screen_fields OUTPUT.
    LOOP AT SCREEN.
    IF flg IS INITIAL.
    screen-input = 0.
    ELSE.
    screen-input = 1.
    ENDIF.
    *ENDIF.
    * Modifying the screen after making changes
    MODIFY SCREEN.
    ENDLOOP.
    ENDMODULE. " set_screen_fields OUTPUT
    PROCESS AFTER INPUT INCLUDE.
    *  MODULE USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'LIDM'.
          CALL SCREEN 101.
        WHEN 'CANC'.
          LEAVE PROGRAM.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0100 INPUT
    *  MODULE USER_COMMAND_0101 INPUT
    MODULE user_command_0101 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'SORT'.
          DATA: fldname(100),help(100).
          READ TABLE zc2p_lider_crtl-cols INTO col WITH KEY selected = 'X'.
          SPLIT col-screen-name AT '-' INTO help fldname.
          SORT it_zc2p_lider_modul BY (fldname).
        WHEN 'CHANGE'.
    * Setting the flag to make the table control in editable mode[excluding
    * primary key].
          flg = 'Y'.
        WHEN 'BACK'.
          CALL SCREEN 100.
          LEAVE SCREEN.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'SAVE'.
          MODIFY  zc2p_lider_modul FROM it_zc2p_lider_modul.
          COMMIT WORK.
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_0101 INPUT
    *  MODULE read_table_control INPUT
    MODULE read_table_control INPUT.
    * Check input values
      IF mark = 'X' AND save_ok = 'DELETE'.
        DELETE TABLE it_zc2p_lider_modul FROM zc2p_lider_modul.
        DESCRIBE TABLE it_zc2p_lider_modul LINES zc2p_lider_crtl-lines.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    Screen Flow Logic 100
    PROCESS BEFORE OUTPUT.
    MODULE status_0100.
    PROCESS AFTER INPUT.
    MODULE user_command_0100.
    Screen Flow Logic 101.
    PROCESS BEFORE OUTPUT.
      MODULE status_0101.
      LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    zc2p_lider_crtl.
    * Dynamic screen modifications
        MODULE set_screen_fields.
        MODULE change_sdyn_conn.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0101.
      LOOP AT it_zc2p_lider_modul.
        MODULE read_table_control.
      ENDLOOP.
    i hope somebody can help for what i missing here  thanks

    >
    Sanjeev Kumar wrote:
    > Hello Edgar,
    >
    > Problem seems to be there in the flow logic of 101
    >
    >
    > PROCESS BEFORE OUTPUT.
    >   MODULE status_0101.
    >   LOOP AT it_zc2p_lider_modul INTO zc2p_lider_modul WITH CONTROL
    > zc2p_lider_crtl. " no need to have 'INTO zc2p_lider_modul' above
    > * Dynamic screen modifications
    >     MODULE set_screen_fields.
    >     MODULE change_sdyn_conn.
    >   ENDLOOP.
    > *
    > PROCESS AFTER INPUT.
    >   MODULE user_command_0101. "this should be shifted after the following LOOP...ENDLOOP.

    >   LOOP AT it_zc2p_lider_modul. "need to have 'WITH CONTROL zc2p_lider_crtl' here
    >     MODULE read_table_control.
    >   ENDLOOP.
    >
    >
    >
    > With MODULE user_command_0101 call before the LOOP calls the MODIFY statement (under case save_ok 'SAVE') first and Z-table is updated with the old values as the changes are transferred from screen into the internal table it_zc2p_lider_modul in the LOOP...ENDLOOP later.
    >
    > Try these changes and I hope it will work.
    >
    > Thanks
    > Sanjeev
    i do the firts advice but the second one i get syntax error :
    my code :
    PROCESS AFTER INPUT.
      LOOP  at it_zc2p_lider_modul WITH CONTROL zc2p_lider_crtl.
        MODULE read_table_control.
      ENDLOOP.
       MODULE user_command_0101.
    error :
    In the event PROCESS AFTER INPUT, no additions are allowed with "LOOP     
    AT".

  • Module Pool - Table Control - Data not getting displayed in Control

    Hi,
    I have a table contol in my module pool program. In my processing I am filling an internal table & then in my PBO I am linking the internal table to table control. The issue is that even though the internal table is getting filled correctly (found through debugging), the data is not getting populated in table control. Nothing is populated on screen. I am writing part of code below
    Declaration:
    Types: begin of ty_control,
            SELECTED TYPE C,
            TEXT TYPE DPR_CAUSE_T-TEXT,
          end of ty_control.
    CONTROLS :  TBL_CONT TYPE TABLEVIEW USING SCREEN '9001'.
    DATA:       lt_table_cont type TABLE OF ty_control with header line.
    Fields in TBL_CONT:
       TBL_CONT-SELECTED
      TBL_CONT-TEXT
    PBO Flow Logic:
      MODULE STATUS_9001.
    MODULE fill_data.
      LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
      ENDLOOP.
    PAI Flow Logic:
    Loop at lt_table_cont.
       MODULE UPDATE_DATA.
    endloop.
    MODULE USER_COMMAND_9001.
    PLZ let me know what might be the problem. I have been trying to figure out but cant.
    Thanks.

    Hi Sonali,
               When ever you need to do anything with the table control, i mean if u want to display data in table control or you want to validate the data entered in table control Should be done within Loop and Endloop.(PBO or PAI's which ever is appropriate)
    Here the data is not bieng displayed in ur table control because you have not used the MODULE fill_data  between
    LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
    ENDLOOP.
    so do it like this
    LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.
    MODULE fill_data 
    ENDLOOP.
    this will solve your problem.
    Regards,
    Syed

Maybe you are looking for

  • MBP WiFi issue after updating to 10.8.5

    I have a Macbook Pro late 2011 and used OS X 10.8.4. Last week installed Windows 7 with latest BootCamp. everythings was fine! Then I updated my Mac to newer version (10.8.5). Now WiFi just works on Windows and Mac does not find any WiFi networks. My

  • Is there a way to turn sync on and off? For security reasons...

    My car was broken into over the weekend and I was so happy my laptop wasn't in the trunk (as it usually is), but it made me start to wonder since I have sync setup on all 3 of my computers (2 towers 1 laptop), that if it had been taken they would hav

  • Java import statement problems

    Hello... I have the book "Java in a Nutshell, 2nd ed" and have a query about a nested top-level interface example they have in the book. Basically there's two files/classes. The first, LinkedList.java, is as follows: public class LinkedList {     pub

  • Output DV (firewire) or Output (DV)... are the same ???

    I must buy a digital video camera recorder of the Canon mark, on APPLE Store for example. Models presented on the site have a very precise denomination on the output of the signal. I see that models precise: output DV (Firewire - IEEE 1394). Others p

  • HT2506 cannot add a signature in preview???

    why is preview NOT allowing me to add another signature?  the '+' sign is highlighted, but nothing happens when clicked