Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FB03 : ATTACHMENT

gurunathkumar_dadamu
Active Contributor
0 Kudos

Hi Experts,

how to attach the HTML document dynamically for the respective BKPF documents in FB03.

Regards,

Gurunath Kumar D

1 ACCEPTED SOLUTION

former_member210252
Contributor

Hi Guru,

For attaching a BKPF document which is .htm file, you need to follow the below steps

1. From Presentation Sever  - Upload the file into an internal table of type soli in binary format

2. Application Server : Read the file in String format and convert the string format data to Xstring and then from XString to Binary format.

Use FM SO_OBJECT_INSERT - You need to pass the below parameters to it

CALL FUNCTION 'SO_OBJECT_INSERT'
           EXPORTING
             folder_id                  = l_fol_id
             object_hd_change           = x_obj_data
             object_type                = c_ext
             owner                      = sy-uname
           IMPORTING
             object_id                  = x_object_id
           TABLES
             objcont                    = i_bin_data
             objhead                    = i_objhead
           EXCEPTIONS
             active_user_not_exist      = 1
             communication_failure      = 2
             component_not_available    = 3
             dl_name_exist              = 4
             folder_not_exist           = 5
             folder_no_authorization    = 6
             object_type_not_exist      = 7
             operation_no_authorization = 8
             owner_not_exist            = 9
             parameter_error            = 10
             substitute_not_active      = 11
             substitute_not_defined     = 12
             system_failure             = 13
             x_error                    = 14
             OTHERS                     = 15.

Please let me know if you need any other information on this.

Regards,

Mohammed

2 REPLIES 2

former_member210252
Contributor

Hi Guru,

For attaching a BKPF document which is .htm file, you need to follow the below steps

1. From Presentation Sever  - Upload the file into an internal table of type soli in binary format

2. Application Server : Read the file in String format and convert the string format data to Xstring and then from XString to Binary format.

Use FM SO_OBJECT_INSERT - You need to pass the below parameters to it

CALL FUNCTION 'SO_OBJECT_INSERT'
           EXPORTING
             folder_id                  = l_fol_id
             object_hd_change           = x_obj_data
             object_type                = c_ext
             owner                      = sy-uname
           IMPORTING
             object_id                  = x_object_id
           TABLES
             objcont                    = i_bin_data
             objhead                    = i_objhead
           EXCEPTIONS
             active_user_not_exist      = 1
             communication_failure      = 2
             component_not_available    = 3
             dl_name_exist              = 4
             folder_not_exist           = 5
             folder_no_authorization    = 6
             object_type_not_exist      = 7
             operation_no_authorization = 8
             owner_not_exist            = 9
             parameter_error            = 10
             substitute_not_active      = 11
             substitute_not_defined     = 12
             system_failure             = 13
             x_error                    = 14
             OTHERS                     = 15.

Please let me know if you need any other information on this.

Regards,

Mohammed

0 Kudos

Thanks  a lot Rafi my problem got solved.

Regards,

Gurunath Kumar D