Skip to Content
author's profile photo Former Member
Former Member

Adding BP to existing Acitivity?

Folks below is the code i have used to add a business partner to an activity. iam not getting any error return messages but the BP is not attached to the activity. refer the code and let me know if im missing anything.

  • Fill the header information

lf_header-guid = l_objnr.

lf_header-mode = 'B'.

APPEND lf_header TO lit_header.

lf_headerx-guid = 'X'.

lf_headerx-mode = 'X'.

APPEND lf_headerx TO lit_headerx.

lf_partner-ref_guid = l_objnr.

lf_partner-ref_kind = 'A'.

lf_partner-partner_fct = 'Z_EMP'.

lf_partner-kind_of_entry = 'C'.

lf_partner-display_type = 'BP'.

lf_partner-no_type = 'BP'.

lf_partner-partner_no = l_partner.

APPEND lf_partner TO lit_partner.

lf_partnerx-ref_guid = 'X'.

lf_partnerx-ref_kind = 'X'.

lf_partnerx-partner_fct = 'X'.

lf_partnerx-kind_of_entry = 'X'.

lf_partnerx-display_type = 'X'.

lf_partnerx-no_type = 'X'.

lf_partnerx-partner_no = 'X'.

APPEND lf_partnerx TO lit_partnerx.

  • * Changing the reason

CALL FUNCTION 'BAPI_ACTIVITYCRM_CHANGEMULTI'

TABLES

header = lit_header

headerx = lit_headerx

partner = lit_partner

partnerx = lit_partnerx

return = lit_return.

lf_to_save-guid = l_objnr.

APPEND lf_to_save TO lit_to_save.

  • Save the changes in the BAPI Save

CALL FUNCTION 'BAPI_ACTIVITYCRM_SAVE'

TABLES

objects_to_save = lit_to_save

saved_objects = lit_saved

return = lit_return.

  • Saving the changes in the transaction

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 10:43 PM

    My bad. i got it.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.