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

About BAPI_ACTIVITYCRM_CREATEMULTI

Hi, experts

I use the function 'BAPI_ACTIVITYCRM_CREATEMULTI' to create activity, but the 'date' parameters is not useful.

My code is as follows:

REFRESH : LT_HEADER ,LT_HEADERX ,LT_PARTNER ,

LT_PARTNERX ,LT_RETURN2,LT_CREATED_HEADER,lt_date,lt_datex .

CLEAR : WS_HEADER ,WS_HEADERX ,WS_PARTNER ,

WS_PARTNERX,ls_date,ls_datex .

CALL FUNCTION 'GUID_CREATE'

IMPORTING

EV_GUID_32 = EV_GUID_32.

LS_PROCESS_SETTINGS-MSGLEVEL = 8 .

LS_PROCESS_SETTINGS-SAVE = 'X' .

CALL FUNCTION 'BAPI_BUSPROCESSND_PROCSETTINGS'

EXPORTING

PROCESS_SETTINGS_IN = LS_PROCESS_SETTINGS

TABLES

RETURN = LT_RETURN2.

WS_HEADER-GUID = EV_GUID_32 .

WS_HEADER-PROCESS_TYPE = WS_DATA-PROCESS_TYPE .

WS_HEADER-DESCRIPTION = im_desc."WS_DATA-TEXT .

INSERT WS_HEADER INTO TABLE LT_HEADER .

WS_HEADERX-GUID = 'X' .

WS_HEADERX-PROCESS_TYPE = 'X' .

WS_HEADERX-DESCRIPTION = 'X' .

INSERT WS_HEADERX INTO TABLE LT_HEADERX .

SELECT SINGLE * FROM BUT000 into wa_but000

WHERE PARTNER = WS_DATA-PARTNER .

WS_PARTNER-REF_GUID = EV_GUID_32 .

WS_PARTNER-REF_KIND = 'A' .

WS_PARTNER-REF_PARTNER_HANDLE = '0001'.

WS_PARTNER-PARTNER_FCT = '00000009' .

WS_PARTNER-PARTNER_NO = wa_BUT000-PARTNER_GUID .

WS_PARTNER-NO_TYPE = 'BP' .

WS_PARTNER-DISPLAY_TYPE = 'BP' .

INSERT WS_PARTNER INTO TABLE LT_PARTNER .

CLEAR : WS_PARTNER .

WS_PARTNERX-REF_GUID = 'X' .

WS_PARTNERX-REF_KIND = 'X' .

WS_PARTNERX-REF_HANDLE = 'X' .

WS_PARTNER-NO_TYPE = 'X' .

WS_PARTNER-DISPLAY_TYPE = 'X' .

WS_PARTNERX-PARTNER_FCT = 'X' .

WS_PARTNERX-PARTNER_NO = 'X' .

INSERT WS_PARTNERX INTO TABLE LT_PARTNERX .

CLEAR WS_PARTNERX .

clear: wa_but000.

SELECT SINGLE * FROM BUT000 into wa_but000

WHERE PARTNER = WS_DATA-ZPARTNER_RESP .

WS_PARTNER-REF_GUID = EV_GUID_32 .

WS_PARTNER-REF_KIND = 'A' .

WS_PARTNER-REF_PARTNER_HANDLE = '0002'.

WS_PARTNER-PARTNER_FCT = '00000022' .

WS_PARTNER-PARTNER_NO = wa_BUT000-PARTNER_GUID .

WS_PARTNER-NO_TYPE = 'BP' .

WS_PARTNER-DISPLAY_TYPE = 'BP' .

INSERT WS_PARTNER INTO TABLE LT_PARTNER .

CLEAR : WS_PARTNER .

WS_PARTNERX-REF_GUID = 'X' .

WS_PARTNERX-REF_KIND = 'X' .

WS_PARTNERX-REF_HANDLE = 'X' .

WS_PARTNER-NO_TYPE = 'X' .

WS_PARTNER-DISPLAY_TYPE = 'X' .

WS_PARTNERX-PARTNER_FCT = 'X' .

WS_PARTNERX-PARTNER_NO = 'X' .

INSERT WS_PARTNERX INTO TABLE LT_PARTNERX .

CLEAR : WS_PARTNERX .

DATA: lv_timezone TYPE timezone.

CONSTANTS: lc_time(06) VALUE '000000'.

CALL FUNCTION 'GET_SYSTEM_TIMEZONE'

IMPORTING

timezone = lv_timezone

EXCEPTIONS

customizing_missing = 1

OTHERS = 2.

ls_date-REF_GUID = EV_GUID_32.

ls_date-ref_kind = 'A'.

  • ls_date-REF_HANDLE = '0001'.

ls_date-APPT_TYPE = '¼Æ»®ÈÕÆÚ'."'ORDERPLANNED'.

ls_date-timezone_from = lv_timezone.

ls_date-timezone_to = lv_timezone.

ls_date-date_from = im_date_from.

ls_date-date_to = im_date_to.

ls_date-time_from = lc_time.

ls_date-time_to = lc_time.

ls_date-mode = 'A'.

insert ls_date into table lt_date.

clear: ls_date.

ls_datex-ref_guid = 'X'.

ls_datex-ref_kind = 'X'.

  • ls_datex-REF_HANDLE = 'X'.

ls_datex-APPT_TYPE = 'X'.

ls_datex-timezone_from = 'X'.

ls_datex-timezone_to = 'X'.

ls_datex-date_from = 'X'.

ls_datex-date_to = 'X'.

ls_datex-time_from = 'X'.

ls_datex-time_to = 'X'.

ls_datex-mode = 'X'.

insert ls_datex into table lt_datex.

clear: ls_datex.

CALL FUNCTION 'BAPI_ACTIVITYCRM_CREATEMULTI'

TABLES

HEADER = LT_HEADER

HEADERX = LT_HEADERX

PARTNER = LT_PARTNER

PARTNERX = LT_PARTNERX

date = lt_date

datex = lt_datex

  • ORGANISATION =

  • ORGANISATIONX =

  • DATE =

  • DATEX =

  • TEXT =

  • TEXTX =

  • REASON =

  • REASONX =

  • OUTCOME =

  • OUTCOMEX =

  • STATUS =

  • STATUSX =

  • LOCATION =

  • LOCATIONX =

  • INPUT_FIELDS =

CREATED_PROCESS = LT_CREATED_HEADER

RETURN = LT_RETURN2

  • DOCUMENT_FLOW =

  • JOURNAL =

  • JOURNALX =

  • MATERIAL =

  • MATERIALX =

  • EXTENSIONIN =

.

DATA : LS_RETURN2 TYPE BAPIRET2 .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = LS_RETURN2.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 01:39 AM

    Hi, Experts

    Who can give me a example?

    Thanks you very much!

    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.