Hi,
I have a requirement where we need to create marketing permissions on BA (Bill Account).
But conditions are : when you create a service contract on this BA and line items are added. For some rates/products on line item and their statuses we must add marketing permissions on BA.
The development is already done as follows:
We have created custom impl in order save Badi.
In this Impl we are calling a Z FM. which creates the marketing permissions.
Below FM is used to created the Mark. Permissions:
'CRM_BUPA_MKT_PERM_ADD' in standard table CRMM_BUT_MKTPERM.
But the issue is, when I create line item on service contract and if all the conditions are met then permission are created on BA.
now if I create another line item and save it another permission is created. In some cases, its reading the old mkt. permissions and trying to insert.
And that calls this FM : CRM_BUPA_MKT_PERM_SAVE_TABS, here if table it_but_mktperm_insert[] has same guid it dumps. and in my case the Guid is same though the FM is passing only single Guid.
That is causing Dump SAPSQL_ARRAY_INSERT_DUPREC. But this Dump is very intermittent. in some cases I add 5 line items and permission are created successfully. But If I create another it dumps. Not sure what causing this issue.
I am calling this fm :
CALL FUNCTION 'BUFFER_SUBSCRIBE_FOR_REFRESH'
EXPORTING
name_of_deletefunc = 'CRM_BUPA_MKT_PERM_CLEAR_BUFFER'.
to clear the buffer entries, still no use.
Can anybody share their inputs?
Thanks in advance!!
Sunita