cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic attribute

Former Member
0 Kudos

Hello,dear experts.

I need to create membership for new types of clients, whose have certain service. So i need to create a dynamic attribute and show this attribute on the membership on bp. I create attribute in spro, mark it as active in loyalty program in loy_pro, stearted custom program to update dynamic attributes. but i cannot see added attribute on the membership and current attributes are not bupdated. So what am I doing wrong? Did i missed something in customization or forgot add some parameters somewhere? I need to show this attribute on membersip.

Thank you in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Saurabh_Kabra
Participant
0 Kudos

Hi Ayrat,

There as 2 ways to modify the dynamic attributes of membership:

1.    At first get the data for membership for which you want to update attributes. For this you can use FM CRM_LOY_MEMS_DYN_ATTR_GBPK or table LOYD_MSH_MSDYN. Once you get this data then prepare a internal table which will be a copy of data retrieved from FM call or table. In this table pass the new data to be updated. like pass Process Mode as 'M' for modification, and Value will contain new value, Name as Dynamic attribute name application as MSH etc.Then call FM CRM_LOY_MEMS_DYN_ATTR_PUT to update the data.

Then call method CRM_LOY_MEMS_DYN_ATTR_SAVE to save your changes. And if you are running a report program then user BAPI_TRANSACTION_COMMIT to commit your changes at database level.

2.     Use FM LOY_MSH_MEMSDYN_UPDATE_FM to update the dynamic attributes. Here pass ref GUID as Membership GUID, Application as MSH, Name as dynamic attribute ID and Value as dynamic attribute value. Generate a GUID using GUID_CREATE FM to pass as GUID of this FM and call FM to update the data base table.

Let know in case if you face any issue here.

Thanks

Saurabh Kabra

Former Member
0 Kudos

Today tried to create new dynamic attribute. Ok, create, set it into loyalty program. As I understood, even we do not have value for attribute in membership, attribute should be shown there. But when I look at membership, there is no this attribute. Also it is not created in loyd_msh_msdyn table. Found  sap note 1990557, but there no info how to solve. Maybe you, Sap Experts, can help me to solve this issue?

P.S. how to manually set value for dynamic attribute?

Saurabh_Kabra
Participant
0 Kudos

Hi Ayrat,

I think if you pick above mentioed approach it should hel;p you out but I think you might have missed FM call BAPI_TRANSACTION_COMMIT to commit the changes in databse.

and before calling the commit you also need to save the attribute by calling FM CRM_LOY_MEMS_DYN_ATTR_SAVE.

In case you still feel any issue then please paste your code here may be i can try out some thing?

Thanks

Sauabh Kabra

Former Member
0 Kudos

so, you think, that when i am run  this FM's, th dynamic attribute will be shown in webUI on bp?

Saurabh_Kabra
Participant
0 Kudos

Yes it should and it will work if you use it properly (Like SAVE of changes and then commit if required) because I have used this in past. If you need I can give you a sample code.

Former Member
0 Kudos

yes, please, could you show me example of your code, if it is possible?