‎2007 Oct 05 12:51 AM
Gurus,
I have written a select statement that select records from the BKPF table..It gets the FI GL documents that are parked..
select BUKRS BELNR GJAHR from BKPF into TABLE i_vbkpf where BLART = 'SY'
AND CPUDT eq p_cpudt
AND PPNAM is not null.But if i debug and see i_vbkpf internal table it also has documents that were just posted in the system...is using
PPNAM is not Null"valid....
Please suggest.....
Thanks
Sam
‎2007 Oct 05 1:21 AM
What is your question? Sorry, i did not understand from your comments. Can you please tell in detail?
‎2007 Oct 05 1:28 AM
I have to write a select statement that picks up company code document number fiscal year from BKPF for FI documents that were parked...I have written this select but this select statement also picks up documents that were posted...What changes shud i make in the where co ndition to solve this issue....
Thanks
Sam
‎2007 Oct 05 1:27 AM
Hi,
Please try this.
select BUKRS BELNR GJAHR
from BKPF
into TABLE i_vbkpf
where BLART = 'SY'
and CPUDT eq p_cpudt
and PPNAM ne space.
Regards,
Ferry Lianto
‎2007 Oct 05 1:58 AM
Ferry,
When i executed this it just picked up one parked document but i had parked 2 documents on that date...is there any other change that i have to do....It did not picked up posted documents which is what i wanted...but why is it not picking up all the parked documents of that date...?
Thanks
Sam
‎2007 Oct 05 2:01 AM
Hi Sam,
Just go to SE16 and see the table data. Are you able to see the two entries with the same selection.
Regards,
Atish
‎2007 Oct 05 2:08 AM
You were right Atish...The PPNAM field doesnt get poulated for parked documents....it gets populated only for documents those were parked first and then posted...how shud i change the selection criteria to include these documents also....
The scenario is i have to write a select statement that picks up parked documents from the database...The Document type (BLART) field will be 'SY' and CPUDT will be the date entered on...what else can be the condition so that it picks up all the parked documents...I cannot use STATUS field because then we will not get documenst that were parked forst and then posted as for the posted documents the ststus changes...
I know its confusing but u guys can only help....Please suggest...
Thanks
Sam
‎2007 Oct 05 2:11 AM
‎2007 Oct 05 2:12 AM
u can use the below select query to select the parked document from BKPF table.
there is an field STAT in BKPF check the table field entries for parked documents.
select BUKRS BELNR GJAHR from BKPF into TABLE i_vbkpf where BLART = 'SY'
AND CPUDT eq p_cpudt
AND PPNAM is not null
AND BSTAT EQ 'V'.
please rewad points if its helpfull
thanks
Sukumar
‎2007 Oct 05 2:15 AM
No buddy it doesnt work....it picked up the posted doc and the parked doc but no the one that was parked first and then posted.....I just want to have docs that were parked at some stage and out of those parked ones some were posted also...right...
Thanks
Sam
‎2007 Oct 05 2:16 AM
Sam,
you are saying there are 2 documents.
Can you check if for these 2 documents Document type is "SY", date is same as that of used in SELECT and PPNAM is not equal to space.
Can you confirm this again?
ashish
‎2007 Oct 05 2:16 AM
Suku thanks for the reply...but please read my previous post...u will understand what i am saying....
Thanks
Sam
‎2007 Oct 05 2:20 AM
I will explain again ashish...There are 3 documents...for all three documents BLART = SY and CPUDT is same....
doc 1: Parked
doc 2: Posted
doc 3: parked and then posted.
Now i have to get docs that were parked at some stage...so i shud get doc 1 and doc 3...
but i just get doc 3 for the current select statement with PPNAM <> space...
am I able to explain now...
Thanks
Sam
‎2007 Oct 05 2:24 AM
hi sam
for this u can use the BSTAT = 'V'. in select query .
regards
sukumar
‎2007 Oct 05 2:27 AM
Hi Sam,
I think by using BSTAT as V or W or Z you will get all the parked documents. No need to give BLART.
Regards,
Atish
‎2007 Oct 05 2:31 AM
Atish, please understand for document that is parked the status is V fro docs that are posted status is space...
so
doc 1: Parked BSTAT = V
doc 2: Posted BSTAT = space
doc 3: parked and then posted. BSTAT = space
But i want to retrive documents 1 and 3..as they were or are in parked status at some point of time....
Can we do it....i am sure i am explaining everything in detail....
Thanks
Sam
‎2007 Oct 05 2:43 AM
Hi Sam,
Why don't you write two different queries on BKPF
1 to get parked documents
2 to get parked and posted documents
and then combine the result or just use the APPENDING option in second query so no need to use two internal tables.
Regards,
Atish
‎2007 Oct 05 1:28 AM
‎2007 Oct 05 3:07 AM
Hi Sam,
Please try this and see whether pick up both documents.
select BUKRS BELNR GJAHR
from BKPF
into TABLE i_vbkpf
where BLART = 'SY'
and CPUDT eq p_cpudt.
Regards,
Ferry Lianto