hi Find the code this was written by ABAPer .
ask your abaper to work with below code.
BAPI_DOCUMENT_CREATE2 BAPI function modue it is use full
type-pools sbdst .
data bds_doc_class type sbdst_classname.
data bds_files type sbdst_files.
data bds_file type bapifiles.
data bds_signature type sbdst_signature.
data bds_signat type bapisignat.
data bds_file_ext type toadd-doc_type.
data file_tab type filetable.
data split_tab type filetable.
data split_dat type file_table.
data split_cnt type i.
data file_count type i.
data file type file_table.
data return type i.
data attachment type borident.
data is_object type BORIDENT.
data EP_ATTACHMENT type BORIDENT-OBJKEY.
data documents type standard table of sood4.
data document type sood4.
data folder_id type sofdk.
types: begin of itab,
kunnr type kna1-kunnr,
fil_path(50) type c,
end of itab.
*parameters:
*p_kunnr type kunnr.
data:
ls_object_identity type borident,
lo_gos type ref to cl_gos_document_service,
itab1 type standard table of itab with header line,
wa_itab type itab.
itab1-kunnr = '0000000255'.
append itab1.
itab1-kunnr = '0000000256'.
append itab1.
itab1-kunnr = '0000000257'.
append itab1.
loop at itab1 into wa_itab.
ls_object_identity-objkey = wa_itab-kunnr. "e.g. '0000954410'.
ls_object_identity-objtype = 'KNA1'.
create object lo_gos.
call method lo_gos->create_attachment
exporting
is_object = ls_object_identity
importing
ep_attachment = ls_object_identity-objkey.
commit work.
endloop.