2011年6月14日 星期二

[Code] READ_TEXT

SO Header
DATA  BEGIN OF ITLINE OCCURS 0.
      INCLUDE STRUCTURE TLINE.
DATA  END OF ITLINE.
DATA  G_VGBEL LIKE THEAD-TDNAME.

G_VGBEL = VBAK-VBELN.

CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID       = '0001'
    LANGUAGE = 'M'
    NAME     = G_VGBEL
    OBJECT   = 'VBBK'
  TABLES
    LINES    = ITLINE
  EXCEPTIONS
    ID       = 1
    OTHERS   = 2.
SO Item
DATA  BEGIN OF ITLINE OCCURS 0.
      INCLUDE STRUCTURE TLINE.
DATA  END OF ITLINE.

DATA  G_VGBEL LIKE THEAD-TDNAME.

CONCATENATE VBAP-VBELN VBAP-POSNR G_VGBEL.

CALL FUNCTION 'READ_TEXT'
  EXPORTING
    ID       = '0001'
    LANGUAGE = 'M'
    NAME     = G_VGBEL
    OBJECT   = 'VBBP'
  TABLES
    LINES    = ITLINE
  EXCEPTIONS
    ID       = 1
    OTHERS   = 2.