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

Subledger Source Document Type in Journal Entry Query

kedalenechong
Participant
0 Kudos
131

Hi All

How to get a corresponding mapping between these two Origin values in Journal Entry Query Statement and Subledger Journal Entry so we know which Origin Number in JE belongs to AP Invoice PU Origin?

kedalenechong_1-1747715601670.png

 

Kedalene Chong

 

Accepted Solutions (1)

Accepted Solutions (1)

Felipe_Lima1
Active Participant
0 Kudos

Hi @kedalenechong ,

Yes. TransType is what you're looking for. A simple CASE statement will deal with it. See a very basic example below. You'll have to adapt it to your needs.

SELECT
	CASE TransType 
		WHEN '13' THEN 'SI'
		WHEN '14' THEN 'CN'
		WHEN '15' THEN 'DN'
		WHEN '18' THEN 'PU'
		WHEN '19' THEN 'PC'
		-- Include the other types based on the TransType (Object Type) list I shared
	END AS 'Origin'
	-- Then the rest of your query...
FROM OJDT

Felipe_Lima_0-1747816875337.png

BR,
Felipe

 

Answers (1)

Answers (1)

Felipe_Lima1
Active Participant
0 Kudos

Hi @kedalenechong ,

Not sure if this is what you meant exactly, but:

OJDT.TransType: Specifies the type of transaction that generated the journal entry, such as an A/P invoice, or any other marketing document/payment. Link to the object type (check the list here: List of object types - SAP Business One - SAP Community).

OJDT.BaseRef: Contains the document number or other reference from the original business document (e.g., an invoice number). This, along with the TransType, helps identify the source document.

I hope it helps.

BR,
Felipe

kedalenechong
Participant
0 Kudos
Hi Felipe OJDT BaseRef and TransType are showing Numbers. Is there any way to display AP Invoice transaction Origin as PU?