sap指针实用实例

*&---------------------------------------------------------------------*
*& Report  ZTEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZTEST.
TYPES:
begin of IT_WOG,
  WOG001 like COSS-WOG001,
  WOG002 like COSS-WOG002,
  WOG003 like COSS-WOG003,
  WOG004 like COSS-WOG004,
  WOG005 like COSS-WOG005,
  WOG006 like COSS-WOG006,
  WOG007 like COSS-WOG007,
  WOG008 like COSS-WOG008,
  WOG009 like COSS-WOG009,
  WOG010 like COSS-WOG010,
  WOG011 like COSS-WOG011,
  WOG012 like COSS-WOG012,
  WOG013 like COSS-WOG013,
  WOG014 like COSS-WOG014,
  WOG015 like COSS-WOG015,
  WOG016 like COSS-WOG016,
end of IT_WOG.
 field-symbols: type any.

  data: l_field(14),
        IT_WOG type standard table of IT_WOG with header line,
        l_index TYPE I,
        WOG0 LIKE COSS-WOG016,
        l_ind(2).

  IT_WOG-WOG002 = 123.
  IT_WOG-WOG003 = 1.
  APPEND IT_WOG.

LOOP AT IT_WOG.
  DO 12 TIMES.
    l_index = l_index + 1.
    l_ind = l_index.
    unpack l_ind to l_ind.
    concatenate 'IT_WOG-WOG0' l_ind into l_field.
    assign (l_field) to .
    WOG0 = WOG0 + .
    WRITE / WOG0.
  ENDDO.
ENDLOOP.

你可能感兴趣的:(ABAP,sap,report,header,types,table)