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: 

Buffer issue while calling transaction from ALV

former_member193947
Participant
0 Kudos
226

Hello Guru's,

We use REUSE_ALV_GRID_DISPLAY and display multiple columns.  Our requirement is, while double clicking each column, it should navigate to different transaction code and skip initial screen on navigation.

We are able to achieve the navigation through CALL TRANSACTION. But, only during first time call, it navigates to the correct number. When we click 'Back' button and try to double click another number in the same column of the alv, the navigation goes fine, but it displays the details of the old number that we navigated before. The issue is same with all columns.

Below is the sample code. Can someone let me know, how to solve this buffer issue ?

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

    IF r_ucomm EQ'&IC1'.

      CASE rs_selfield-fieldname.

        WHEN 'FIELD1'.
          SET PARAMETER ID 'FIELD1' FIELD rs_selfield-value.
          CALL TRANSACTION 'TCODE1' AND SKIP FIRST SCREEN.
          FREE MEMORY ID 'FIELD1'.
          FREE MEMORY ID rs_selfield-value.

        WHEN 'FIELD2'.
          SET PARAMETER ID 'FIELD2' FIELD rs_selfield-value.
          CALL TRANSACTION 'TCODE2' AND SKIP FIRST SCREEN.
          FREE MEMORY ID 'FIELD2'.
          FREE MEMORY ID rs_selfield-value.

        WHEN 'FIELD3'.
          SET PARAMETER ID 'FIELD3' FIELD rs_selfield-value.
          CALL TRANSACTION 'TCODE3' AND SKIP FIRST SCREEN.
          FREE MEMORY ID 'FIELD3'.
          FREE MEMORY ID rs_selfield-value.

        WHEN OTHERS.

      ENDCASE.

    ENDIF.

ENDFORM.

Thanks.

2 REPLIES 2

Former Member
0 Kudos
74

May be this will work.....

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

     SET PARAMETER ID 'FIELD1' FIELD SPACE.

     SET PARAMETER ID 'FIELD2' FIELD SPACE.

   SET PARAMETER ID 'FIELD3' FIELD SPACE.


    IF r_ucomm EQ'&IC1'.

      CASE rs_selfield-fieldname.

        WHEN 'FIELD1'.
          SET PARAMETER ID 'FIELD1' FIELD rs_selfield-value.
          CALL TRANSACTION 'TCODE1' AND SKIP FIRST SCREEN.
          FREE MEMORY ID 'FIELD1'.
          FREE MEMORY ID rs_selfield-value.

        WHEN 'FIELD2'.
          SET PARAMETER ID 'FIELD2' FIELD rs_selfield-value.
          CALL TRANSACTION 'TCODE2' AND SKIP FIRST SCREEN.
          FREE MEMORY ID 'FIELD2'.
          FREE MEMORY ID rs_selfield-value.

        WHEN 'FIELD3'.
          SET PARAMETER ID 'FIELD3' FIELD rs_selfield-value.
          CALL TRANSACTION 'TCODE3' AND SKIP FIRST SCREEN.
          FREE MEMORY ID 'FIELD3'.
          FREE MEMORY ID rs_selfield-value.

        WHEN OTHERS.

      ENDCASE.

    ENDIF.

ENDFORM.

Former Member
0 Kudos
74

You can narrow down the problem by debugging the code and seeing whether RS_SELFIELD-VALUE has the correct value or not.

Those FREE MEMORY statements are not helping anything by the way, they only apply to data that you have created using EXPORT TO MEMORY. 

Jim