cancel
Showing results for 
Search instead for 
Did you mean: 

How to update Activity related data added via AET

0 Kudos

Hi All,

I need to create activity via report program.

I am planning to use BAPI BAPI_ACTIVITYCRM_CREATEMULTI to create activity.

I am able to fill the header, partner, dates details for the activity.

But there is one table/assignment block created via AET. When i open any existing activity in CRM_ORDER_READ report then in the output 

export parameter that ET_ZOBJXXXXXX01 is also there along with ET_PARTNER, ET_SURVEY etc.

My question is, how to pass this table details in the BAPI BAPI_ACTIVITYCRM_CREATEMULTI while creating the activity ?

This Ztable has some 6 z fields which i need to update while creating the activity.

for example: for Dates i am filling the following import parameter tables

Example:

*--->Set Dates

CLEAR: ls_date, lt_date.

ls_date-ref_guid = lv_guid.

ls_date-ref_kind = 'A'.

ls_date-appt_type = 'ORDERPLANNED'.

ls_date-timezone_from = 'GMTUK'.

ls_date-timezone_to = 'GMTUK'.

ls_date-date_from = '20120515'.

ls_date-date_to = '20120616'.

ls_date-time_from = '165334'.

ls_date-time_to = '175334'.

APPEND ls_date TO lt_date.

CLEAR: ls_datex, lt_datex.

ls_datex-ref_guid = true.

ls_datex-ref_kind = true.

ls_datex-appt_type = true.

ls_datex-timezone_from = true.

ls_datex-timezone_to = true.

ls_datex-date_from = true.

ls_datex-date_to = true.

ls_datex-time_from = true.

ls_datex-time_to = true.

APPEND ls_datex TO lt_datex.

How to fill the data for this ZOBJXXX01 table related data in to the BAPI ?

Reg,

Chetan S K

Accepted Solutions (0)

Answers (1)

Answers (1)

dharmakasi
Active Contributor
0 Kudos

Hi Chetan,

you can make use of the structure

EXTENSIONIN

LIKE0

BAPIPAREX

Pass your custom values to the above parameter,  i just given here similar kind of custom data passing in bapiparex structure. you can make of this logic to pass your custom fields while creating activity.

ls_bapirex-structure = lc_bape_vbap. "structure name(se11 structure type)

          ls_bapirex-valuepart1+0(10) = ls_orderadm_h-object_id.

          ls_bapirex-valuepart1+10(6) = lv_item_no.

          ls_bapirex-valuepart1+16(18) = lv_serial_no.

          APPEND ls_bapirex TO ct_bapiparex.(extensionn table)

You can pass custom fields fields in your custom structure generated by AET into valuepart1 in extensionin structure.

Best Regards,

Dharmakasi.

0 Kudos

Hi Dharmakasi,

Thanks for your response.

I tried to update the custom assignment block which is added via AET as you mentioned above

BUT the assignment block is empty in my newly created activity.

See the attached file. The extension table is different and there is seperate ET_ZOBJ table created for the assignment block which is created via AET. So i dont think this ET_ZOBJ object table will be filled when we update the  extensionin table.

Are you sure that this is the correct way to update the assignment block values which is added via AET tool ?

The ET_ZOBJXXXXX table structure ZTABXXXXX_BOL_ATTR has the following fields

RECORD_ID  type CRMT_OBJECT_GUID    RAW 16

PARENT_ID   type CRMT_OBJECT_GUID    RAW 16

zzfldXXXX1    type CHAR40   First name

zzfldxxxxx2     type char10      last name and so on...

while filling the structure, i am taking 32 characters as the guid is RAW 16 but it is 32 char output.

**--->Get GUID for Visitor details

   CALL FUNCTION 'CRM_GUID_CREATE'

     IMPORTING

       ev_guid = lv_guid.  " Header Guid

**--->Get GUID for Visitor details

   CALL FUNCTION 'CRM_GUID_CREATE'

     IMPORTING

       ev_guid = lv_record_id.

CLEAR:ls_bapiparex.

   ls_bapiparex-structure = 'ZTABXXXXX_BOL_ATTR'.  "SE11 structure

   ls_bapiparex-valuepart1+0(32) = ls_visitor-record_id.    "Record Guid

   ls_bapiparex-valuepart1+32(32) = ls_visitor-parent_id.  "Passing the Header Guid

   ls_bapiparex-valuepart1+64(32) = ls_visitor-object_id.   "Passing the Header Guid

   ls_bapiparex-valuepart1+96(16) = ls_visitor-zzfld00000q." = '2016 '.

   ls_bapiparex-valuepart1+112(40) = ls_visitor-zzfld00000r. " = 'Chetan'.

   ls_bapiparex-valuepart1+152(10) = ls_visitor-zzfld00000s. " = 'SK'.

   ls_bapiparex-valuepart1+162(16) = ls_visitor-zzfld00000t. " = 'XXXXXXX'.

   ls_bapiparex-valuepart1+178(16) = ls_visitor-zzfld00000u. " = 'XXXXXXX.

   ls_bapiparex-valuepart1+194(16) = ls_visitor-zzfld00000w. " = 'XXXXXXX.

   ls_bapiparex-valuepart1+210(16) = ls_visitor-zzfld00000x. " = 'XXXX'.

   ls_bapiparex-valuepart1+226(8) = ls_visitor-zzfld00000y. " = SY-DATUM.

   ls_bapiparex-valuepart2+0(8)   = ls_visitor-zzfld00000z. " = SY-DATUM + 2.      " Filling valuepart2 Because valuepart1 Field is 240 char long

   ls_bapiparex-valuepart2+8(4) = ls_visitor-zzfld000011. " = '0001'. "Male

   ls_bapiparex-valuepart2+12(3) = ls_visitor-zzfld000014. " = 'AE'.  

   APPEND ls_bapiparex TO lt_bapiparex.

The activity which i am creating has all the details Header, Dates, Partner, Status BUT not updating the ET_ZOBJXXXX table data.

In other words, the assignment block which is added via AET tool is not getting updated with the values i am passing while creating the activity.

Any suggestion or correction please let me know....

Regards,

Chetan S K

The

dharmakasi
Active Contributor
0 Kudos

Hi,

Ideally when we create documents using BAPI fms we will be passing custom fields to bapirex structure.

i hope you are creating new record id for each entry in table and apart from that try to while using valuepart2, you have to utilize full 240 characters then only u can use the next value part.

ls_bapiparex-valuepart1+237(3)      = ls_customer_i-zzfld000001.

      ls_bapiparex-valuepart2+0(7)       = ls_customer_i-zzfld000001+3(7).


If still not able to achieve your requirement let me know there is another alternate. You can make use of call back function module. You can register one call back FM and pass all your custom aet fields table to crm_order_maintain et_extension2 parameter.

Let me know if you need more help here.


Best Regards,

Dharmakasi.



praveen_kumar194
Active Contributor
0 Kudos

if you added a table through AET, you can use CRM_ORDER_MAINTAIN. there are two enhancement parameters.

Please create the activity from web ui and enter values in your AET AB. put a break point in CRM ORDER MAINTAIN

you will come to know how to fill these values.

one more thing is place break point also in the FM you intend use. if it tirggers, then you will come to know how use the extension parameter.

I have already used CRM ORDER MAINTAIN to main the values.

hope it helps.

0 Kudos

Hi Dharmakasi and Praveen,

Thanks for your responses.

I was on long vacation and hence did not work on this object.

Will check and revert//

Thanks for your valuable inputs//

Regards,

Chetan S K

samantak_chatterjee
Active Contributor
0 Kudos

Hi Chetan,

It's always better to use the CRM_ORDER_MAINTAIN as mentioned by Praveen. But how many activities you will create using the Report program ? Incase of multiple creation, please make sure that you call the One Order API only once after populating all the data.

I think that since the data model has been enhanced by AET, these fields will be present as a part of the One Order Data model. So, you can easily populate these structures with the values and API will take care of the rest.

Be cautious about using the One Order API and use it by ensuring that proper performance guidelines are maintained.

Hope this helps.

Best Regards,

Samantak.