*Begin of QSCR: 2B013195
DATA: loc_t_lines LIKE tline OCCURS 0 WITH HEADER LINE,
      loc_char LIKE tline-tdline.
DATA  loc_i TYPE i.

CLEAR g_po_invoice_1.
CLEAR g_po_invoice_2.
CLEAR g_po_invoice_3.
CALL FUNCTION 'READ_TEXT'
     EXPORTING
          id       = 'ST'
          language = 'E'
          name     = 'ZCSM_PO_INVOICE_EN'
          object   = 'TEXT'
     TABLES
          lines    = loc_t_lines
     EXCEPTIONS
          OTHERS   = 0.

IF sy-subrc = 0.
  loc_i = 1.
  READ TABLE loc_t_lines INDEX loc_i.

  WHILE sy-subrc = 0.
    MOVE loc_t_lines-tdline TO loc_char.
    CONDENSE loc_char NO-GAPS.
    IF loc_char(1) = '*' OR loc_char = ''.
      "ignore the comment
    ELSE.
      MOVE loc_t_lines-tdline TO g_po_invoice_1.
      EXIT.
    ENDIF.
    loc_i = loc_i + 1 .
    READ TABLE loc_t_lines INDEX loc_i.
  ENDWHILE.

  loc_i = loc_i + 1 .
  READ TABLE loc_t_lines INDEX loc_i.
  WHILE sy-subrc = 0.
    MOVE loc_t_lines-tdline TO loc_char.
    CONDENSE loc_char NO-GAPS.
    IF loc_char(1) = '*' OR loc_char = ''.
      "ignore the comment
    ELSE.
      MOVE loc_t_lines-tdline TO g_po_invoice_2.
      EXIT.
    ENDIF.
    loc_i = loc_i + 1 .
    READ TABLE loc_t_lines INDEX loc_i.
  ENDWHILE.

  loc_i = loc_i + 1 .
  READ TABLE loc_t_lines INDEX loc_i.
  WHILE sy-subrc = 0.
    MOVE loc_t_lines-tdline TO loc_char.
    CONDENSE loc_char NO-GAPS.
    IF loc_char(1) = '*' OR loc_char = ''.
      "ignore the comment
    ELSE.
      MOVE loc_t_lines-tdline TO g_po_invoice_3.
      EXIT.
    ENDIF.
    loc_i = loc_i + 1 .
    READ TABLE loc_t_lines INDEX loc_i.
  ENDWHILE.

ENDIF.

*End Of QSCR 2B013195

posted on 2008-12-17 14:34  沧海-重庆  阅读(394)  评论(0编辑  收藏  举报