cancel
Showing results for 
Search instead for 
Did you mean: 

CL_CRM_DOCUMENTS

Former Member
0 Kudos
578

Hi,

Could u please tell me the purpose of the class: CL_CRM_DOCUMENTS and the method in that class GET_INFO_FOR_FOLDER.

Iam sure of Reward Points.

View Entire Topic
Former Member
0 Kudos

Hi Radhika,

You can use the class CL_CRM_DOCUMENTS for attachments to business transactions(like opportunities). You can use the method GET_INFO_FOR_FOLDER to retrieve the properties of the document already attached to the business transaction by passing the document id.

Thanks & Regards,

Karthik.

Former Member
0 Kudos

Hi,

I have to attach documents to a product in the Product master. I have the documents in the form of URL.Any suggestion to attach the URL to the Products programatically.

Thanks in advance.

Sure of Reward Points.

Former Member
0 Kudos

Hi Radhika,

You want to attach a document from URL like the URL maybe www.sap.com/sample.doc. In this case you can use CL_CRM_DOCUMENTS~CREATE_WITH_URL. The document maybe a doc, ppt, pdf or any.

Sample code,

data: ls_bus_obj type SIBFLPORB,

error type SKWF_ERROR.

data: lt_url type SDOKCNTASCS,

ls_url like line of lt_url.

ls_bus_obj-instid = give product guid.

ls_bus_obj-typeid = 'BUS1178'. (for products)

ls_bus_obj-catid = 'BO'.

ls_url-line = 'HTTP:www.sap.com/EVENTCONSUMER.DOC'.

append ls_url to lt_url.

CALL METHOD CL_CRM_DOCUMENTS=>CREATE_WITH_URL

EXPORTING

URL = lt_url

BUSINESS_OBJECT = ls_bus_obj

This will make the attachment from URL to products.

Regards,

Karthik.

Former Member
0 Kudos

Hi Karthik,

I tried this method and iam able to attach the URL but when Iam clicking on this URL Iam getting a error message like "Invalid Memory Category". What could be the reason for this????

Cheers,

Radhika.

Former Member
0 Kudos

Hi Karthik,

Thanks for ur response.

Now Iam able to attach the URL but the only thing is while displaying the document name it is displaying some 30 digit number. Actually it should display whatever we are giving in the ls_url-line right?? (It shud be 'HTTP:www.sap.com/EVENTCONSUMER.DOC' according to your example)

Thanks alot for ur help...

Former Member
0 Kudos

Hi Radhika,

For this use the method RENAME_OBJECT of the same class CL_CRM_DOCUMENTS after you call the method for attachment.

Your attachment method will return you LOIO which you can use in RENAME_OBJECT to give the name you desire.

Hope this helps.

Regards,

Karthik.

Former Member
0 Kudos

Hi Karthik,

Thankyou very much for your help Now I achieved Document name also.

One more doubt in the same requirement.

In COMMPR01 Iam displaying this URL in Documents tab.

Documents tab has a folder called DOCUMENTS.

This Documents folder has 2 folders under that, like PICTURES and TEXTS.

I need to display this URL under TEXTS folder but by using those methods iam able to attach the URL under DOCUMENTS folder itself but it should be under TEXTS.

Hope Iam clear

Thanks once again.

Former Member
0 Kudos

Hi Radhika,

In method CREATE_WITH_URL, fill the structure

PARENT_FOLDER with the appropriate values, so that your document gets stored in that folder.

Hope it helps.

Regards,

Karthik.

Former Member
0 Kudos

Hi Karthik,

See the following code

data: ls_bus_obj type SIBFLPORB,

error type SKWF_ERROR.

data: lt_url type SDOKCNTASCS,

ls_url like line of lt_url.

ls_bus_obj-instid = 'D351564E1124084A830F161F593EEF1B'.

ls_bus_obj-typeid = 'BUS1178'.

ls_bus_obj-catid = 'BO'.

data : lt_loio type SKWF_IO.

data : lt_iv_name type SKWF_DESCR.

ls_url-line = 'http://www.dictionary.com'.

append ls_url to lt_url.

lt_iv_name = 'Dictionary'.

CALL METHOD CL_CRM_DOCUMENTS=>CREATE_WITH_URL

EXPORTING

URL = lt_url

BUSINESS_OBJECT = ls_bus_obj

<b>PARENT_FOLDER =</b>

IMPORTING

LOIO = lt_loio.

CALL METHOD CL_CRM_DOCUMENTS=>RENAME_OBJECT

EXPORTING

IS_IO = lt_loio

IV_NAME = lt_iv_name.

Parent_folder ia a structure of type SKWF_IO. It has 3 components OBJTYPE, CLASS and OBJID.

What values should i pass to PARENT_FOLDER parameter??

Thanks in Advance.