Skip to Content
0

Check box event on Hierarchy ALV

Feb 01, 2017 at 11:18 PM

219

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Feb 02, 2017 at 06:27 AM
0
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.
Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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 ?

0

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).

1

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.

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

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

Share
10 |10000 characters needed characters left characters exceeded