cancel
Showing results for 
Search instead for 
Did you mean: 

BADI or FM to modify the appointment description when creating an activity

Former Member
0 Kudos

Hello Experts,

We had a requirement where when the user creates an activity via the Web UI, the description of the Activity changes by adding the partner name together with the description filled by the user.  Take this example:

  • The user creates an activity
  • He/She fills the the description, say ABC, and other details(Date, Contact Person etc...)
  • When he/she saves the activity, the description of the activity changes to ABC-PARTNERNAME

Now when i check the calendar of the contact person, i should see an appointment.  We expected that the description of the Appointment would be ABC-PARTNERNAME but it remained as ABC.

So, my question is how to change the description of the Appointment same as the description(concatenation of the user description and partner name) of the activity.

For info, we created an implementation of the BADI ORDER_SAVE and used function modules CRM_ORDER_READ to read the order details etc.. and CRM_ORDER_MAINTAIN to save the changes.

Please help.

Thanks and best regards,

Thyaga

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello everyone,

To resolve the problem i mentioned, we simply put the code in the CHECK_BEFORE_SAVE method in the BADI implementation of ORDER_SAVE and it worked.  Now the concatenated description we had for the activity, we have the same when viewing the event in the calendar.

For info, CHECK_BEFORE_SAVE method is triggered twice, each after another one.  So we have to add a check so that we get the right concatenated text.

Thank you everyone for the help.

Best regards,

Thyaga

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Implement ORDER_SAVE BADI method IF_EX_ORDER_SAVE~PREPARE. You have GUID of the transaction saved in the importing parameter iv_guid. Now use the FM CRM_ORDER_READ to read the transaction details, for ex. the description, partners etc.,. This FM can read the data from buffer as the transaction itself is not saved yet. Now change the description field DESCRIPTION in the header as you need. Finally use the FM CRM_ORDER_MAINTAIN to save the transaction back. You don't need to run the commit statement in this BADI method.

Hope it helps.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravikiran,

Thank you for your response.  I already did exactly what you described.  But like i said, i modified the description of the activity by concatenating the partener name with the user description.  The problem is when i check the event in the calendar, the description of that event did not change i.e it did not take into consideration the concatenation.  It took only the user filled-description.

Is there some steps i am missing which is preventing the Appointment to get the concatenated text in the appointment description? 

Or is there another BADI implementation/FM/Class we could do to change the appointment description?

Any thoughts on that?

Thanks again

Regards

Thyaga

VishnAndr
Active Contributor
0 Kudos

Hello, Thyaga.

Did your activity actyally get desired description? I mean did the document have what you want as a description but in calendar only user's entered description shown? Or is it still the only entered description in the document and not concatenated one?

If the description of the document is still the entered one then please provide the coding which you've used in the BAdI to let the community help you.

Former Member
0 Kudos

Hello Andrei,

For example, the partner name is ABC.

When the user creates an activity, he enters XXA as description of the activity.  Now when he saves the document successfully gets the description as ABC-XXA, But when i check the calendar the Appointment description is only XXA.

So to answer your question, yes i get the desired description(concatenated text ABC-XXA).

But in the calendar i only get XXA

Please help

Thank you

Regards,

Thyaga

VishnAndr
Active Contributor
0 Kudos

Thyaga,

take a look at Note 1538114 - Activity description not displayed in calendar. May be it will fix your problem.

BTW, there are class CL_CRM_CALE_CALENDAR_IMPL (which is actually view controller class of CRM_CALENDAR component Calendar view) and method RETRIEVE_APPOINTMENTS which actually takes care of descriptios in calendar. And it combines account and description by itself. You do not need to duplicate this logic in any BAdI. At least if you don't mind any other uses of it.

Hope this will help you.

Former Member
0 Kudos

Hello Andrei,

We checked the SAP Note. Thank you very much. But we already implemented the support package, which means the corrections are already there.

Still no clue. But i am trying to see if i can use those classes you mentionned.

Thank you again,

Best Regards,

Thyaga