Skip to Content
avatar image
Former Member

Check box event on Hierarchy ALV

Hi,

Am using REUSE_ALV_HIERSEQ_LIST_DISPLAY and i have user_command working for the actions button on toolbar. I am displaying hierarchy report using function module not ooabap. I have a checkbox column when user selects checkbox i have to update other field on the report. I am trying to find how do i trigger that event on selecting the checkbox.

Please let me know.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Feb 02, 2017 at 06:27 AM
    FOR GETTING THE FCT CODE OF THE CHECKBOX USE RECORDING FUNCTIONALTY AND THEN ASSIGN IT TO THE WHEN 'FCTCODE' OF THE CASE P_UCOMM.
    FORM USER_COMMAND  USING P_UCOMM    LIKE SY-UCOMM
                             P_SELFIELD TYPE SLIS_SELFIELD.
      P_SELFIELD-REFRESH = 'X'.
    
    
    
    
      CASE P_UCOMM.
    
    
        WHEN '%UPDATE'. "HERE UPDATE IS THE BUTTON ON APPLICATION TOOLBAR
    
    
          CLEAR WA_FINAL.
          READ TABLE IT_FINAL INTO WA_FINAL WITH KEY CHECK = 'X'.
          IF SY-SUBRC EQ 0.
    """""""""""""""""""""""""Here I am calling an external program"""""
            SUBMIT ZFARMER_EMAIL123 WITH P_ACNO = WA_FINAL-ACNO       
                                    WITH P_EMAIL = WA_FINAL-MAIL AND RETURN.
    """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
    
    
      P_SELFIELD-REFRESH = 'X'.
    
    
          ELSE.
    
    
            MESSAGE 'Please Select the Checkbox for Mail' TYPE 'E' DISPLAY LIKE 'I'.
    
    
          ENDIF.
    
    
          CLEAR:WA_FINAL.
    
    
        WHEN '&IC1'.        " SAP standard code for double-clicking
          READ TABLE IT_FINAL INTO WA_FINAL INDEX P_SELFIELD-TABINDEX. " Getting Row data
          CASE P_SELFIELD-FIELDNAME.
    
    
            WHEN 'STATUS'.
              WA_FINAL-STATUS = P_SELFIELD-VALUE.
    
    
             IF WA_FINAL-STATUS EQ 'APPROVE' OR WA_FINAL-STATUS EQ 'HOLD' OR WA_FINAL-STATUS EQ 'REJECT'.
                IF WA_FINAL-STATUS = 'APPROVE'.
                  WA_FINAL-LIGHTS = '@08@'.           "GREEN traffic light
                ELSEIF WA_FINAL-STATUS = 'HOLD'.
                  WA_FINAL-LIGHTS = '@09@'.           "YELLOW traffic light
                ELSEIF WA_FINAL-STATUS = 'REJECT'.
                  WA_FINAL-LIGHTS = '@0A@'.           "RED traffic light
                ENDIF.
                MODIFY IT_FINAL INDEX P_SELFIELD-TABINDEX FROM WA_FINAL .
              ELSE.
                MESSAGE 'Type either Approve/Hold/Reject' TYPE 'E' DISPLAY LIKE 'I'.
              ENDIF.
    
    
         ENDCASE.
    ENDCASE.
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2017 at 04:56 PM

    yes sandra is right....you use a double click /Hotspot...or else use OO abap..refer the iunderneath link.

    https://www.linkedin.com/pulse/sapabap-capturing-check-box-event-fm-cell-editing-buenavista

    Add comment
    10|10000 characters needed characters exceeded