Get comments texts from SAP

November 7, 2007

In many transaction, SAP stores comments in different table. For example if you want to get comments texts on Item detail of Purchasing order , belive me you will not find on table EKPO (Item table of purchasing order). So you need a function and some object or id to get the comment. You can find object by entering table STXH-TDNAME with Purchasing order number plus asterisk (because STXH-TDNAME contains PO Number plus Item number of PO). STXH-TDNAME = ‘4500002131*’ will be bring back object, name, and id as parameter on function module READ_TEXT.

The following code is a function that will return PO Item text :

data: begin of tlinetab occurs 100.
             include structure tline.
data: end of tlinetab.
data: po_no    like ekpo-ebeln,
          po_item  like ekpo-ebelp,
          thead    like thead,
          line_cnt type n,
          tdname   like thead-tdname.

select single ebeln ebelp
  into (po_no, po_item)
  from ekpo
  where ebeln = ‘4500002131′
    and ebelp = ‘10′.

concatenate po_no po_item into tdname.

call function ‘READ_TEXT’
       exporting
            id = ‘F01′
            language = sy-langu
            object = ‘EKPO’
            name = tdname
       importing
            header = thead
       tables
            lines = tlinetab
       exceptions
            id = 1
            language = 2
            name = 3
            not_found = 4
            object = 5
            reference_check = 6
            wrong_access_to_archive  = 7
            others = 8.

  if sy-subrc = 0.
    loop at tlinetab.
      write / tlinetab-tdline.
      add 1 to line_cnt.
    endloop.
  endif.

Good luck …!

Entry Filed under: TECHNICAL. .

2 Comments Add your own

  • 1. marvin  |  January 19, 2008 at 9:24 pm

    Hi,

    I have an issue in the office..The user creates a PO/cheque requisition in ME21N.

    The PO creator wants to enter the credit card number in ME21N which should finally appear in FI document when the payables dept run automatic payment program ( F110) to make payments to the credit. card company.

    Can u advice the steps/ t codes/ to meet this requirement?

    Reply
  • 2. husnie  |  May 13, 2008 at 11:52 am

    I think, you can utilized field on PO to take credit card number. You not need to chnage the PO program but you need small change on automatic payment (F110) to get credit card number.

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Top Posts

Categories

RECENT POSTS

Recent Comments

Archives

Blog Stats

Meta