18 Aralık 2011 Pazar

SAP/ABAP: Perform, Tables, Using, Changing

*&---------------------------------------------------------------------*
*& Report  ZSILINECEK2
*&
*&---------------------------------------------------------------------*

REPORT ZSILINECEK2.

DATA: BEGIN OF LT_MARA OCCURS 0.
        INCLUDE STRUCTURE: MARA.
DATA: NAME(1).
DATA: END OF LT_MARA.

DATA: LV_I TYPE I.
DATA: LV_OK(1).

CLEAR: LV_OK.

SELECT *
  FROM MARA
  INTO TABLE LT_MARA
  UP TO 10 ROWS.

PERFORM CHANGE_LT_MARA TABLES LT_MARA
                       USING LV_I
                       CHANGING LV_OK.


*&---------------------------------------------------------------------*
*&      Form  CHANGE_LT_MARA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_LT_MARA  text
*----------------------------------------------------------------------*
FORM CHANGE_LT_MARA  TABLES   P_LT_MARA STRUCTURE LT_MARA
                     USING    P_LV_I    TYPE      ANY
                     CHANGING P_LV_OK   TYPE      ANY.

  DATA: LS_MARA LIKE LINE OF P_LT_MARA.

  LOOP AT P_LT_MARA INTO LS_MARA.

    LS_MARA-NAME = P_LV_I = P_LV_I + 1.

    MODIFY P_LT_MARA FROM LS_MARA.

  ENDLOOP.

  P_LV_OK = 'X'.

ENDFORM.                    " CHANGE_LT_MARA

Hiç yorum yok:

Yorum Gönder

İnsdroid

Sabahtan beri çatada çutada çatada çutada… Bitmedi yine de… Neyse, yolumuz uzun, toparlıyorum çantamı, adaptörü falan tıkıştırıyorum bir şe...