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: 

Adding a new partner in sales order using MV45AFZZ exit using t-code VA02.

Former Member
0 Kudos
2,403

Hi,

I am trying to add a new partner function at the header level through user exit provided in MV45AFZZ Include in subroutine USEREXIT_MOVE_FIELD_TO_VBAK . The code works perfectly for VA01. But it doesn't work for VA02.

Same logic gets triggered for both the t-codes.

In VA02 I can see the newly added partner on the screen, but when I click on save system gives message "No data was changed" and its not updated at database level either.

See screenshots below:

Partner tab in display mode of the order:

Opening the same tab in change mode using VA02

The one highlighted in yellow is the one added through the code written in user-exit.

After pressing save I get below message:

Once I go back in order I can't see the new partner function. I tried using UPD_VBAK = 'U'. But that didn't work either.

Please help if you have any solution for this. Correct answer or any kind of help will be definitely rewarded.


Thanks,

Aditya.

1 ACCEPTED SOLUTION

Juwin
Active Contributor
0 Kudos
929

To force a save, you need to set R185D-DATALOSS = 'X'.

Thanks,

Juwin

6 REPLIES 6

Juwin
Active Contributor
0 Kudos
930

To force a save, you need to set R185D-DATALOSS = 'X'.

Thanks,

Juwin

Former Member
0 Kudos
929

Hi Aditya,

Try setting  r185d-dataloss to 'X' in the user exit also along with your logic.

R

Former Member
0 Kudos
929

You are both correct, it worked like a charm. Thank you very much to both of you.

Regards,

Aditya.

Erol_CAGLAR
Participant
0 Kudos
929

Hi

Can you share simple code from here

Best Wishes

Erol

Erol_CAGLAR
Participant
0 Kudos
929

I solved with this function, there is no need r185d-dataloss attribute.


CALL FUNCTION 'SD_PARTNER_SINGLE_MODIFY'
EXPORTING
fic_objecttype = pi_objecttype
fic_objectkey = pi_objectkey
fis_sdorgdata = pis_sdorgdata
fif_pargr = lv_paproc
fif_parvw = lv_role
fif_posnr = pi_pos
fif_kunnr_old = lv_old_partner
fif_kunnr_new = lv_new_partner
fif_dialog = 'X'
fif_initial_value = lv_initial_value
fif_knref_parnr = pi_knref_parnr
fif_vkorg = gvs_tc_parameters-sdorgdata-vkorg
EXCEPTIONS
parameter_incomplete = 1
object_not_found = 2
check_error = 3
numbers_not_ok = 4
OTHERS = 9.

Erol

0 Kudos
118

Hello, could you please advise how did you manage it? I am having problem at "get data from memory" and it ends there for me, in this FM