cancel
Showing results for 
Search instead for 
Did you mean: 

Journal entries Referring data

Former Member
0 Kudos

I nead to recover data of a document referred in a jpurnal entries.I know only the journal entries data (table OJDT) and I have to use 'query generator'.

Can you help me?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This is a sample of the query that you need to execute.

here i am getting information from de document and the journal entry.

/purchase invoices/

select

a.docnum,

a.objtype,

a.cardcode,

a.cardname,

b.transid,

b.taxdate,

c.Account,

c.debit,

c.credit

from

opch a, ojdt b, jdt1 c

where

a.docnum = b.baseref

and b.transid = c.transid

/*

sales invoices

*/

/purchase invoices/

select

a.docnum,

a.objtype,

a.cardcode,

a.cardname,

b.transid,

b.taxdate,

c.Account,

c.debit,

c.credit

from

oinv a, ojdt b, jdt1 c

where

a.docnum = b.baseref

and b.transid = c.transid

I hope this helps..

Sergio Arrivillaga

Former Member
0 Kudos

Thanks a lot for your help, but I resolved only partiallly my problem.

I'm trying to explain better:

I know only the field TransId of OJDT and i ignore the type of document related. Your exaple fits very well in case of invoices. In case of other document could ypu help me ? do you know if exist a mapping table to understand to join the various tables and the document identifiers?

Thans

Former Member
0 Kudos

Hi Antonio,

In the OJDT table you have the TransType field wich tells you what type is the base document. have a look at the BoObjectType enumeration to know what each number is. Then the BaseRef field is the number of the document who has created the journal entry.

Hope helps,

Ibai Peñ