Sunday, December 26, 2010
REPORT ztest_notepad.
TYPE-POOLS:icon.
DATA:
      BEGIN OF it_mara OCCURS 0,
        check TYPE char4,
        matnr TYPE mara-matnr,
        ersda TYPE mara-ersda,
      END OF it_mara.

DATA:str TYPE string.

START-OF-SELECTION.
  SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara UP TO 100 ROWS.
  LOOP AT it_mara.
    it_mara-check = '@T9@'. "code for empty checkbox
    WRITE:/ it_mara-check HOTSPOT ON,
    it_mara-matnr,
    it_mara-ersda.
    HIDE:it_mara-check,
    it_mara-matnr,
    it_mara-ersda.
  ENDLOOP.

AT LINE-SELECTION.
  it_mara-check = '@R7@'."Code for checked checkbox.
  MODIFY LINE sy-lilli FIELD VALUE it_mara-check.
  READ TABLE it_mara INDEX sy-lilli.
  IF sy-subrc EQ 0.
    str = sy-lilli.
    CONCATENATE 'Row no' str 'selected' INTO str SEPARATED BY space.
    MESSAGE str TYPE 'I'.
  ENDIF.

2 comments:

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.