cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering WRTTP = 04 records from ACDOCA

mhajek
Explorer
0 Kudos
1,366

Hello fellow SAPpers.

I am facing an issue filtering just Value type 04 records from ACDOCA in a view.

I have done everything as SAP tells us in note 2185026

I am using for example this code:

SELECT TOP 100 "a"."RACCT" as "RACCT_", "a"."CO_BELNR" as "COBELNR_", "a"."CO_BUZEI" as "COBUZEI_", "a"."ACCASTY" as "ACCASTY_", "a".* from "SAPXXX"."ACDOCA" as "a", "SAPXXX"."FINSC_CMP_VERSNC" as "v"

where "a"."RBUKRS" = "v"."BUKRS" and "a"."RLDNR" = "v"."RLDNR" and "v"."VERSN" != ' '

and "a"."CO_BELNR" != ' ' and "a"."CO_BUZEI" != '000' and "a"."ACCASTY" != ' '

KSB1 show me, that some of the result records are still WRTTP 11...

But the SQL code should filter out only those of Value type 04

CO_BELNR, CO_BUZEI and ACCASTY are filled for some of the WRTTP 11 records.

this is the snippet from the note 2185026 :

Example of the filtering of CO-relevant document line items from the table ACDOCA for value type 04:

Data: lt_acdoca type table of acdoca.

select * from acdoca as a

inner join finsc_ld_cmp as v on a~rbukrs = v~bukrs and a~rldnr = v~rldnr and v~versn ne space "Important: or table FINSC_CMP_VERSNC

into corresponding fields of table lt_acdoca

where a~co_belnr ne space and a~co_buzei ne '000' and not a~accasty = space.

is a note wrong or I am doing something wrong? How can I easily "recreate" the field WRTTP (just for values 04 and "others") in a view over ACDOCA?

Thank you, Martin

Accepted Solutions (0)

Answers (0)