How to stored data after clicking check box save in data base table

TABLES:mseg,mard,mkpf.
TYPE-POOLS:slis.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
               smatnr FOR mseg-matnr MODIF ID m2,
               swerks FOR mard-werks MODIF ID m3,
               slgort FOR mard-lgort MODIF ID m4,
               slgpbe FOR mard-lgpbe MODIF ID m5,
               scharg FOR mseg-charg MODIF ID m6,
               sbwart FOR mseg-bwart MODIF ID m7,
               skostl FOR mseg-kostl MODIF ID m8,
               saufnr FOR mseg-aufnr MODIF ID m9,
               srsnum FOR mseg-rsnum MODIF ID m10.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
           pse RADIOBUTTON GROUP radi,
           bps RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETER:layout TYPE i.
SELECTION-SCREEN END OF BLOCK b3.
DATA:BEGIN OF itab OCCURS 0,
     mblnr LIKE mseg-mblnr,
     matnr LIKE mseg-matnr,
     werks LIKE mard-werks,
     lgort LIKE mard-lgort,
     lgpbe LIKE mard-lgpbe,
     charg LIKE mseg-charg,
     bwart LIKE mseg-bwart,
     budat LIKE mkpf-budat,
     menge LIKE mseg-menge,
     meins LIKE mseg-meins,
     kostl LIKE mseg-kostl,
     aufnr LIKE mseg-aufnr,
     rsnum LIKE mseg-rsnum,
     checkbox TYPE c,
     END OF itab.
DATA:  gt_fieldcat TYPE slis_t_fieldcat_alv,
       gw_fieldcat TYPE slis_fieldcat_alv,
       gt_layout TYPE slis_layout_alv.
START-OF-SELECTION.
SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
    msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
INTO TABLE itab FROM
          mseg JOIN mard ON mardmatnr EQ msegmatnr
               JOIN mkpf ON msegmblnr EQ mkpfmblnr
               WHERE mseg~matnr IN smatnr.
  IF sy-subrc EQ 0.
    SORT itab BY matnr.
    PERFORM display_alv_output.
  ENDIF.
*&      Form  display_alv_output
      text
-->  p1        text
<--  p2        text
FORM display_alv_output.
  REFRESH gt_fieldcat.
  gw_fieldcat-fieldname = 'MBLNR'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 1.
  gw_fieldcat-seltext_m = 'material document'.
  gw_fieldcat-key = 'x'.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'MATNR'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 2.
  gw_fieldcat-seltext_m = 'material'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'WERKS'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 3.
  gw_fieldcat-seltext_m = 'plant'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'LGORT'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 4.
  gw_fieldcat-seltext_m = 'storage location'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'LGPBE'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 5.
  gw_fieldcat-seltext_m = 'storage bin'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'CHARG'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 6.
  gw_fieldcat-seltext_m = 'Batch number'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'BWART'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 7.
  gw_fieldcat-seltext_m = 'Movement Type (Inventory Management)'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'BUDAT'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 8.
  gw_fieldcat-seltext_m = 'Posting Date in the Document'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'MENGE'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 9.
  gw_fieldcat-seltext_m = 'QUANTITY'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'MEINS'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 10.
  gw_fieldcat-seltext_m = 'Basic unit of measure'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'KOSTL'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 11.
  gw_fieldcat-seltext_m = 'Cost center'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'AUFNR'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 12.
  gw_fieldcat-seltext_m = 'Order Number'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-fieldname = 'RSNUM'.
  gw_fieldcat-tabname = 'itab'.
  gw_fieldcat-col_pos = 13.
  gw_fieldcat-seltext_m = 'Number of Reservation / Depe'.
  gw_fieldcat-key = ' '.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
  gw_fieldcat-col_pos = 14.
  gw_fieldcat-fieldname = 'CHECKBOX'.
  gw_fieldcat-seltext_m = 'Compltd'.
  gw_fieldcat-checkbox = 'X'.
  gw_fieldcat-edit = 'X'.
  APPEND gw_fieldcat TO gt_fieldcat.
  CLEAR gw_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM                = 'ZREPORT'
    IS_LAYOUT                         = gt_layout
    IT_FIELDCAT                       = gt_fieldcat
   TABLES
     t_outtab                          = itab
  EXCEPTIONS
    PROGRAM_ERROR                     = 1
    OTHERS                            = 2.
ENDFORM.                    " display_alv_output
this is mycode .
send me replay.

Hi Lakshmi,
       Can u explain briefly what is ur requirement. U mean to say that after clicking the checkbox in data base table or Screen?
Regards,
  Jayaram...

Similar Messages

  • How to stored data after clicking checkbox  save in database table

    TYPE-pools: slis.
    tables:mkpf,mseg,mard,COWB_COMP.
    TYPES: BEGIN OF tp_data,
          mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         endkz like COWB_COMP-endkz,
    END OF tp_data,
    tp_tbl_data TYPE STANDARD TABLE OF tp_data.
    *data: t_data like ztable occurs 0 with header line.
    Constants
    Data objects (variable declarations and definitions)
    Report data to be shown.
    DATA: it_data TYPE STANDARD TABLE OF tp_data.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    ========================== Selection Screen ==========================
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    =========================== Event Blocks =============================
    AT selection-SCREEN.
    start-OF-selection.
    PERFORM get_data USING it_data.
    END-OF-selection.
    PERFORM build_alv USING it_data t_heading.
    =========================== Subroutines ==============================
    *&      Form  get_data
          Gets the information to be shown in the report.
    FORM get_data USING t_data TYPE tp_tbl_data.
      SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
      INTO CORRESPONDING FIELDS OF TABLE t_data
      FROM mseg
      JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
    ENDFORM.                    " get_data
    *&      Form  build_alv
          Builds and display the ALV Grid.
    FORM build_alv USING t_data TYPE tp_tbl_data
          t_heading  TYPE slis_t_listheader.
    ALV required data objects.
      DATA: w_title   TYPE lvc_title,
            w_comm    TYPE slis_formname,
            w_status  TYPE slis_formname,
            x_layout  TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
            t_fieldcat TYPE slis_t_fieldcat_alv,
            t_sort     TYPE slis_t_sortinfo_alv.
      REFRESH t_fieldcat.
      REFRESH t_event.
      REFRESH t_sort.
      CLEAR x_layout.
      CLEAR w_title.
    Field Catalog
      PERFORM set_fieldcat2 USING:
            1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space  t_fieldcat ,
            3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space  t_fieldcat,
            4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            7 'BWART' 'BWART' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            8 'BUDAT' 'BUDAT' 'MKPF' space  space space space space space space space space space space space t_fieldcat,
            9 'MENGE' 'MENGE' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            10 'MEINS' 'MEINS' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            11 'KOSTL' 'KOSTL' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            12 'AUFNR' 'AUFNR' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            13 'RSNUM' 'RSNUM' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
        14 'ENDKZ' 'ENDKZ' 'COWB_COMP' space space 'select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
    Layout
      x_layout-zebra = 'X'.
    Top of page heading
      PERFORM set_top_page_heading USING t_heading t_event.
    Events
      PERFORM set_events USING t_event.
    GUI Status
      w_status = ''.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
      PERFORM set_order USING 'MBLNR' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        it_fieldcat              = t_fieldcat
        is_layout                = x_layout
        it_sort                  = t_sort
        i_callback_pf_status_set = w_status
        i_callback_user_command  = w_comm
        i_save                   = 'X'
        it_events                = t_event
        i_grid_title             = w_title
      TABLES
        t_outtab                 = t_data
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
          t_events  TYPE slis_t_event.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Reporte Prueba'(001).
      APPEND x_heading TO t_heading.
    Program name
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Program: '.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-FORM = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    FORM set_events USING t_events TYPE slis_t_event.
      DATA: x_event   TYPE LINE OF slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    ENDFORM.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
          t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-UP = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
    FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-HOTSPOT = p_hotspot.
      wa_fieldcat-CHECKBOX = p_checkbox.
      wa_fieldcat-ICON = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF p_edit IS NOT INITIAL.
        wa_fieldcat-INPUT     = 'X'.
        wa_fieldcat-EDIT     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    =========================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        i_logo             = 'XXXXX'
        it_list_commentary = t_heading.
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
          rs_selfield TYPE slis_selfield.
    ENDFORM.                    "user_command
    this is my code, how to store data after clicking checkbox in databasetable,
    how to write that cide.
    plz send me code.

    hi!,
    use MODIFY to update data into the data base table.
    regards
    anjali

  • How to save data after clicking checkbox stored in databasetable

    TYPE-pools: slis.
    tables:mkpf,mseg,mard.
    TYPES: BEGIN OF tp_data,
          mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
      __mark,
    END OF tp_data,
    tp_tbl_data TYPE STANDARD TABLE OF tp_data.
    Constants
    Data objects (variable declarations and definitions)
    Report data to be shown.
    DATA: it_data TYPE STANDARD TABLE OF tp_data.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    ========================== Selection Screen ==========================
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    =========================== Event Blocks =============================
    AT selection-SCREEN.
    start-OF-selection.
    PERFORM get_data USING it_data.
    END-OF-selection.
    PERFORM build_alv USING it_data t_heading.
    =========================== Subroutines ==============================
    *&      Form  get_data
          Gets the information to be shown in the report.
    FORM get_data USING t_data TYPE tp_tbl_data.
      SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
      INTO CORRESPONDING FIELDS OF TABLE t_data
      FROM mseg
      JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
    ENDFORM.                    " get_data
    *&      Form  build_alv
          Builds and display the ALV Grid.
    FORM build_alv USING t_data TYPE tp_tbl_data
          t_heading  TYPE slis_t_listheader.
    ALV required data objects.
      DATA: w_title   TYPE lvc_title,
            w_comm    TYPE slis_formname,
            w_status  TYPE slis_formname,
            x_layout  TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
            t_fieldcat TYPE slis_t_fieldcat_alv,
            t_sort     TYPE slis_t_sortinfo_alv.
      REFRESH t_fieldcat.
      REFRESH t_event.
      REFRESH t_sort.
      CLEAR x_layout.
      CLEAR w_title.
    Field Catalog
      PERFORM set_fieldcat2 USING:
            1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space  t_fieldcat ,
            3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space  t_fieldcat,
            4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            7 'BWART' 'BWART' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            8 'BUDAT' 'BUDAT' 'MKPF' space  space space space space space space space space space space space t_fieldcat,
            9 'MENGE' 'MENGE' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            10 'MEINS' 'MEINS' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            11 'KOSTL' 'KOSTL' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            12 'AUFNR' 'AUFNR' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            13 'RSNUM' 'RSNUM' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            14 '__MARK' 'XFELD' space space space 'Select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
    Layout
      x_layout-zebra = 'X'.
    Top of page heading
      PERFORM set_top_page_heading USING t_heading t_event.
    Events
      PERFORM set_events USING t_event.
    GUI Status
      w_status = ''.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    PERFORM set_order USING 'LIFNR' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        it_fieldcat              = t_fieldcat
        is_layout                = x_layout
        it_sort                  = t_sort
        i_callback_pf_status_set = w_status
        i_callback_user_command  = w_comm
        i_save                   = 'X'
        it_events                = t_event
        i_grid_title             = w_title
      TABLES
        t_outtab                 = t_data
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
          t_events  TYPE slis_t_event.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Reporte Prueba'(001).
      APPEND x_heading TO t_heading.
    Program name
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Program: '.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-FORM = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    FORM set_events USING t_events TYPE slis_t_event.
      DATA: x_event   TYPE LINE OF slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    ENDFORM.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
          t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-UP = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
    FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-HOTSPOT = p_hotspot.
      wa_fieldcat-CHECKBOX = p_checkbox.
      wa_fieldcat-ICON = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF p_edit IS NOT INITIAL.
        wa_fieldcat-INPUT     = 'X'.
        wa_fieldcat-EDIT     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    =========================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        i_logo             = 'XXXXX'
        it_list_commentary = t_heading.
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
          rs_selfield TYPE slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         Set your "double click action" response here.
         Example code: Create and display a status message.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n.
         w_row = rs_selfield-tabindex.
         CONCATENATE 'You have clicked row' w_row
                     'field' rs_s lfield-fieldname
                     'with value' rs_selfield-value
                     INTO w_msg SEPARATED BY space.
         MESSAGE w_msg TYPE 'S'.
    ENDCASE.
    End of example code.
    ENDFORM.                    "user_command
    this is mycode,mblnr, matnr and checkbox both field had created in database table
    then save data after clicking checkbox data stored in database table,and next clickin checkboxes are no change. this my requirment.
    plz send me code .

    Try this
    In user_command form...
    LOOP AT IT_DATA.
    IF  CHECKBOX __MARK EQ 'X'.
    write logic wht u want....
    ENDIF.
    ENDLOOP.

  • How to add check boxes on plant data /storage tab of MM01/02/03 transaction

    Hello experts,
    I want to add check boxes on plant data /storage tab of MM01/02/03 transaction.
    How can we achieve this?
    Thanks for your help in advance!

    Hi Shriram Nimbolkar ,
    Go to tranx code : MM01 /MM02 / MM03
    1 ) System-->Status , here copy the program
    2) Go to abap editor ,specify the program name and copy the package
    3) Go to CMOD or SMOD
          CMOD>Utilites-> SAP Enanchements, Here specify the package and execute it..
      4) Displays multiple exists,
          check the suitable exists and insert the code in particular screen...
    Reg
    Siva Prasad

  • . How to put Check box in every row in Table

    Hi Friends,
    I have one doubt in Webdynpro with java. How to put Check box in every row in Table?
    For Exam My requirement is I am getting BAPI from ECC System. So I have to go given input details in first view and output details in SecondView. So in Second View I will taken Table that data will displayed in rows. I need each and every row first I need check box.
    Here Select Check Box of particular row then click GetData button.  That row data will be displayed in one popup window.
    In table suppose 6 rows available in table. Every Row first Check box available.
                             empid, name, sal  ,firstname, last Name
                             empid, name, sal  ,firstname, last Name
                             empid, name, sal  ,firstname, last Name 
    How to put Check box in every row in Table?  can you send any examples applications
    Regards
    Vijay

    Hi Friend,
    When we are getting BAPI From ECC System. that BAPI Have nodes and Attribues...in under node we can't create "CheckBox"
    attribute.
    So i am doing like this.I am create on Checbox attribue out side of Node. Check Box data type is boolean.
    next i am creating table ( that table having rows and columns) Right click on table-->Click on Insert GroupedColumn->again right click on nsert GroupedColumn---> Here Select Check Box.
    Okay...here i am getting one problem. i have got Check boxes .But i am select check box in  first row. that time all check boxes will be selected.
    i need select first row check box that only first row will be selected suppose i selected second row check box that only second will be selected.
    i need this can u help me....
    Regards
    Vijay

  • How to deactivate button after click??

    hello experts,
    how to deactivate button after click???
    there are 2 buttons
    Download | Add
    now if i click on download the download button should get deactive.....n  Add button position should not change..
    thanks in advance.

    Hi,
    1. Declare an internal table of type sy-ucomm. i.e.
    DATA : it_fcode TYPE TABLE OF sy-ucomm.
    2. Append Function Codes of the options in the Menu that you want to deactivate to the above declared internal table. For e.g. If DWL & ADD are the Function Codes of options that need to be deactivated then,
    APPEND 'DWL' TO it_fcode.
    APPEND 'ADD' TO it_fcode.
    3. Set PF_-Status as shown below.
    SET PF-STATUS 'status_name' EXCLUDING it_fcode.
    4. Now, the options in the menu bar with Function Codes 'DWL' & 'ADD' will be deactivated.
    aRs
    pOINTS ARE ALWAYS WELCOME

  • How to validate that only one check box is checked in detail block

    Hi All,
    I am using oracle Forms 10G on windows.
    I need help on how to validate that only one check box is checked in detail block. I have multiple records in the detail block and I have check boxes for each record in the detail block.
    I have a button to select the values from the detail records where the check box is checked. But I want to make sure that only one record is check not more than one.
    How do I validate this on a push button trigger?
    Thanks

    When I've done this kind of thing, I create a Form level variable of TYPE number and then add or subtract to this variable as I check and uncheck the checkboxes. If the value of the variable is 1, then you know that only one checkbox is selected. If the value is greater than 1, then you know the user has selected more than one check box. You could also add code to your When-Checkbox-Changed trigger to test the variable and instruct the user to un-check selected record before selecing a new record.
    With respect to the Form level variable, you can use a GLOBAL, PARAMETER or Program Unit package specification. I prefer to use the PU Package Spec as this method has a smaller memory footprint. For example, in the Program Unit node of the object navigator create the following;
    /* Form variables package spec */
    PACKAGE Form_Vars IS
      CheckBox_Cnt     NUMBER := 0;
    END;Now in your When-Checkbox-Changed trigger...
    BEGIN
       IF ( Form_Vars.CheckBox_Cnt = 0 ) THEN
          Form_Vars.CheckBox_Cnt  := Form_Vars.CheckBox_Cnt  + 1;
       ELSE
          /* it's assumed the value is greater than 0 */
          Message('Please uncheck selec ted record before choosing a new record.');
          RAISE Form_Trigger_Failure;
       END IF;
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Feb 3, 2011 10:15 AM

  • Re: Retrieving data from the check box group.....

    Hi all,
    I am new to webdynpro Java. I'm facing a problem while retrieving data from the check box group..
    I've taken a simple type "Status" and Node with value attribute named status and set the property of that attribute as the simple type. This attribute is bound to the checkboxgroup.The cardinality of the Node is 0..n
    But i am unable to read the checked items of the group.
    Please help me out in solving my problem........

    Hi,
    Use the following
    for (int x=0; x< wdContext.nodeTest().size(); x++)
         if( wdContext.nodeTest().isMultiSelected(x) )
                     // Selected Element
              IWDNodeElement nodeElement = wdContext.nodeTest().getElementAt(x);
               nodeElement.setAttributeValue("<Your Attribute> ", <Value>);
              //Ex setting value for attribute called Name
              nodeElement.setAttributeValue("Name", "Test");
    Regards
    Ayyapparaj

  • How to set uncheck in Bidder check box in T-Code "BBPMAININT"

    Hi All,
    Could any body help me by providing the information "How to set uncheck in Bidder check box in T-Code "BBPMAININT". I search all the BADI and EXIT but didn't get.
        My problem is that, I want to uncheck "BIDDER" check box for Vendor whose account group is "ZORD" in transaction "BBPMAININT". I checked all the BADI and Exit but didn't get.
    Regards
    Sanjay

    Hi
    Which SRM version are you using ? Please elabore your requirments in more details in the next reply.
    <b>Meanwhile, please try the following SAP OSS Notes -></b>
    Note 512218 - Ext. partner maintenance: checkbox problems
    Note 455440 - Ext. partners without contact person: Checkbox problem
    Note 585126 Correction of Section508 implementation
    528367 Multiple company: Evaluated receipt settlement
    527097 BBPMAININT: 'Undo All' not complete
    361829 EBP (BBP2.0C): Business partner <-> vendor mapping
    Note 357201 BBP 2.0B: Business partner <--> vendor mapping
    Note 355506 Ext. no. assignment when creating business partners
    Do let me know.
    Regards
    - Atul

  • How to count the number of text boxes that are data entered

    How to count the number of text boxes that are data entered in visual basic form.

    Here is an Iterator that expands on my previous response:
    ''' <summary>
    ''' Iterator for form controls
    ''' </summary>
    ''' <param name="onlyControlsOfType">specify type if a certain type of controls needed</param>
    ''' <param name="onlyTopLevel">if true don't search containers within the form</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Iterator Function AllControls(Optional onlyControlsOfType As Type = Nothing, _
    Optional onlyTopLevel As Boolean = False) As IEnumerable(Of Control)
    Dim ctrl As Control = Me.GetNextControl(Me, True)
    Do Until ctrl Is Nothing
    If onlyControlsOfType Is Nothing OrElse ctrl.GetType = onlyControlsOfType Then
    If TypeOf ctrl.Parent Is Form OrElse Not onlyTopLevel Then
    Yield ctrl
    End If
    End If
    ctrl = Me.GetNextControl(ctrl, True)
    Loop
    End Function
    Some sample uses:
    For Each
    For Each c As Control In AllControls()
    Debug.WriteLine(c.Name)
    Next
    List of all controls, including controls in containers i.e. Groupbox
    Dim l As List(Of Control) = AllControls().ToList
    List of all Textbox controls, including Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox)).ToList
    List of all Textbox controls, don't include Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox), True).ToList
    'Those who use Application.DoEvents() have no idea what it does and those who know what it does never use it.'  JohnWein
    Multics
    My Serial Port Answer

  • Do not use iOS 7. Attempting to install iOS 7 will cause your phone to require a factory reset, thus wiping all your data from the device. Save your data, do not attempt to install the new iOS 7.

    Do not use iOS 7. Attempting to install iOS 7 will cause your phone to require a factory reset, thus wiping all your data from the device. Save your data, do not attempt to install the new iOS 7.

    My phone has been in the Preparaing Iphone for Restore mode for over 2 hrs. I have the following on the itunes page
                Iphone Recovery Mode
              Itunes is restoring the software on this Iphone. 
    I have the Itunes icon and the USB cord display on the iphone home screen
    So I still have 3 hrs to go???  WOW

  • How to stored data after clicking checkbox in data base table

    REPORT  ZT                                      .
    TYPE-pools: slis.
    tables:mkpf,mseg,mard,COWB_COMP,ZTABLE.
    Types:BEGIN OF tp_data,
         mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         endkz like COWB_COMP-endkz,
    END OF tp_data,
    tp_tbl_data TYPE STANDARD TABLE OF tp_data.
    MODIFIED*******************
    DATA: WA TYPE TP_DATA.
    MODIFIED*******************
    *data: t_data like Y00_MM_ISSUE_DAT occurs 0 with header line.
    Constants
    Data objects (variable declarations and definitions)
    Report data to be shown.
    DATA: it_data TYPE STANDARD TABLE OF tp_data.
    MODIFIED*******************
    DATA : V_REPID LIKE SY-REPID.
    MODIFIED*******************
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    *========================== Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                  smatnr FOR mseg-matnr MODIF ID m2,
                  swerks FOR mard-werks MODIF ID m3,
                  slgort FOR mard-lgort MODIF ID m4,
                  slgpbe FOR mard-lgpbe MODIF ID m5,
                  scharg FOR mseg-charg MODIF ID m6,
                  sbwart FOR mseg-bwart MODIF ID m7,
                  skostl FOR mseg-kostl MODIF ID m8,
                  saufnr FOR mseg-aufnr MODIF ID m9,
                  srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
              pse RADIOBUTTON GROUP radi,
              bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    MODIFIED*******************
    INITIALIZATION.
    V_REPID = sy-repid.
    MODIFIED*******************
    *=========================== Event Blocks
    AT selection-SCREEN.
    start-OF-selection.
    PERFORM get_data USING it_data.
    END-OF-selection.
    PERFORM build_alv USING it_data t_heading.
    *=========================== Subroutines
    *&      Form  get_data
          Gets the information to be shown in the report.
    FORM get_data USING t_data TYPE tp_tbl_data.
    SELECT msegmblnr msegmatnr mardwerks mardlgort mard~lgpbe
    msegcharg msegbwart mkpf~budat
       msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
    INTO CORRESPONDING FIELDS OF TABLE t_data
    FROM mseg
    JOIN mard ON mardmatnr EQ msegmatnr
                  JOIN mkpf ON msegmblnr EQ mkpfmblnr
                  WHERE mseg~matnr IN smatnr.
    ENDFORM.                    " get_data
    *&      Form  build_alv
          Builds and display the ALV Grid.
    FORM build_alv USING t_data TYPE tp_tbl_data
         t_heading  TYPE slis_t_listheader.
    ALV required data objects.
    DATA: w_title   TYPE lvc_title,
           w_comm    TYPE slis_formname,
           w_status  TYPE slis_formname,
           x_layout  TYPE slis_layout_alv,
           t_event    TYPE slis_t_event,
           t_fieldcat TYPE slis_t_fieldcat_alv,
           t_sort     TYPE slis_t_sortinfo_alv.
    REFRESH t_fieldcat.
    REFRESH t_event.
    REFRESH t_sort.
    CLEAR x_layout.
    CLEAR w_title.
    Field Catalog
    PERFORM set_fieldcat2 USING:
           1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space
    space space space space space space t_fieldcat ,
           2 'MATNR' 'MATNR' 'MSEG' space space space space space space
    space space space space space space  t_fieldcat ,
           3 'WERKS' 'WERKS' 'MARD' space space space space space space
    space space space space space space  t_fieldcat,
           4 'LGORT' 'LGORT' 'MARD' space space space space space space
    space space space space space space t_fieldcat ,
           5 'LGPBE' 'LGPBE' 'MARD' space space space space space space
    space space space space space space t_fieldcat ,
           6 'CHARG' 'CHARG' 'MSEG' space space space space space space
    space space space space space space t_fieldcat ,
           7 'BWART' 'BWART' 'MSEG' space  space space space space space
    space space space space space space t_fieldcat,
           8 'BUDAT' 'BUDAT' 'MKPF' space  space space space space space
    space space space space space space t_fieldcat,
           9 'MENGE' 'MENGE' 'MSEG' space  space space space space space
    space space space space space space t_fieldcat,
           10 'MEINS' 'MEINS' 'MSEG' space  space space space space space
    space space space space space space t_fieldcat,
           11 'KOSTL' 'KOSTL' 'MSEG' space  space space space space space
    space space space space space space t_fieldcat,
           12 'AUFNR' 'AUFNR' 'MSEG' space  space space space space space
    space space space space space space t_fieldcat,
           13 'RSNUM' 'RSNUM' 'MSEG' space  space space space space space
    space space space space space space t_fieldcat,
       14 'ENDKZ' 'ENDKZ' 'COWB_COMP' space space 'select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
    Layout
    x_layout-zebra = 'X'.
    Top of page heading
    PERFORM set_top_page_heading USING t_heading t_event.
    Events
    PERFORM set_events USING t_event.
    GUI Status
    w_status = ''.
    User commands
    w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    PERFORM set_order USING 'MBLNR' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program       = V_REPID
       it_fieldcat              = t_fieldcat
       is_layout                = x_layout
       it_sort                  = t_sort
       i_callback_pf_status_set = w_status
       i_callback_user_command  = w_comm
       i_save                   = 'X'
       it_events                = t_event
       i_grid_title             = w_title
    TABLES
       t_outtab                 = t_data
    EXCEPTIONS
       program_error            = 1
       OTHERS                   = 2.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDFORM.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
         t_events  TYPE slis_t_event.
    DATA: x_heading TYPE slis_listheader,
           x_event   TYPE LINE OF slis_t_event.
    Report title
    CLEAR t_heading[].
    CLEAR x_heading.
    x_heading-typ = 'H'.
    x_heading-info = 'Reporte Prueba'(001).
    APPEND x_heading TO t_heading.
    Program name
    CLEAR x_heading.
    x_heading-typ = 'S'.
    x_heading-KEY = 'Program: '.
    x_heading-info = sy-repid.
    APPEND x_heading TO t_heading.
    User who is running the report
    CLEAR x_heading.
    x_heading-typ = 'S'.
    x_heading-KEY = 'User: '.
    x_heading-info = sy-uname.
    APPEND x_heading TO t_heading.
    Date of execution
    CLEAR x_heading.
    x_heading-typ = 'S'.
    x_heading-KEY = 'Date: '.
    WRITE sy-datum TO x_heading-info.
    APPEND x_heading TO t_heading.
    Time of execution
    CLEAR x_heading.
    x_heading-typ = 'S'.
    x_heading-KEY = 'Time: '.
    WRITE sy-uzeit TO x_heading-info.
    APPEND x_heading TO t_heading.
    Top of page event
    x_event-name = slis_ev_top_of_page.
    x_event-FORM = 'TOP_OF_PAGE'.
    APPEND x_event TO t_events.
    ENDFORM.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    FORM set_events USING t_events TYPE slis_t_event.
    DATA: x_event   TYPE LINE OF slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    ENDFORM.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
         t_sort TYPE slis_t_sortinfo_alv.
    DATA: x_sort TYPE slis_sortinfo_alv.
    CLEAR x_sort.
    x_sort-fieldname = p_fieldname.
    x_sort-tabname   = p_tabname.
    x_sort-UP = p_up.
    x_sort-down = p_down.
    x_sort-subtot = p_subtot.
    APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
    FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname
    p_ref_tabname
         p_outputlen p_noout
         p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
         p_hotspot p_showasicon p_checkbox p_edit
         p_dosum
         t_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: wa_fieldcat TYPE slis_fieldcat_alv.
    CLEAR wa_fieldcat.
    General settings
    wa_fieldcat-fieldname = p_fieldname.
    wa_fieldcat-col_pos = p_colpos.
    wa_fieldcat-no_out = p_noout.
    wa_fieldcat-HOTSPOT = p_hotspot.
    wa_fieldcat-CHECKBOX = p_checkbox.
    wa_fieldcat-ICON = p_showasicon.
    wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given is a data
    *element.
    If p_ref_tabname is given, the ref_fieldname given is a field of a
    *table. In case ref_fieldname is not given, it is copied from the
    *fieldname.
    IF p_ref_tabname IS INITIAL.
       wa_fieldcat-rollname =   p_ref_fieldname.
    ELSE.
       wa_fieldcat-ref_tabname = p_ref_tabname.
       IF p_ref_fieldname EQ space.
         wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
       ELSE.
         wa_fieldcat-ref_fieldname =   p_ref_fieldname.
       ENDIF.
    ENDIF.
    Set output length.
    IF NOT p_outputlen IS INITIAL.
       wa_fieldcat-outputlen = p_outputlen.
    ENDIF.
    Set text headers.
    IF NOT p_seltext_m IS INITIAL.
       wa_fieldcat-seltext_m = p_seltext_m.
    ENDIF.
    IF NOT p_seltext_l IS INITIAL.
       wa_fieldcat-seltext_l = p_seltext_l.
    ENDIF.
    IF NOT p_seltext_s IS INITIAL.
       wa_fieldcat-seltext_s = p_seltext_s.
    ENDIF.
    IF NOT p_reptext_ddic IS INITIAL.
       wa_fieldcat-reptext_ddic = p_reptext_ddic.
    ENDIF.
    IF NOT p_ddictxt IS INITIAL.
       wa_fieldcat-ddictxt = p_ddictxt.
    ENDIF.
    Set as editable or not.
    IF NOT p_edit IS  INITIAL.
       wa_fieldcat-INPUT     = 'X'.
       wa_fieldcat-EDIT     = 'X'.
    ENDIF.
    APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
         i_logo             = 'TRVPICTURE04'
       it_list_commentary = t_heading.
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
         rs_selfield TYPE slis_selfield.
    case sy-ucomm.
    WHEN '&DATA_SAVE'.
    LOOP AT IT_DATA INTO WA WHERE ENDKZ = 'X'.
       IF WA-ENDKZ = 'X'.
    *******MODIFIED*********************************
    U DELETE THIS CODE N USER UR INSERT CODE TO CHECK
    SY-MSGV1 = WA-MBLNR.                              " U CAN DELETE
    SY-MSGV2 = WA-MATNR.                              " U CAN DELETE
    MESSAGE ID 'BC_BOR' TYPE 'I' NUMBER '888'          " U CAN DELETE
            WITH SY-MSGV1 SY-MSGV2. " U CAN DELETE
    *******MODIFIED*********************************
       INSERT ZTABLE.
       ENDIF.
    endloop.
    ENDCASE.
    ENDFORM.                    "user_command
    this is my code, database will stored in fields only.data is empty,
    how to slove that one,send any sugestion.

    Hi Lakshmi,
           Can u explain briefly what is ur requirement. U mean to say that after clicking the checkbox in data base table or Screen?
    Regards,
      Jayaram...

  • How to save data after clicking checkbox  stored in database table

    TYPE-pools: slis.
    tables:mkpf,mseg,mard.
    TYPES: BEGIN OF tp_data,
          mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
      __mark,
    END OF tp_data,
    tp_tbl_data TYPE STANDARD TABLE OF tp_data.
    Constants
    Data objects (variable declarations and definitions)
    Report data to be shown.
    DATA: it_data TYPE STANDARD TABLE OF tp_data.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    ========================== Selection Screen ==========================
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    =========================== Event Blocks =============================
    AT selection-SCREEN.
    start-OF-selection.
    PERFORM get_data USING it_data.
    END-OF-selection.
    PERFORM build_alv USING it_data t_heading.
    =========================== Subroutines ==============================
    *&      Form  get_data
          Gets the information to be shown in the report.
    FORM get_data USING t_data TYPE tp_tbl_data.
      SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
      INTO CORRESPONDING FIELDS OF TABLE t_data
      FROM mseg
      JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
    ENDFORM.                    " get_data
    *&      Form  build_alv
          Builds and display the ALV Grid.
    FORM build_alv USING t_data TYPE tp_tbl_data
          t_heading  TYPE slis_t_listheader.
    ALV required data objects.
      DATA: w_title   TYPE lvc_title,
            w_comm    TYPE slis_formname,
            w_status  TYPE slis_formname,
            x_layout  TYPE slis_layout_alv,
            t_event    TYPE slis_t_event,
            t_fieldcat TYPE slis_t_fieldcat_alv,
            t_sort     TYPE slis_t_sortinfo_alv.
      REFRESH t_fieldcat.
      REFRESH t_event.
      REFRESH t_sort.
      CLEAR x_layout.
      CLEAR w_title.
    Field Catalog
      PERFORM set_fieldcat2 USING:
            1 'MBLNR' 'MBLNR' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            2 'MATNR' 'MATNR' 'MSEG' space space space space space space space space space space space space  t_fieldcat ,
            3 'WERKS' 'WERKS' 'MARD' space space space space space space space space space space space space  t_fieldcat,
            4 'LGORT' 'LGORT' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            5 'LGPBE' 'LGPBE' 'MARD' space space space space space space space space space space space space t_fieldcat ,
            6 'CHARG' 'CHARG' 'MSEG' space space space space space space space space space space space space t_fieldcat ,
            7 'BWART' 'BWART' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            8 'BUDAT' 'BUDAT' 'MKPF' space  space space space space space space space space space space space t_fieldcat,
            9 'MENGE' 'MENGE' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            10 'MEINS' 'MEINS' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            11 'KOSTL' 'KOSTL' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            12 'AUFNR' 'AUFNR' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            13 'RSNUM' 'RSNUM' 'MSEG' space  space space space space space space space space space space space t_fieldcat,
            14 '__MARK' 'XFELD' space space space 'Select' 'Select this row' 'Sel' 'Select this row' space space space 'X' 'X' space t_fieldcat.
    Layout
      x_layout-zebra = 'X'.
    Top of page heading
      PERFORM set_top_page_heading USING t_heading t_event.
    Events
      PERFORM set_events USING t_event.
    GUI Status
      w_status = ''.
    User commands
      w_comm   = 'USER_COMMAND'.
    Order
    Example
    PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
    PERFORM set_order USING 'LIFNR' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELN' 'IT_DATA' 'X' space 'X' t_sort.
    PERFORM set_order USING 'EBELP' 'IT_DATA' 'X' space space t_sort.
    Displays the ALV grid
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        it_fieldcat              = t_fieldcat
        is_layout                = x_layout
        it_sort                  = t_sort
        i_callback_pf_status_set = w_status
        i_callback_user_command  = w_comm
        i_save                   = 'X'
        it_events                = t_event
        i_grid_title             = w_title
      TABLES
        t_outtab                 = t_data
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " build_alv.
    *&      Form  set_top_page_heading
          Creates the report headings.
    FORM set_top_page_heading USING t_heading TYPE slis_t_listheader
          t_events  TYPE slis_t_event.
      DATA: x_heading TYPE slis_listheader,
            x_event   TYPE LINE OF slis_t_event.
    Report title
      CLEAR t_heading[].
      CLEAR x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'Reporte Prueba'(001).
      APPEND x_heading TO t_heading.
    Program name
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Program: '.
      x_heading-info = sy-repid.
      APPEND x_heading TO t_heading.
    User who is running the report
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'User: '.
      x_heading-info = sy-uname.
      APPEND x_heading TO t_heading.
    Date of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Date: '.
      WRITE sy-datum TO x_heading-info.
      APPEND x_heading TO t_heading.
    Time of execution
      CLEAR x_heading.
      x_heading-typ = 'S'.
      x_heading-KEY = 'Time: '.
      WRITE sy-uzeit TO x_heading-info.
      APPEND x_heading TO t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-FORM = 'TOP_OF_PAGE'.
      APPEND x_event TO t_events.
    ENDFORM.
    *&      Form  set_events
          Sets the events for ALV.
          The TOP_OF_PAGE event is alredy being registered in
          the set_top_page_heading subroutine.
    FORM set_events USING t_events TYPE slis_t_event.
      DATA: x_event   TYPE LINE OF slis_t_event.
    Example
    clear x_event.
    x_event-name = .
    x_event-form = .
    append x_event to t_event.
    ENDFORM.
    *&      Form  set_order
          Adds an entry to the order table.
    FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
          t_sort TYPE slis_t_sortinfo_alv.
      DATA: x_sort TYPE slis_sortinfo_alv.
      CLEAR x_sort.
      x_sort-fieldname = p_fieldname.
      x_sort-tabname   = p_tabname.
      x_sort-UP = p_up.
      x_sort-down = p_down.
      x_sort-subtot = p_subtot.
      APPEND x_sort TO t_sort.
    ENDFORM.                    "set_order
    *&      Form  set_fieldcat2
          Adds an entry to the field catalog.
    FORM set_fieldcat2 USING p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-HOTSPOT = p_hotspot.
      wa_fieldcat-CHECKBOX = p_checkbox.
      wa_fieldcat-ICON = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set reference fieldname, tablenam and rollname.
    If p_ref_tabname is not given, the ref_fieldname given is a data element.
    If p_ref_tabname is given, the ref_fieldname given is a field of a table. In case ref_fieldname is not given, it is copied from the fieldname.
      IF p_ref_tabname IS INITIAL.
        wa_fieldcat-rollname =   p_ref_fieldname.
      ELSE.
        wa_fieldcat-ref_tabname = p_ref_tabname.
        IF p_ref_fieldname EQ space.
          wa_fieldcat-ref_fieldname =   wa_fieldcat-fieldname.
        ELSE.
          wa_fieldcat-ref_fieldname =   p_ref_fieldname.
        ENDIF.
      ENDIF.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
      IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
      ENDIF.
      IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
      ENDIF.
      IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
      ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
      IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
      ENDIF.
    Set as editable or not.
      IF p_edit IS NOT INITIAL.
        wa_fieldcat-INPUT     = 'X'.
        wa_fieldcat-EDIT     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    =========================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        i_logo             = 'XXXXX'
        it_list_commentary = t_heading.
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          Called on user_command ALV event.
          Executes custom commands.
    FORM user_command USING r_ucomm     LIKE sy-ucomm
          rs_selfield TYPE slis_selfield.
    Example Code
    Executes a command considering the sy-ucomm.
    CASE r_ucomm.
       WHEN '&IC1'.
         Set your "double click action" response here.
         Example code: Create and display a status message.
         DATA: w_msg TYPE string,
               w_row(4) TYPE n.
         w_row = rs_selfield-tabindex.
         CONCATENATE 'You have clicked row' w_row
                     'field' rs_s lfield-fieldname
                     'with value' rs_selfield-value
                     INTO w_msg SEPARATED BY space.
         MESSAGE w_msg TYPE 'S'.
    ENDCASE.
    End of example code.
    LOOP AT T_DATA.
    IF  it_data-__MARK EQ 'X'.
    insert ztable.
    ENDIF.
    ENDLOOP.
    ENDFORM.                    "user_command
    ur sending code loop is error ,plz check that one  after checking send me

    Hi,
    After displaying ALV report output, if you want to update database table based on your selected record, then use the below logic in your User_command subroutine.
    You will get the index of the selected record in rs_selfield-tabindex. using this index read the respective record from the internal table and move corresponding field to the table fields and then update.
    data : wa_data like t_data.
    read table t_data index rs_selfield-tabindex into wa_data.
    if sy-subrc = 0.
       move-corresponding wa_data to ztable.
       insert ztable.
    endif.
    thanks,
    sksingh

  • How to stored data after clicking checkbox save in data base table

    REPORT  zreport                                 .
    TABLES:mseg,mard,mkpf.
    TYPE-POOLS:slis.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:smblnr FOR mseg-mblnr MODIF ID m1,
                   smatnr FOR mseg-matnr MODIF ID m2,
                   swerks FOR mard-werks MODIF ID m3,
                   slgort FOR mard-lgort MODIF ID m4,
                   slgpbe FOR mard-lgpbe MODIF ID m5,
                   scharg FOR mseg-charg MODIF ID m6,
                   sbwart FOR mseg-bwart MODIF ID m7,
                   skostl FOR mseg-kostl MODIF ID m8,
                   saufnr FOR mseg-aufnr MODIF ID m9,
                   srsnum FOR mseg-rsnum MODIF ID m10.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS:pre RADIOBUTTON GROUP radi USER-COMMAND ucomm DEFAULT 'X',
               pse RADIOBUTTON GROUP radi,
               bps RADIOBUTTON GROUP radi.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETER:layout TYPE i.
    SELECTION-SCREEN END OF BLOCK b3.
    DATA:BEGIN OF itab OCCURS 0,
         mblnr LIKE mseg-mblnr,
         matnr LIKE mseg-matnr,
         werks LIKE mard-werks,
         lgort LIKE mard-lgort,
         lgpbe LIKE mard-lgpbe,
         charg LIKE mseg-charg,
         bwart LIKE mseg-bwart,
         budat LIKE mkpf-budat,
         menge LIKE mseg-menge,
         meins LIKE mseg-meins,
         kostl LIKE mseg-kostl,
         aufnr LIKE mseg-aufnr,
         rsnum LIKE mseg-rsnum,
         checkbox TYPE c,
         END OF itab.
    DATA:  gt_fieldcat TYPE slis_t_fieldcat_alv,
           gw_fieldcat TYPE slis_fieldcat_alv,
           gt_layout TYPE slis_layout_alv.
    START-OF-SELECTION.
    SELECT msegmblnr msegmatnr mardwerks mardlgort mardlgpbe msegcharg msegbwart mkpfbudat
        msegmenge  msegmeins msegkostl msegaufnr mseg~rsnum
    INTO TABLE itab FROM
              mseg JOIN mard ON mardmatnr EQ msegmatnr
                   JOIN mkpf ON msegmblnr EQ mkpfmblnr
                   WHERE mseg~matnr IN smatnr.
      IF sy-subrc EQ 0.
        SORT itab BY matnr.
        PERFORM display_alv_output.
      ENDIF.
    *&      Form  display_alv_output
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv_output.
      REFRESH gt_fieldcat.
      gw_fieldcat-fieldname = 'MBLNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 1.
      gw_fieldcat-seltext_m = 'material document'.
      gw_fieldcat-key = 'x'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MATNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 2.
      gw_fieldcat-seltext_m = 'material'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'WERKS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 3.
      gw_fieldcat-seltext_m = 'plant'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGORT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 4.
      gw_fieldcat-seltext_m = 'storage location'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'LGPBE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 5.
      gw_fieldcat-seltext_m = 'storage bin'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'CHARG'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 6.
      gw_fieldcat-seltext_m = 'Batch number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BWART'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 7.
      gw_fieldcat-seltext_m = 'Movement Type (Inventory Management)'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'BUDAT'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 8.
      gw_fieldcat-seltext_m = 'Posting Date in the Document'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MENGE'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 9.
      gw_fieldcat-seltext_m = 'QUANTITY'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'MEINS'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 10.
      gw_fieldcat-seltext_m = 'Basic unit of measure'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'KOSTL'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 11.
      gw_fieldcat-seltext_m = 'Cost center'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'AUFNR'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 12.
      gw_fieldcat-seltext_m = 'Order Number'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-fieldname = 'RSNUM'.
      gw_fieldcat-tabname = 'itab'.
      gw_fieldcat-col_pos = 13.
      gw_fieldcat-seltext_m = 'Number of Reservation / Depe'.
      gw_fieldcat-key = ' '.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
      gw_fieldcat-col_pos = 14.
      gw_fieldcat-fieldname = 'CHECKBOX'.
      gw_fieldcat-seltext_m = 'Compltd'.
      gw_fieldcat-checkbox = 'X'.
      gw_fieldcat-edit = 'X'.
      APPEND gw_fieldcat TO gt_fieldcat.
      CLEAR gw_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = 'ZREPORT'
        I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = gt_layout
        IT_FIELDCAT                       = gt_fieldcat
       TABLES
         t_outtab                          = itab
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2.
    ENDFORM.                    " display_alv_output
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
    P_SELFLD TYPE SLIS_SELFIELD.
    set pf-stATUS 'YSTATUS'.
    case p_ucomm.
    when 'SAVE'.
    Data ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = ref1.
    call method ref1->check_changed_data.
    Here you wil have the table with updated data
    itab2[] = itab[].
    delete itab where checkbox = space. "Mark is the field for the checkbox
    modify ztable from table itab.
    endcase.
    ENDFORM.
    use loop dump error is came.
    another solutions plz send me
    this is mycode.

    Hi Lakshmi,
    You please give me some more information related to your problem instead of pasting the total code here
    Warm Regards,
    Vijay

  • Help requested: How to pass the (check box) selected rows data to other scr

    Hi friends, Here is a situation where I have to pick only those records data which i select by checking the check boxes and carry on to next screen where I have to display them and do some processing on such selected rows of data. Can any one suggest me how to code this. Thanks in advance.

    Hi Subbarao,
    One way is to check if the field is selected by checking if the field value = 'X'.
    If it is a table control we will have to loop and find out which all records are selected..it is notable that the check box field will mostly be of single character and contain 'X' if it is checked and space if not checked
    Based on the structure where the check box is held we may have to implement various logic to retrieve whether the field is checked or not....for instance we can move data to another internal table for which the checkbox is checked and can retrieve it from the next screen
    Pls check,revert and reward if helpful
    Regards
    Byju

Maybe you are looking for

  • If I purchased apps with one Itunes account (hotmail) can I convert the apps to an Itunes (ME) account?

    I purchased apps with one Itunes account (hotmail).  I then changed my account sign-in to a different email sign-in (ME) because of iCloud.  Can I easily convert the apps to an Itunes (ME) account when an update for each app occurrs?

  • LCES 8.2 Turnkey Install on "Intel Core i7  CPU 920 @2.67GHz 3GB Ram  Windows Vista Home 64 bit"

    Installed Java 1.5 SE (jdk-1_5_0_16-windows-amd64.exe) then set JAVA_HOME in system variable and set path to JAVA_HOME\bin etc. During the Turnkey installation process in the LC Configuration Manager screen, process gets stuck with ACL-LCM-999-032 er

  • Background encoding question

    Still trying to figure out why I'm suddenly not able to burn an 8.5 minute movie after 14 hours of waiting........then I noticed that when I select certain themes, I get a status bar for both the movie & the theme in the background encoding section o

  • Acrobat 8.1.3 bug take 2

    I had an issue a few weeks back that wouldn't allow me to copy and paste anything. Upon my IT's departments failure to find a fix for the issue, my computer was re-imaged. Everything has been going well until this morning when Acrobat Pro updated to

  • Problem restoring files from a Time Machine Backup! HELP!

    Heya, I have Snow Leopard and have been using Time Macine regularly since May.... I never needed to restore any file until now... Deleted some must have stuff.. and emtird the trash (of course!).. so went to time machine to restore it... Looked it up