cancel
Showing results for 
Search instead for 
Did you mean: 

Upload Attachment to a contract in SRM

former_member396896
Participant
0 Kudos

Dear,

I have a requirement to download contracts from ECC and upload them into SRM. I am able to download contracts along with attachments. I am also creating contracts in SRM using FM "BBP_PD_CTR_CREATE". Can anybody tell me as how to upload attachments related to this contract. Shall I be using the parameter "IT_ATTACH"..? How to fill it up and where to keep the attachments (on presentation layer or application layer). Please help.

Thanx in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

yes, you need to use IT_ATTACH.

data can be in presentation server or in app server, but you need to fill the PHIO_CONTENT table with the bin content of the file..

former_member396896
Participant
0 Kudos

Dear Soumyaprakash,

Could you please elaborate on filling up PHIO_CONTENT. As the attachment could be any type of file (.pdf, .xls, .doc...).

What i have is the attachment at the presentation layer...! according to one of the post's the input parameters of IT_ATTACH were : ()

ls_attach-guid = lv_guid.

ls_attach-p_guid = ls_item-p_guid.(header or item guid)

ls_attach-loio_class = 'BBP_L_DOC'.

ls_attach_kw-phio_class = 'BBP_P_DOC'.

ls_attach_kw-phio_version_no = '00000001'.

ls_attach_kw-phio_ext = 'PDF'

ls_attach_kw-phio_fsize = '240'. (size)

ls_attach_kw-phio_mime = 'application/pdf'.

ls_attach_kw-phio_fname = lv_ext. ('name.pdf')

ls_attach_kw-phio_ps_mime = 'application/postscript'.

Unable to make it out what are the MIME parameters here.. whether to keep the attachment at application layer and use these parameters... or as mentioned by you to fill up the PHIO_CONTENT.

former_member396896
Participant
0 Kudos

Dear,

Is there a FM from which we can fill up PHIO_CONTENT tables....?

former_member396896
Participant
0 Kudos

HI,

We are having contract attachments as PDF's only in presentation layer. Could anyone please tell me as how to fill up the field IT_ATTACH-PHIO_CONTENT for FM BBP_PD_CTR_CREATE. As this requires data in binary format. How do i convert the attachment into the binary format..?

Any tips will be of great help.

Thanks.

Former Member
0 Kudos

PHIO content is a binary content , there was a thread couple of years back about how to attach document to business object. you can use the same cocept there..

there are two ways, create the PHIO object first and then pass the link to the document or pass the PHIO content directly in this FM.. If i get it from SDN i will post the link

Former Member
0 Kudos

Hello Mohd,

You can use below logic for filing IT_ATTACH-PHIO_CONTENT .

  • Converting to xsrting to RAW

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

EXPORTING

buffer = lv_pdf_file

append_to_table =X

TABLES

binary_tab = ls_attach_kw-phio_content.

lv_pdf_file is dervied from below logic for PDF from lt_otf (contains data)

Convert to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF''

IMPORTING

bin_filesize = lv_pdf_size

bin_file = lv_pdf_file

TABLES

otf = lt_otf

lines = lt_tdline

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

Regards,

Neelima

Former Member
0 Kudos

Hi Neelima,

Can you please tell me how to attach file in presentation server while creating a invoice.

I am using FM BBP_BAPI_IV_CREATE_IN for creating Invoice.

Regards,

Saravana Perumal

anupam_srivastava2
Participant
0 Kudos

Hi Mohd

How did the attachment for contract worked for you ?, I am having a similar issue, if you can help me with that, will be really great.

Regards

Anup