cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Attachments in SC

former_member610985
Participant
0 Kudos

Hello Experts,

I have a requirement of adding attachment during SC creation. The SC is created using FM: BBP_PD_SC_UPDATE, which has the import parameter lt_attach in which i am passing the following values:

   ls_attach-guid                              = lv_guid.

   ls_attach-p_guid                          = ls_item-guid. "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               = '2400'.       "(size)

   ls_attach_kw-phio_mime              = 'application/pdf'.

   ls_attach_kw-phio_fname             = lv_fname.      "('name.pdf')

   ls_attach_kw-phio_ps_mime         = 'application/postscript'.

   ls_attach_kw-PHIO_CONTENT[]  = lt_content[].

The hexadecimal content is passed in the lt_content.

Once the SC and PO is created and ordered. When we try to open the attachment in PO, the file (PDF/doc) is not opening as it gets corrupted.

What would be the problem here, is there any other way of doing the attachment. Please assist me in solving this issue.

Thanks

Arun.

Accepted Solutions (1)

Accepted Solutions (1)

oliver_wurm
Active Participant
0 Kudos

Hi Arun,

is the Parameter phio_fsize really set to 2400? it Needs to have the exact file length in Byte. If that is not the issue I would recommend to save the Content of LT_CONTENT[] to a local file and see if the file is corrupted as well. If yes I would concentrate on the Coding that populates LT_CONTENT[].

Regards

Oliver

former_member610985
Participant
0 Kudos

Hi Oliver,

I have passed the correct length in phio_fsize and also tried saving the content in a local file and that file is opening. But still i am facing the same issue.

Thanks

Arun.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arun .

Could you please trying opening the attachements at SC level and see whether they are corrupted or not ?

if they not getting corrupted then probably in while creating PO ( Change Badi ) we can fetch SC attachments and pass it to PO.

Let me know if this works.

Regards,

Binay

former_member610985
Participant
0 Kudos

Hi Binay,

Actually the file is getting corrupted at SC level itself.

Thanks,

Arun.