Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Check box event on Hierarchy ALV

former_member188831
Contributor
0 Kudos

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.

5 REPLIES 5

former_member228164
Participant
0 Kudos
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.

0 Kudos

Abid Ali, Thanks for your response ! but with recording it's not capturing the user command code while doing check box.

I have already user_command in by report it trigger only when i click button on toolbar.

if you did it can you send me full sample code please ?

With the obsolete ABAP list technology, you cannot trigger an action automatically when you tick a checkbox. You may only use double-click or a hotspot field (single click).

0 Kudos

You can test program BCALV_TEST_HIERSEQ_LIST_EVENTS. If you enter command "/h" and then click on checkbox you see that you trigger no events : there is nothing to catch with this Function Module.

former_member228164
Participant
0 Kudos

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