Skip to Content
avatar image
Former Member

check box in report display

hi

i had an req to show a check box in final display list,please tell me how to show it,through itab in output.

my req it like,to display futher data for the records selectes with check box.

regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Aug 12, 2008 at 08:42 AM

    Hi,

    Check this Program.

    TABLES:mara.
    SELECT-OPTIONS:s_matnr FOR mara-matnr.
    DATA:it_mara LIKE mara OCCURS 0 WITH HEADER LINE.
    DATA:it_marc LIKE marc OCCURS 0 WITH HEADER LINE.
    DATA:BEGIN OF IT_REQDATA OCCURS 0,
         MATNR LIKE MARA-MATNR,
         END OF IT_REQDATA.
    DATA:a_check.
     
    START-OF-SELECTION.
      PERFORM get_mara.
      PERFORM disp_mara.
     
    AT LINE-SELECTION.
     
      DO.
        READ LINE SY-INDEX FIELD VALUE A_CHECK.
     IF SY-SUBRC NE 0.
       EXIT.
     ENDIF.
       IF a_check eq 'X'.
        MOVE IT_MARA-MATNR TO IT_REQDATA-MATNR.
        APPEND IT_REQDATA.
        CLEAR IT_REQDATA.
        CLEAR it_mara.
       ENDIF.
      ENDDO.
      PERFORM get_marc.
      PERFORM disp_marc.
      REFRESH IT_REQDATA.
    *&---------------------------------------------------------------------*
    *&      Form  GET_MARA
    *&---------------------------------------------------------------------*
     
    FORM get_mara .
      SELECT * FROM mara INTO TABLE it_mara WHERE matnr IN s_matnr.
    ENDFORM.                    " GET_MARA
    *&---------------------------------------------------------------------*
    *&      Form  DISP_MARA
    *&---------------------------------------------------------------------*
     
    FORM disp_mara .
      LOOP AT IT_MARA.
       WRITE:/ A_CHECK as CHECKBOX,IT_MARA-MATNR,IT_MARA-MTART,IT_MARA-NTGEW.
       HIDE IT_MARA.
      ENDLOOP.
    ENDFORM.                    " DISP_MARA
    *&---------------------------------------------------------------------*
    *&      Form  GET_MARC
    *&---------------------------------------------------------------------*
     
    FORM get_marc .
       REFRESH IT_MARC.
      SELECT * FROM MARC INTO TABLE IT_MARC FOR ALL ENTRIES IN IT_REQDATA
                         WHERE MATNR EQ IT_REQDATA-MATNR.
      REFRESH IT_REQDATA.
    ENDFORM.                    " GET_MARC
    *&---------------------------------------------------------------------*
    *&      Form  DISP_MARC
    *&---------------------------------------------------------------------*
     
    FORM disp_marc .
     LOOP AT IT_MARC.
      WRITE:/ IT_MARC-MATNR,IT_MARC-WERKS.
      CLEAR:IT_MARC.
     ENDLOOP.
    ENDFORM.                    " DISP_MARC

    Add comment
    10|10000 characters needed characters exceeded