Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7190688
  • 博文数量: 655
  • 博客积分: 10264
  • 博客等级: 上将
  • 技术积分: 8278
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-04 17:47
个人简介

ABAP顾问

文章分类

全部博文(655)

文章存档

2017年(2)

2014年(8)

2013年(3)

2012年(2)

2011年(18)

2010年(102)

2009年(137)

2008年(274)

2007年(134)

分类:

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:

阅读(6385) | 评论(6) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-04-09 18:24:53

我已经在transaction COR3中的attachment list里面得到了title(from table SOOD),如何得到双击后的内容啊?? 谢谢