Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with Interactive - ALV

Hi Experts,

Again I am facing probelm with in this interactive report (ALV).

This time I am getting the O/P correctly...but each time when I come back to first screen then go to

second screen O/P of second screen is extending..

Eg; If my O/P in second screen is ,

first time ( which is correct O/P )

A B C

second time

A B C A B C

third time

A B C A B C A B C like soon..

I am pasting my code, please have a look on it and advice me..

FORM USER_COMM USING P_UCOMM LIKE SY-UCOMM
                           R_SELFIELD TYPE SLIS_SELFIELD.

  DATA : OK_CODE TYPE SY-UCOMM.
  OK_CODE = P_UCOMM.
  CASE OK_CODE.

    WHEN '&IC1'.
      IF R_SELFIELD-FIELDNAME = 'MATNR'.
        READ TABLE IT_FIRST INDEX R_SELFIELD-TABINDEX.

        REFRESH IT_FINAL.
        CLEAR IT_FINAL.


        LOOP AT IT_EBAN WHERE MATNR = IT_FIRST-MATNR
                          AND WERKS = IT_FIRST-WERKS.

          MOVE IT_EBAN-MATNR TO IT_FINAL-MATNR.
          MOVE IT_EBAN-BANFN TO IT_FINAL-BANFN.
          MOVE IT_EBAN-FKZTX TO IT_FINAL-FKZTX.
          MOVE IT_EBAN-MENGE TO IT_FINAL-MENGE.
          MOVE IT_EBAN-MEINS TO IT_FINAL-MEINS.
          APPEND IT_FINAL.
          CLEAR IT_EBAN.
          CLEAR IT_FINAL.
        ENDLOOP.


        S_LAYOUT-ZEBRA = 'X' .
        S_LAYOUT-COLWIDTH_OPTIMIZE = 'X' .

        PERFORM FIELD_CATALOG1 TABLES IT_FIELDCAT1

        USING: 'IT_FINAL' 'MATNR' 'X' 'MATERIAL NO:' 'X',
               'IT_FINAL' 'BANFN' ' ' 'PR NUMBER' ' ',
               'IT_FINAL' 'FKZTX' ' ' 'RELEASE STATUS' ' ',
               'IT_FINAL' 'MENGE' ' ' 'QUANTITY' 'X',
               'IT_FINAL' 'MEINS' ' ' 'UoM' 'X'.

        PERFORM SORT_BUILD1 USING TB_SORT1[].

        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
        I_CALLBACK_PROGRAM                = SY-CPROG
*        I_CALLBACK_USER_COMMAND           = 'USER_COMM'
*     IS_LAYOUT                         = S_LAYOUT
        IT_FIELDCAT                       = IT_FIELDCAT1[]
        IT_SORT                           = TB_SORT1[]

*      I_DEFAULT                         = 'X'
        TABLES
         T_OUTTAB                          = IT_FINAL[].

      ENDIF.
  ENDCASE.
ENDFORM.                    "user_comm

Please advice

Karthik

Edited by: Karthik R on Apr 16, 2009 2:01 PM

Former Member
Former Member replied

Hi Karthik,

Try refreshing fieldcatelog IT_FIELDCAT1

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question