日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

如何将SAP数据传输到其他系统(Transferring Data from SAP to Other Systems)

發(fā)布時間:2023/12/10 windows 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何将SAP数据传输到其他系统(Transferring Data from SAP to Other Systems) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

在sap里有GUI_DOWNLOAD?函數(shù)將sap的數(shù)據(jù)下載到客戶端機器(presentation server),而Dataset則是將數(shù)據(jù)傳輸?shù)綉梅掌?#xff08;Application server)。然而在有些時候需要將數(shù)據(jù)傳輸?shù)降谌狡渌到y(tǒng)(3rd Party System),這是我們就可以使用FTP命令來完成數(shù)據(jù)傳輸。

1、相關函數(shù)
HTTP_SCRAMBLE
FTP_CONNECT
FTP_R3_TO_SERVER
FTP_DISCONNECT
RFC_CONNECTION_CLOSE

2、函數(shù)說明
HTTP_SCRAMBLE: 將密碼轉化為SAP的格式
樣例代碼
l_pwd = p_pwd.
l_slen = STRLEN( l_pwd ).
CALL FUNCTION 'HTTP_SCRAMBLE'
exporting
? source = l_pwd
? sourcelen = l_slen
? key = c_key
importing
? destination = l_pwd.

FTP_CONNECT : 連接其他系統(tǒng)
* To Connect to the Server using FTP
樣例代碼
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
? user = p_user
? password = l_pwd
? host = p_host
? rfc_destination = c_dest
IMPORTING
? handle = w_hdl
EXCEPTIONS
? OTHERS = 1.
IF sy-subrc <> 0.
? MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
? WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

FTP_R3_TO_SERVER: 將SAP的內表數(shù)據(jù)按字符方式傳輸?shù)狡渌到y(tǒng).
樣例代碼
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
? handle = w_hdl
? fname = <file path of destination system>
? character_mode = 'X'
TABLES
? text = <internal table data>
EXCEPTIONS
? tcpip_error = 1
? command_error = 2
? data_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
? MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
? WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
? RAISING invalid_output_file.
ENDIF.

FTP_DISCONNECT: 關閉SAP與其他系統(tǒng)的連接.
樣例代碼
* To disconnect the FTP
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
? handle = w_hdl.

RFC_CONNECTION_CLOSE:關閉SAP與其他系統(tǒng)的RFC連接.
樣例代碼
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
? destination = c_dest
EXCEPTIONS
OTHERS = 1.

3、SAP的樣例代碼
report rsftp004.

parameters: suser(30) type c lower case,
??????????? spwd(30) type c lower case,
??????????? shost(64) type c lower case,
??????????? duser(30) type c lower case,
??????????? dpwd(30) type c lower case,
??????????? dhost(64) type c lower case,
??????????? lines type i default 1000,
??????????? pasv.
selection-screen skip 1.
parameters: dest like rfcdes-rfcdest default 'SAPFTP'.

types: begin of text,
?????? line(120) type c,
?????? end of text.

types: begin of blob,
?????? line(80) type x,
?????? end of blob.

data: shdl type i,
????? dhdl type i,
????? key type i value 26101957,
????? slen type i,
????? bline(80) type x,
????? sdocid like sysuuid-c,
????? ddocid like sysuuid-c,
????? blob_length type i,
????? cmd(120),
????? error.

data: result type table of text with header line,
????? bindata type table of blob with header line.

* Create data

set extended check off.
error = 0.
bline = '0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F' &
??????? '0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F' &
??????? '0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F' &
??????? '0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F'.

do lines times.
? bindata-line = bline.
? append bindata.
enddo.

call function 'SYSTEM_UUID_C_CREATE'
? importing
??? uuid = sdocid.

call function 'SYSTEM_UUID_C_CREATE'
? importing
??? uuid = ddocid.

* connect to ftp server - source

slen = strlen( spwd ).

call function 'HTTP_SCRAMBLE'
? exporting
??? source????? = spwd
??? sourcelen?? = slen
??? key???????? = key
? importing
??? destination = spwd.

call function 'SAPGUI_PROGRESS_INDICATOR'
? exporting
??? text = 'Connect to FTP Server - Source'.

call function 'FTP_CONNECT'
? exporting
??? user??????????? = suser
??? password??????? = spwd
??? host??????????? = shost
??? rfc_destination = dest
? importing
??? handle????????? = shdl.

* connect to ftp server - destination

slen = strlen( dpwd ).

call function 'HTTP_SCRAMBLE'
? exporting
??? source????? = dpwd
??? sourcelen?? = slen
??? key???????? = key
? importing
??? destination = dpwd.

call function 'SAPGUI_PROGRESS_INDICATOR'
? exporting
??? text = 'Connect to FTP Server - Destination'.

call function 'FTP_CONNECT'
? exporting
??? user??????????? = duser
??? password??????? = dpwd
??? host??????????? = dhost
??? rfc_destination = dest
? importing
??? handle????????? = dhdl.

if not pasv is initial.
? refresh result.

? call function 'FTP_COMMAND'
??? exporting
????? handle??????? = shdl
????? command?????? = 'set passive on'
??? tables
????? data????????? = result
??? exceptions
????? tcpip_error?? = 1
????? command_error = 2
????? data_error??? = 3.

? if sy-subrc eq 0.
??? write: / 'Set passive mode - Source'.
? endif.

? refresh result.

? call function 'FTP_COMMAND'
??? exporting
????? handle??????? = dhdl
????? command?????? = 'set passive on'
??? tables
????? data????????? = result
??? exceptions
????? tcpip_error?? = 1
????? command_error = 2
????? data_error??? = 3.

? if sy-subrc eq 0.
??? write: / 'Set passive mode - Destination'.
? endif.
? skip 1.

endif.

* Create file on Source

blob_length = lines * 80.

call function 'SAPGUI_PROGRESS_INDICATOR'
? exporting
??? text = 'Create File on Source'.

call function 'FTP_R3_TO_SERVER'
? exporting
??? handle????? = shdl
??? fname?????? = sdocid
??? blob_length = blob_length
? tables
??? blob??????? = bindata.

* Copy Files

call function 'SAPGUI_PROGRESS_INDICATOR'
? exporting
??? text = 'Copy File to Destination'.

refresh result.

call function 'FTP_COPY'
? exporting
??? handle_source????? = shdl
??? handle_destination = dhdl
??? file_source??????? = sdocid
??? file_destination?? = ddocid
? tables
??? data?????????????? = result
? exceptions
??? tcpip_error??????? = 1
??? command_error????? = 2
??? data_error???????? = 3
??? others???????????? = 4.

if sy-subrc ne 0. error = 1. endif.

loop at result.
? write / result-line.
endloop.

* compare content

if error eq 0.

? call function 'SAPGUI_PROGRESS_INDICATOR'
??? exporting
????? text = 'Compare Content'.

? skip 1.
? refresh bindata.

? call function 'FTP_SERVER_TO_R3'
??? exporting
????? handle????? = shdl
????? fname?????? = sdocid
??? importing
????? blob_length = blob_length
??? tables
????? blob??????? = bindata.

? slen = lines * 80.

? if slen ne blob_length.
??? error = 1.
??? write: / 'Length error - expected',slen,'received',blob_length.
? else.
??? loop at bindata.
????? if bindata-line ne bline.
??????? slen = sy-tabix * 80.
??????? write: / 'Content error at',slen,bindata-line.
??????? error = 1.
??????? exit.
????? endif.
??? endloop.
? endif.

? refresh bindata.

? call function 'FTP_SERVER_TO_R3'
??? exporting
????? handle????? = dhdl
????? fname?????? = ddocid
??? importing
????? blob_length = blob_length
??? tables
????? blob??????? = bindata.

? slen = lines * 80.

? if slen ne blob_length.
??? error = 1.
??? write: / 'Length error - expected',slen,'received',blob_length.
? else.
??? loop at bindata.
????? if bindata-line ne bline.
??????? slen = sy-tabix * 80.
??????? write: / 'Content error at',slen,bindata-line.
??????? error = 1.
??????? exit.
????? endif.
??? endloop.
? endif.

? if error eq 0.
??? write: / 'Content compare OK'.
? else.
??? write: / 'Content compare error'.
? endif.
? skip 1.

endif.

* Delete

concatenate 'del' sdocid into cmd separated by ' '.
refresh result.

call function 'SAPGUI_PROGRESS_INDICATOR'
? exporting
??? text = 'Delete Files'.

call function 'FTP_COMMAND'
? exporting
??? handle??????? = shdl
??? command?????? = cmd
? tables
??? data????????? = result
? exceptions
??? tcpip_error?? = 1
??? command_error = 2
??? data_error??? = 3.

loop at result.
? write / result-line.
endloop.

concatenate 'del' ddocid into cmd separated by ' '.
refresh result.

call function 'FTP_COMMAND'
? exporting
??? handle??????? = dhdl
??? command?????? = cmd
? tables
??? data????????? = result
? exceptions
??? tcpip_error?? = 1
??? command_error = 2
??? data_error??? = 3.

loop at result.
? write / result-line.
endloop.

* Disconnect
call function 'FTP_DISCONNECT'
? exporting
??? handle = shdl.
call function 'FTP_DISCONNECT'
? exporting
??? handle = dhdl.

call function 'RFC_CONNECTION_CLOSE'
? exporting
??? destination = dest
? exceptions
??? others = 1.

if error ne 0.
? format color col_negative.
? write: / 'Error im Test'.
else.
? format color col_positive.
? write: / ' Test OK'.
endif.

* password not visible

at selection-screen output.

? loop at screen.
??? if screen-name = 'SPWD' or screen-name = 'DPWD'.
????? screen-invisible = '1'.
????? modify screen.
??? endif.
? endloop.

轉載于:https://www.cnblogs.com/xiaomaohai/archive/2007/01/25/6157417.html

總結

以上是生活随笔為你收集整理的如何将SAP数据传输到其他系统(Transferring Data from SAP to Other Systems)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 欧美日韩亚洲国产另类 | 久色福利 | 亚洲欧洲一区二区在线观看 | 五月婷婷在线观看视频 | 免费黄色av电影 | 国产真人无码作爱视频免费 | 亚洲高清在线 | 精品乱子一区二区三区 | 九九香蕉视频 | 亚洲成人精选 | 欧美日韩三级在线观看 | 国产精品天天狠天天看 | jzzijzzij日本成熟少妇 | 亚洲一级黄色大片 | 草色噜噜噜av在线观看香蕉 | 日韩一区二区三区在线免费观看 | 五月天综合久久 | 亚洲av成人无码一二三在线观看 | 网站在线观看你懂的 | 黄色av小说在线观看 | 国产精品无码免费专区午夜 | 毛片.com | 一区二区三区在线 | 日本福利视频导航 | 熟妇人妻久久中文字幕 | 国产情侣啪啪 | 中文字幕精品三级久久久 | 国产三级在线观看视频 | 国产精品一区二区毛片 | 亚洲五月六月 | 亚洲va韩国va欧美va精品 | 可以在线观看的黄色 | 日本成人在线不卡 | 久久成人精品 | 免费福利影院 | av日韩在线播放 | 国产精品久久久久久久裸模 | av黄色小说| 国产视频第三页 | 日产精品久久久久久久蜜臀 | 色欲久久久天天天综合网 | 国产在线一二 | 91久久精品www人人做人人爽 | 国产久久精品 | 无码无套少妇毛多18pxxxx | 中国男人操女人 | 97精品国产97久久久久久免费 | 久久国产精品国语对白 | 爱逼av| 欧美一区二区三区不卡视频 | 国产精品久久久久毛片大屁完整版 | 香蕉久久久久久 | 亚洲av色一区二区三区精品 | 日韩午夜视频在线观看 | 草草视频网站 | 日本69少妇 | 亚洲欧美视频 | 日韩欧美一区二区免费 | 欧美日韩在线免费看 | 国产性猛交xxxⅹ交酡全过程 | 亚洲精品视频一二三区 | 一级黄色片视频 | 亚洲一级黄色片 | 中文字幕在线网 | a级在线观看视频 | 亚洲黄色网页 | 哪里可以免费看毛片 | 情欲少妇人妻100篇 黄色一级片欧美 | 一级片视频在线观看 | 亚洲精品91天天久久人人 | 国产精品麻豆欧美日韩ww | 99精品毛片 | 日美女网站 | 亚洲在线观看免费视频 | 黄色www| 不卡影院av| 亚洲精品国产一区二 | 麻豆国产一区二区三区四区 | 亚色影库 | av网站黄色| 激情中文网 | 色综合久久天天综合网 | 美女91网站| 午夜日韩电影 | a激情| 很很干很很日 | 精品少妇人妻av一区二区三区 | 黄色网址你懂的 | 成人毛片网 | 国产精品69久久久 | 天天色综合1 | 美国黄色一级视频 | 特种兵之深入敌后 | 日韩视频免费在线 | 91一区在线观看 | 玖玖免费 | 永久免费未满 | 天天玩天天操 | 啪啪网站免费观看 |