从sap系统中把照片读取出来通过gateway在web IDE上实现
准备:
1、Eclipse(可以创建OData Implementation Project)参考:http://scn.sap.com/community/developer-center/mobility-platform/blog/2015/02/10/understanding-rest-d... 用来创建OData module
2、Sap系统
3、Smp
4、Web ide
步骤:
1、在eclipse里面创建一个OData module,file -> new ->SAP Mobile Platform OData Implementation Project
如下图所示:

创建完上诉OData module,将这个导出成xml文件,
2、在sap的segw事务代码里面创建服务。具体参考:http://scn.sap.com/community/gateway/blog/2013/02/22/how-to-read-photo-from-sap-system-using-sap-net...
在这个过程当中你也许会遇到以下问题:
你可以读取出EmployeeData,但是读取不出EmployeePhoto,这个时候你就可以去sap的/ospro事务代码,点击SAP参考IMG

然后按照以下路劲找到clear cache 运行完了,再去读取一遍EmployeePhoto就可以读取出来。

3、在smp里面新建一个applications:
如下图所示:
(1)、

(2)、

Endpoiont是
http://ecc-ides.zjenergy.com.cn:8000/sap/opu/odata/ZMEDIALNK_SB002_SRV/
(3)、

(4)、

URL:
http://ecc-ides.zjenergy.com.cn:8000/sap/opu/odata/sap/ZMEDIALNK_SB002_SRV/
4、
在web ide里面将图片显示出来
在C:\SAPWebIDE\eclipse\config_master\service.destinations\destinations这个路径下添加下面这个文件
Description=ids
Type=HTTP
TrustAll=true
Authentication=NoAuthentication
WebIDEUsage=odata_gen
Name=ids
ProxyType=Internet
URL=http\://ecc-ides.zjenergy.com.cn\:8000
WebIDEUsage=odata_abap,ui5_execute_abap,dev_abap
WebIDESystem=IDS
WebIDEEnabled=true
这个可以参考:How To Install SAP Web IDE Locally for Trial in Windows
添加完重启web ide
再新建一个web ide工程
Service如下所示

由于提供的是form形式
在js的初始化程序里面添加
this.getView().bindElement("/EmployeePhotoSet('28001')");
这行代码
在view里面
<Image src="{Uri}"></Image>
就能够把照片输出