Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Partner function

Former Member
0 Likes
1,063

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.

9 REPLIES 9
Read only

Former Member
0 Likes
997

pls replay me

Read only

Former Member
0 Likes
997

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.

Read only

0 Likes
997

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'.

Read only

0 Likes
997

Hi,

is this logoc right.

Read only

0 Likes
997

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.

Read only

0 Likes
997

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

Read only

0 Likes
997

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..

Read only

0 Likes
997

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.

Read only

0 Likes
997

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)