cancel
Showing results for 
Search instead for 
Did you mean: 

Upating pricing agreements via FM CRM_PRICE_AGRMNTS_MAINTAIN_OW giving duplicate records

Former Member
0 Kudos

Hi All,

I am trying to update the price agreements of a line item based on easy condition entry in Frame agreement. I have implemented using the order save BADI. But if i save an agreement, it is updating the price agreement, If i again go to frame agreement and add another line item, it is again updating the price agreement record for already saved item giving duplicate entries.

I tried with these parameters

Can anyone suggest how to code such a way it will create a record if the line item is new and update a record if the line item is old?

Thanks in advance,

Prathyusha VJ.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Devashish,

Tried it as well but could not resolve.

There are two modes available in the structure for maintaining

ow_maint_mode_on_select  and db_mode with possible values A(create) and B (change).

I have passed both with different combinations but it is still creating duplicates.

Please suggest if you are aware of the exact value to be manitained for this mode.

Regards,

Prathyusha.

devashish_bhattacharya
Active Participant
0 Kudos

Pratyusha,

You might be missing some parameter...

Did you pass : REF_KIND ( Object Type ) ? [B   = Administration Item]

Regards,

Devashish

Former Member
0 Kudos

Hi Devashish,

i have passed ref_kind = 'B' as well but no use.

As of now, i am maintaining values based on the old and new item guid.

if the item guid is new, i am maintaining price agreements otherwise skip.

My only problem comes when user changes the conditional amount values of old item line..as without this logic, it will create duplicate entries.

If anyone had been successful with this price agreement maintenance, please share your thoughts if i am missing any other parameters. I have almost passed the few required.

Regards,

Prathyusha.

devashish_bhattacharya
Active Participant
0 Kudos

Hellp Pratyusha,

There might be a possiblity that you might need to pass the below field as well .

Please make a try with passing this field : mnt_ow_maint_mode_on_select.


wa_price_aggrements-mnt_ow_maint_mode_on_select = 'B'.


This is also present in the structure that you are passing to CRM_PRICE_AGRMNTS_MAINTAIN_OW function module.





Regards,

Devashish

devashish_bhattacharya
Active Participant
0 Kudos

Hi Janakipratyusha,

You can check if the record is new or not based on the order item guid that will be generating.

Based on this guid you can easily check if the line item is a new one or the one that needs updation.

After that, you can apply logic as :

IF Item is new :

--- loop

wa_price_agreements-db_mode = 'A'.  " To create new line item

endloop.

ELSE.

--- loop

wa_price_agreements-db_mode = 'B'.   " To update the line item

endloop.

Regards,

Devashish

Former Member
0 Kudos

Hi Devashish,

Thanks for your reply.

I have used the below statement to update if item is old

wa_price_agreements-db_mode = 'B'.

but it is still creating a new record.


Is there any other parameter that i need to pass to avoid creation for the second time?


Regards

Prathyusha VJ

devashish_bhattacharya
Active Participant
0 Kudos

Hi Pratyusha,

What reference are you giving to the FM so that it can know if the item is old or new?

Regards.

Devashish

Former Member
0 Kudos

Hi Devashish,

I am passing item guid to the FM.

Regards,

Prathyusha VJ.