ABAP顾问
分类:
2009-04-09 17:37:13
REPORT z_barry_mm03_gos .
TABLES: srgbtbrel, sood, soc3 .
DATA: itab_srgb LIKE TABLE OF srgbtbrel WITH HEADER LINE .
DATA: sortfield LIKE soc3-srtfd.
DATA: folder_id LIKE soodk ,
object_id LIKE soodk ,
objcont TYPE TABLE OF soli .
PARAMETERS: matnr LIKE mara-matnr .
AT SELECTION-SCREEN OUTPUT.
CALL FUNCTION 'SWU_OBJECT_REFRESH'
* EXPORTING
* OBJTYPE = 'BUS1001006'
.
IF NOT matnr IS INITIAL.
CALL FUNCTION 'SWU_OBJECT_PUBLISH'
EXPORTING
objtype = 'BUS1001006'
objkey = matnr
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2.
ENDIF.
START-OF-SELECTION.
SELECT * FROM srgbtbrel INTO TABLE itab_srgb
WHERE instid_a = matnr AND
typeid_a = 'BUS1001006' AND
catid_a = 'BO' AND
reltype = 'NOTE' AND
logsys_a = '' .
LOOP AT itab_srgb .
SELECT SINGLE * FROM sood
WHERE objtp = itab_srgb-instid_b+17(3) AND
objyr = itab_srgb-instid_b+20(2) AND
objno = itab_srgb-instid_b+22(12).
WRITE : / sood-file_ext ,
sood-objdes ,
sood-cronam ,
sood-crdat .
HIDE: itab_srgb-instid_b .
ENDLOOP .
AT LINE-SELECTION .
PERFORM downtxt.
*&---------------------------------------------------------------------*
*& Form showpic
*&---------------------------------------------------------------------*
FORM downtxt .
**方法一
CONCATENATE itab_srgb-instid_b+17(3) itab_srgb-instid_b+20(2)
itab_srgb-instid_b+22(12) INTO sortfield .
IMPORT objcont_tab = objcont FROM DATABASE soc3(dt) ID sortfield.
**方法二
* folder_id = itab_srgb-instid_b+0(17).
* object_id = itab_srgb-instid_b+17(17).
* CALL FUNCTION 'SO_OBJECT_READ'
* EXPORTING
* folder_id = folder_id
* object_id = object_id
* TABLES
* objcont = objcont.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\mm03.txt'
filetype = 'ASC'
TABLES
data_tab = objcont.
ENDFORM. "downtxt
如果需要得到图片等二进制类型的附件,需要再用SO_KPRO_DATA_FROM_OBJCONT_GET、SO_LOIO_PHIO_GET、SDOK_PHIO_LOAD_CONTENT等几个函数
SAP GOS:
chinaunix网友2010-06-23 14:47:35
谢谢,老白的答复。辛苦了。 我版本是46c,没有这个表srgbtbrel。 什么时候有空,请老白做一个46C里能实现的方法吧!!还有就要实现复制的效果。呵呵有点贪心。。。
qdbarry2010-06-22 23:44:45
REPORT z_barry_test . TABLES: srgbtbrel, sood, soc3 . DATA: obj_roleb TYPE borident , obj_rolea LIKE borident . PARAMETERS : matnr1 LIKE mara-matnr, matnr2 LIKE mara-matnr. START-OF-SELECTION. obj_rolea-objkey = matnr2. obj_rolea-objtype = 'BUS1001006'. SELECT SINGLE * FROM srgbtbrel WHERE instid_a = matnr1 AND typeid_a = 'BUS1001006' AND catid_a = 'BO' AND reltype = 'ATTA' AND logsys_a = '' . IF sy-subrc
chinaunix网友2010-06-22 14:54:51
老久没有到老白的blog留言了。这次问题一个GOS问题, 如何实现一个对象中附件拷贝到另外一个对象上?GOS的对象都是我自己定义,我用GOS实现了给对象上载附件。我现在的需求是我想在对象间拷贝附件。。我一直没有找到合适的方法。。。请老白指点一下,谢谢!!
chinaunix网友2009-04-09 19:00:30
**方法一 CONCATENATE itab_srgb-instid_b+17(3) itab_srgb-instid_b+20(2) itab_srgb-instid_b+22(12) INTO sortfield . IMPORT objcont_tab = objcont FROM DATABASE soc3(dt) ID sortfield. **方法二 * folder_id = itab_srgb-instid_b+0(17). * object_id = itab_srgb-instid_b+17(17). * CALL FUNCTION 'SO_OBJECT_READ' * EXPORTING * folder_id = folder_id * object_id = object_id * TABLES * objcont = objcont. 这儿就是啊