Skip to Content
author's profile photo Former Member
Former Member

Checkbox Issue in Reporting

Hi Gurus,

How i can put check boxes in list display and further to make them functional.

i.e. I hv a report and after executing that report it shows the sales order number in basic list as per the user selection through selection screen.

Now, I want a check box infront of all the sales order numbers and further i want to make them functional.

Tell me how to set the check boxes in basic list.

Regards

Vikas Badhan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2008 at 10:14 AM

    hiii

    you can do this by using following code.refer it.

    FORM get_flight_detail .
    
    
      SELECT
              carrid                       "carrier id
              connid                       "connection id
              airpfrom                     "airport from
              airpto                       "airport to
              deptime                      "departure time
              arrtime                      "arrival time
        INTO CORRESPONDING FIELDS OF TABLE t_flight
        FROM spfli.
    
    
    ENDFORM.                    " get_flight_detail
    
    
    
    FORM read_flight_detail .
    
      LOOP AT t_flight INTO fs_flight.
        SET PF-STATUS 'SELECT'.
    
        WRITE:
         /20
                 box AS CHECKBOX,
                 fs_flight-carrid,
                 fs_flight-connid,
                 fs_flight-airpfrom,
                 fs_flight-airpto,
                 fs_flight-deptime,
                 fs_flight-arrtime.
    
        WRITE: w_zero.
    
    
      ENDLOOP.
    
    
    ENDFORM.                    " read_flight_detail
    
    
    
    <-----after at line selection call following subroutine----->
    
    FORM detail_data .
    
      DATA:
         w_index TYPE sy-index,
         w_space TYPE c VALUE ' '.
    
      w_index = sy-index.
      DESCRIBE TABLE t_flight LINES w_lines.
      w_index = w_index + 2.
      DO w_lines TIMES.
        READ LINE sy-index FIELD VALUE box INTO box
                  fs_flight-carrid INTO fs_flight-carrid
                   fs_flight-connid INTO fs_flight-connid.
    
    
    
        IF box EQ 'X'.
    
          .
          SELECT
              carrid                       "carrier id
              connid                       "connection id
              fldate                       "flight date
              seatsmax                     "maximum seats
              seatsocc                     "occupied seats
          INTO CORRESPONDING FIELDS OF TABLE t_flight1
          FROM sflight
          WHERE connid EQ fs_flight-connid
          AND carrid EQ fs_flight-carrid.
    
    
          LOOP AT t_flight1 INTO fs_flight1.
            WRITE:
                /20
                     fs_flight1-connid,
                     fs_flight1-fldate,
                      fs_flight1-seatsocc,
                      fs_flight1-seatsmax.
    
    
    
            MODIFY LINE sy-lilli  FIELD VALUE  box
                 FIELD FORMAT box INPUT OFF.
            MODIFY LINE sy-lilli  FIELD VALUE  box FROM w_space.
    
    
            w_flag = '*'.
            MODIFY LINE sy-index FIELD VALUE w_zero FROM w_flag.
    
          ENDLOOP.
        ENDIF.
      ENDDO.
    
    ENDFORM.                    " detail_data

    regards

    twinkal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2008 at 09:32 AM

    try this,

    WRITE:/ SELECT-CHECKBOX AS CHECKBOX.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2008 at 10:01 AM

    hi vikas

    u can o/p the checkbox stament using write additions

    but if u want to capture the check box which is selected in at-line selection event

    u have to use syntax

    READ LINE ... FIELD VALUE f1 INTO g1 ...

    fn INTO gn

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2008 at 10:06 AM

    Hi,

    Are you using a ALV List Display? If so, to display the checkbox, you just have to mention it in the fieldcatalog. Declare a new field say 'BOX' and while defining fieldcatalog, set the fieldcatalog-checkbox = 'X'. You also have to mention it in the layout. This will display a checkbox in the ALV List display.

    To make it functional, write the code in the USER_COMMAND of the ALV.

    Regards,

    Suganya

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 10, 2008 at 10:34 AM

    Hi Vikas,

    Say you print vendor details with checkbox available for each record.

    And on checking a checkbox for a particular vendor you want to print the further details

    for the selected vendors.

    Then you can check the selected vendors and then process their details.

    A demo for this is given below :-

    TYPES : BEGIN OF VENDOR,

    LIFNR LIKE LFA1-LIFNR,

    NAME1 LIKE LFA1-NAME1,

    END OF VENDOR,

    BEGIN OF VENDOR1,

    LIFNR LIKE LFA1-LIFNR,

    NAME1 LIKE LFA1-NAME1,

    ORT01 LIKE LFA1-ORT01,

    LAND1 LIKE LFA1-LAND1,

    BUKRS LIKE LFB1-BUKRS,

    END OF VENDOR1.

    DATA : VENDOR_TAB TYPE STANDARD TABLE OF VENDOR INITIAL SIZE 20 WITH HEADER LINE,

    VENDOR1_TAB TYPE STANDARD TABLE OF VENDOR1 INITIAL SIZE 20 WITH HEADER LINE,

    CB.

    START-OF-SELECTION.

    SET PF-STATUS 'ZPFSTAT'.

    SELECT LIFNR NAME1

    FROM LFA1

    INTO CORRESPONDING FIELDS OF TABLE VENDOR_TAB.

    AT USER-COMMAND.

    CASE SY-UCOMM.

    WHEN 'VL'.

    IF SY-LSIND = 1.

    SET PF-STATUS SPACE.

    DO.

    CLEAR CB.

    READ LINE SY-INDEX FIELD VALUE CB.

    IF SY-SUBRC <> 0.

    EXIT.

    ELSE.

    CHECK CB = 'X'.

    MODIFY CURRENT LINE : FIELD VALUE CB FROM SPACE.

    SELECT ALIFNR ANAME1 AORT01 ALAND1 B~BUKRS

    FROM LFA1 AS A

    LEFT OUTER JOIN LFB1 AS B

    ON ALIFNR = BLIFNR

    INTO TABLE VENDOR1_TAB

    WHERE A~LIFNR = VENDOR_TAB-LIFNR.

    LOOP AT VENDOR1_TAB.

    WRITE : / 'Vendor ID:' NO-GAP, VENDOR1_TAB-LIFNR,

    / 'Vendor Name :' NO-GAP, VENDOR1_TAB-NAME1,

    / 'City :' NO-GAP, VENDOR1_TAB-ORT01,

    / 'Land :' NO-GAP, VENDOR1_TAB-LAND1,

    / 'Country Code :' NO-GAP, VENDOR1_TAB-BUKRS.

    ULINE.

    ENDLOOP.

    ENDIF.

    ENDDO.

    ENDIF.

    ENDCASE.

    END-OF-SELECTION.

    WRITE : /1 'CB', 5 'Vendor ID', 18 'Vendor Name'.

    ULINE.

    LOOP AT VENDOR_TAB.

    WRITE : /1 CB AS CHECKBOX, 5 VENDOR_TAB-LIFNR, 18 VENDOR_TAB-NAME1.

    HIDE : VENDOR_TAB-LIFNR.

    ENDLOOP.

    ULINE.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.