Skip to Content
0
Former Member
Jun 14, 2016 at 10:23 AM

Attachment not getting opened in FB03

742 Views

Dear Freinds,

I have a requirement where in have to attach the documents in PDF through my Program in FB03.

I am successfully able to attach the document i.e when execute my program & view in the Attachment list of FB03 i can see the Attachment .

But however when i double click iam unable to open and it is giving me error "Windows cannot find 'D:\Data\FB03\June\XXX_DATE.PDF"

Here the XXXX is my company code.

Could any one please

Step 1 )

CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'

EXPORTING

region = 'B'
IMPORTING

folder_id = gv_folder

EXCEPTIONS

communication_failure = 1

owner_not_exist = 2

system_failure = 3

x_error = 4

OTHERS = 5.

Step 2)

gv_object-objla = 'EN'.

gv_object-objnam = 'MESSAGE'.

CONCATENATE '&KEY&' wa_url-line INTO wa_content-line.

APPEND wa_content TO It_content.

CALL FUNCTION 'SO_DOCUMENT_INSERT'

EXPORTING

parent_id = gv_folder

object_hd_change = gv_object

document_type = 'URL'

IMPORTING

document_id = lv_doc

TABLES

objcont_text = It_content

EXCEPTIONS

active_user_not_exist = 1

dl_name_exist = 2

folder_not_exist = 3

folder_no_authorization = 4

object_type_not_exist = 5

operation_no_authorization = 6

owner_not_exist = 7

parameter_error = 8

substitute_not_active = 9

substitute_not_defined = 10

x_error = 11

OTHERS = 12.



IF sy-subrc EQ 0.

wa_objecta-instid = gv_instid.

wa_objecta-typeid = cn_bkpf.

wa_objecta-catid = cn_bo.



CONCATENATE lv_folder-objtp lv_folder-objyr lv_folder-objno lv_doc-objtp lv_doc-objyr lv_doc-objno

INTO wa_objectb-instid.



wa_objectb-typeid = 'MESSAGE'.

wa_objectb-catid = 'BO'.



TRY.

CALL METHOD cl_binary_relation=>create_link

EXPORTING

is_object_a = wa_objecta

is_object_b = wa_objectb

ip_reltype = 'URL'

IMPORTING

ep_link_id = tbl_links

eo_property = tbl_role.



CATCH cx_obl_parameter_error .

CATCH cx_obl_model_error .

CATCH cx_obl_internal_error .

ENDTRY.

CLEAR : tbl_links, tbl_role,it_tmp_date,e_gjahr.

ENDIF.

ENDLOOP.

COMMIT WORK AND WAIT.

Note :However when i upload the same .pdf file in the FB03 i am able to view it when i double click .

Could any one please correct me where iam missing in my code .

Thanks & Regards

Syamala

ENDIF.