此文参考:https://wiki.scn.sap.com/wiki/display/ABAP/GOS+-+Attachments+to+SAP+Documents
用GUI_UPLOAD选择上传文件.
附件数据库表为:SRGBTBREL,可以通过此表确定对应附件的OBJECT TYPE。
可通过修改参数实现,对采购申请,财务凭证,资产号等sap对象的标准附件上传。
*&---------------------------------------------------------------------*
*& Report ZGOS_ATTACHMENT
*&
*&---------------------------------------------------------------------*
*&this program will attach documents to SAP documents.
*&
*&---------------------------------------------------------------------*
report zgos_attachment.
*Macros.
include <cntn01>.
swc_container lt_message_container.
*top dec.
type-pools: slis, abap, truxs.
data: g_objid type ydmfw_objid,
gt_filename type standard table of dxfilep with header line,
wa_filename type dxfilep,
gt_bin type solix occurs 0,
wa_bin type solix,
g_filename type string,
l_obj type swc_object,
gs_obja type borident,
gs_objb type borident,
gs_binrel type gbinrel,
&