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

User Exit MV45AFZZ-partner function automation

Former Member
0 Likes
3,387

Hi All,

I need experts help to resolve one high ticket.

During the change of Salesorder , I am deleting the partner from XVBPA internal table if there is no plant in Salesorder line item.

Like below.

IF NOT xvbap-werks IS INITIAL.

Want update the VBPA table.

ELSE."no plant

DELETE xvbpa WHERE parvw = 'ZP' .

xvbpa-updkz = 'D'.

MODIFY xvbpa INDEX sy-tabix.

ENDIF.

Some how the above code is not updating the DATABASE table vbpa. I have tried with yvbpa also but no luck.

Pls help me to resolve this ASAP.

rgds,

kali

Hi All,

I need experts help to resolve one high ticket.

During the change of Salesorder , I am deleting the partner from XVBPA internal table if there is no plant in Salesorder line item.

Like below.

IF NOT xvbap-werks IS INITIAL.

Want update the VBPA table.

ELSE."no plant

DELETE xvbpa WHERE parvw = 'ZP' .

xvbpa-updkz = 'D'.

MODIFY xvbpa INDEX sy-tabix.

ENDIF.

Some how the above code is not updating the DATABASE table vbpa. I have tried with yvbpa also but no luck.

Pls help me to resolve this ASAP.

rgds,

kali

6 REPLIES 6
Read only

Former Member
0 Likes
1,674

Try putting this code in a program and submit the the program.

Also you have not specified how you are updating VBPA table.

regards,

Aravind

Read only

Former Member
0 Likes
1,674

Is this the complete code or anything left and in which form routine are you writing this code .

can u please pass the exit name and the complete code.

is the code residing in a loop endloop or just the if condition .

first check the sales area .

and then loop at the particular item with no plant and check the condition and modify vbpa .

if vbak-vkorg eq 'XX' and vbak-spart = ‘YY’  .

 loop at xvbpa
      where PARVW = 'ZP' 
       and   POSNR = VBAP-POSNR.
 
  IF  xvbap-werks IS INITIAL.        "item condition
  DELETE xvbpa WHERE parvw = 'ZP' .
  move  'D' to  xvbpa-updkz.
  MODIFY xvbpa  .
  ENDIF.
  endloop.

Endif.

regards,

vijay

Read only

Former Member
0 Likes
1,674

i got a requirement to automate partner function in sales order create and change. kindly give me some idea to achieve this..

Read only

Former Member
0 Likes
1,674

i got a requirement to automate partner function in sales order create and change. kindly give me some idea to achieve this..

Read only

akshatrander1990
Explorer
0 Likes
1,674

Hi Pramod,

You don't need to delete the partner line.

Just Modify the line with xvbpa-updkz = 'D'.

System 'll not consider this partner automatically.

Regards

Akshat

Read only

0 Likes
1,674

Hi All,

I was able to figure it out by adding a record in YVBPA having UPKZ = 'D' and by deleting the XVBPA record.

read table xvbpa with key parvw = 'SP' assigning field-symbol(<lf_carr>).
if sy-subrc = 0.
if <lf_carr>-lifnr is not initial.

read table yvbpa assigning <lf_yvbpa> with key parvw = 'SP'.
if sy-subrc = 0.
<lf_yvbpa>-updkz = 'D'.
else.
append initial line to yvbpa assigning <lf_yvbpa>.
<lf_yvbpa> = <lf_carr>.
<lf_yvbpa>-updkz = 'D'.
endif.

delete xvbpa where parvw = 'SP'.

endif.
endif.