2012年5月7日 星期一

[SD] Get accounting document for billing document

How to get accounting doc for billing doc?

You can use function: AC_DOCUMENT_RECORD
  call function 'AC_DOCUMENT_RECORD'
    exporting
      i_awtyp      = 'VBRK'
      i_awref      = lv_vbeln " billing doc number
*      i_aworg      = aworg
*      i_awsys      = awsys
*      i_awtyp_incl = 'BKPF'
*      i_awtyp_excl = 'BKPF'
*      i_bukrs      = lv_bukrs
*      i_valutyp    = '0'
      x_dialog     = ' '      " X: show dialog, space: fill table only
    tables
      t_documents  = docs_fi
    exceptions
      no_reference = 1
      no_document  = 2
      others       = 3.