Skip to Content

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

Reading Item texts of a document (PO) while it is not yet saved

Hi Team ABAP,

i´m a little confused about those item texts.

I was searching the Forum on this and found thread

according to this i adopted my Coding, but still it wont, work. Maybe one of you guys has an Idea where i go wrong?

FORM get_article_basic_text
  USING           ebeln           TYPE ebeln
                  ebelp           TYPE ebelp
                  matnr           TYPE matnr.

  DATA:           ls_header       TYPE thead,
                  lt_lines        TYPE TABLE OF tline,
                  ls_lines        TYPE tline,
                  lv_swap         TYPE c LENGTH 3,
                  lv_line         TYPE char20.

  FIELD-SYMBOLS: <line>           TYPE tline.

  DO 30 TIMES.
    WRITE sy-index TO lv_swap.
    CONDENSE lv_swap.
    CONCATENATE 'W_LONG_TXT' lv_swap INTO lv_line.
    ASSIGN (lv_line) TO <line>.
    IF <line> IS ASSIGNED.
      CLEAR <line>.

  IF ebeln IS INITIAL.
    ebeln = 'XXXXXXXXXX'.

  CONCATENATE ebeln ebelp
  INTO        ls_header-tdname.
  ls_header-tdid      = 'F03'.
  ls_header-tdobject  = 'EKPO'.
  ls_header-tdspras   = nast-spras.
  g_tdname = ls_header-tdname.

      id                      = ls_header-tdid
      language                = ls_header-tdspras
      name                    = ls_header-tdname
      object                  = ls_header-tdobject
      lines                   = lt_lines
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.

I created a new PO using ME21N, added the F03 Text on item level for item 10. Then i pushed print preview and debugged right into my coding.

Values for LS_HEADER were:

ls_header-tdname = XXXXXXXXXX00010

ls_header-tdid = F03

ls_header-tdspras = D

ls_header-tdobject = EKPO

and still i got sy-subrc = 4 and no result.

Edited by: Florian Kemmer on Jun 9, 2011 9:36 AM

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