cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fetch the COGS Account No. from the Material document

thi123
Explorer
0 Kudos
552

Hello Friends,

I have a requirement to fetch the COGS account number from the accounting document relevant to the material document.

Can someone suggest to me the logic to fetch it?

View Entire Topic
RaymondGiuseppi
Active Contributor

From the material document you can easily find the related financial documment (browse table TTYP, look for MKPF)

  • BKPF-AWTYP constant 'MKPF'
  • BKPF-AWKEY structure MKPF_AWKEY (MKPF-BELNR + MKPF-MJAHR)

Look for the segment with BSEG-KTOSL = 'GBB', BSEG-BSCHL = '81' (cost) - Is movement code 221 or similar code?

For the Customizing behind, call Customizing transaction OBYC (table T030)