需求为在自定义采购对账单平台做预制发票时,可以使用添加附件的功能;其他情况查看对账单时,允许查看附件不允许添加附件
这里主要使用了系统标准函数GOS_ATTACHMENT_LIST_POPUP,代码如下:
*&---------------------------------------------------------------------* *& Form frm_upload_file *&---------------------------------------------------------------------* *& text *&---------------------------------------------------------------------* *& --> p1 text *& <-- p2 text *&---------------------------------------------------------------------* FORM frm_upload_file . DATA: ls_object TYPE sibflporb, lv_mode TYPE c. ls_object-instid = gs_head-zsoa_id. "对账单作为唯一标识 ls_object-typeid = 'ZSOA'. "自定义对账单类型 ls_object-catid = 'BO'. "固定填BO "预制发票时可编辑,其他为显示 lv_mode = COND #( WHEN r_inv = 'X' THEN 'C' ELSE 'D' ). CALL FUNCTION 'GOS_ATTACHMENT_LIST_POPUP' EXPORTING is_object = ls_object ip_check_arl = 'X' ip_check_bds = 'X' ip_notes = 'X' ip_attachments = 'X' ip_urls = 'X' ip_mode = lv_mode. IF sy-subrc = 0. MESSAGE s001(00) WITH TEXT-m35 DISPLAY LIKE 'S'. ELSE. MESSAGE s001(00) WITH TEXT-m34 DISPLAY LIKE 'E'. ENDIF. ENDFORM.
在系统表SRGBTBREL可以找到添加附件的记录
标签:&---------------------------------------------------------------------,text, From: https://www.cnblogs.com/StephenAmell/p/18024856