10-04-2008 6:08 AM
Hi all,
I am doing some validation for Xvbpa table in sales order exit.
Here i want to deleate an partner function SP( Single record in internla table XVBPA) , if i delete this partner function in this internal table but it is still displaying in the transcation.
can any one guide me how to delete this record.
I am using this logic in SAVE_DOCUMENT_PREPARE.
10-04-2008 6:22 AM
10-04-2008 6:22 AM
if you want to delete you may have to use
xvbpa-updkz = 'D'. for the partner record what ever you want to delete.
then only it will be deleted. set the deletion indicator and see.
10-04-2008 6:40 AM
Hi Vijay,
tks for your replay,
for my logic i am modifying xvbpa with update indicator with 'D'
but also it is desplaying in transaction.
how to delete this record, kindly replay.
Pls check my code.
READ TABLE XVBpa into l_vbpa with key posnr = ivbap-posnr.
if l_vbpa-parvw = 'SP'.
if sy-subrc = 0.
delete xvbpa where posnr = ivbap-posnr
and parvw = 'SP'.
l_vbpa-updkz = 'D'.
Modify Xvbpa from l_vbpa transporting UPDKZ
where posnr = ivbap-posnr
and parvw = 'SP'.
10-04-2008 7:57 AM
10-04-2008 11:04 AM
whrer are you getting the ivbap-posr..? if the logic is inside some loop or read then ok.check the following corrections.
READ TABLE XVBpa into l_vbpa with key posnr = ivbap-posnr.
if l_vbpa-parvw = 'SP'.
if sy-subrc = 0.
"the below is not required.
"delete xvbpa where posnr = ivbap-posnr
"and parvw = 'SP'.
l_vbpa-updkz = 'D'.
Modify Xvbpa from l_vbpa transporting UPDKZ
where posnr = ivbap-posnr
and parvw = 'SP'.
endif.
10-05-2008 8:08 AM
Hi Vijay,
Thanks for your replay,
But i tried this manually by updating in internal table with this modification indicator, D ( delete) its not working. But if i modify this table(XVBPA) with U(Update) and I( Insert) its working fine.
I am writing this logic in MV45AFZZ in FORM SAVE_DOCUMENT_PREPAR in ivbap loop, is it right.
My main requiremnt is if user changes the item partner WE( Ship-to-party) it should pick its relevent SP maintained in customer master, if for the concerned ship-to-party it dosent have SP means it should come out of logic, but if user second time changes the ship-to-party it is not deleting the previous record.
If u dont main pls give me ur mail id . kindly replay its on top prority for me .
regards,
niki
10-05-2008 8:25 AM
Try to imitate the standard behaviour, Delete the partner from the partner of an item, Now check the values of table xvbpa and yvbpa values in Debug mode for the record which you deleted. try to pass the similar values in your code and see..
10-05-2008 8:30 AM
But at that particular placeYVBPA is initial in debugging mode . but my main doubt is it is taking the indicator U and I but for D it is not behaving properly. I am totally blank.
10-05-2008 8:50 AM
are you checking in the SAVE_DOCUMENT_PREPARE form. Did you got me. Delete one partner and check in Debugging what are the values in XVBPA and YVBPA tables.
if you don't find any values in table. then you have to delete the entries in both the tables(xvbpa, yvbpa)