Application Development and Automation 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: 
Read only

Help with this method check data changed

Former Member
0 Likes
458

hi to all experts ,

im working with an editable alv first the time im going to the programme im able to see the changes in the output internal but when im changing the fields content im not able to see the changes what could be the problem

FORM user_command USING r_ucomm TYPE sy-ucomm
                    rs_selfield TYPE slis_selfield  .




  CASE r_ucomm .
    WHEN 'EXEC' .


      REFRESH it_smart.
      CLEAR p_ref1.


      IF p_ref1 IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = p_ref1.
      ENDIF.

      IF p_ref1 IS NOT INITIAL.
        CALL METHOD p_ref1->check_changed_data.
      ENDIF.

      LOOP AT it_output INTO wa_output WHERE cbox EQ 'X'.
        READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
        IF sy-subrc EQ 0.
          wa_smart-lgpbe = wa_mard-lgpbe.
        ENDIF.
        wa_smart-matnr =  wa_output-matnr.
        wa_smart-maktx =  wa_output-maktx.
        wa_smart-meins =  wa_output-meins.
        wa_smart-bldat =  wa_output-bldat.
*        wa_smart-no_cop = wa_output-menge1.
        APPEND wa_smart TO it_smart.
        CLEAR: wa_smart,wa_output.

      ENDLOOP.

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
422

Hi,

The code provided by you is reflecting the modified data from alv to internal table.

But it will no show the modified data coz you need to include a code line after changing data in internal table, refer:-


FORM user_command USING r_ucomm TYPE sy-ucomm
                    rs_selfield TYPE slis_selfield  .
 
 
 
 
  CASE r_ucomm .
    WHEN 'EXEC' .
 
 
      REFRESH it_smart.
      CLEAR p_ref1.
 
 
      IF p_ref1 IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = p_ref1.
      ENDIF.
 
      IF p_ref1 IS NOT INITIAL.
        CALL METHOD p_ref1->check_changed_data.
      ENDIF.
 
      LOOP AT it_output INTO wa_output WHERE cbox EQ 'X'.
        READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
        IF sy-subrc EQ 0.
          wa_smart-lgpbe = wa_mard-lgpbe.
        ENDIF.
        wa_smart-matnr =  wa_output-matnr.
        wa_smart-maktx =  wa_output-maktx.
        wa_smart-meins =  wa_output-meins.
        wa_smart-bldat =  wa_output-bldat.
*        wa_smart-no_cop = wa_output-menge1.
        APPEND wa_smart TO it_smart.
        CLEAR: wa_smart,wa_output.
 
      ENDLOOP.

      "refresh the ALV Grid output from internal table
      rs_selfield-refresh = 'X' "<----add this line
      "this will refresh the display from the modified internal table

  ENDCASE.
ENDFORM.

Hope this helps you.

Regards,

Tarun

3 REPLIES 3
Read only

Former Member
0 Likes
422

I hope u set the flag for filed_catalogue_editing_intended_field1-EDIT !

thanq

Read only

Former Member
0 Likes
422

Hi,

Before looping at the output table, you need to get the selected rows using the method 'GET_SELECTED_ROWS'.

Then you need to loop at this rows and read the output table with the index.

Regards,

Shailaja

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
423

Hi,

The code provided by you is reflecting the modified data from alv to internal table.

But it will no show the modified data coz you need to include a code line after changing data in internal table, refer:-


FORM user_command USING r_ucomm TYPE sy-ucomm
                    rs_selfield TYPE slis_selfield  .
 
 
 
 
  CASE r_ucomm .
    WHEN 'EXEC' .
 
 
      REFRESH it_smart.
      CLEAR p_ref1.
 
 
      IF p_ref1 IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = p_ref1.
      ENDIF.
 
      IF p_ref1 IS NOT INITIAL.
        CALL METHOD p_ref1->check_changed_data.
      ENDIF.
 
      LOOP AT it_output INTO wa_output WHERE cbox EQ 'X'.
        READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
        IF sy-subrc EQ 0.
          wa_smart-lgpbe = wa_mard-lgpbe.
        ENDIF.
        wa_smart-matnr =  wa_output-matnr.
        wa_smart-maktx =  wa_output-maktx.
        wa_smart-meins =  wa_output-meins.
        wa_smart-bldat =  wa_output-bldat.
*        wa_smart-no_cop = wa_output-menge1.
        APPEND wa_smart TO it_smart.
        CLEAR: wa_smart,wa_output.
 
      ENDLOOP.

      "refresh the ALV Grid output from internal table
      rs_selfield-refresh = 'X' "<----add this line
      "this will refresh the display from the modified internal table

  ENDCASE.
ENDFORM.

Hope this helps you.

Regards,

Tarun