File Upload with ws_upload

File Upload with ws_upload

File Upload with ws_upload

Current Release for article: 4.6b This article describes creating a workstation upload to SAP. The WS_UPLOAD function replaces the old GUI_UPLOAD. GUI_UPLOAD should no longer be used.

Upload a file from a workstation, or a "presentation server" as it is known in the SAP world, to an ABAP program is a relatively simple procedure requiring a call to the BAPI WS_UPLOAD. The BAPI processes the request and returns an internal table containing the uploaded file.

Let's begin by defining the itab that will hold the input file from the workstation.. abab_pattern.jpgabap_pattern1.jpg

data: begin of plant occurs 200,
MATNR(18),WERKS(4),VKORG(4),VTWEG(2),
end of plant.

.Next, lets define the input file name and tell the program to prompt for input:

parameters: wsfile(132) lower case.

start-of-selection.

Alternates for the parameters option:
One of the problems with the way we have defined the parameters is that the dialog box that is presented by SAP starts deep within the SAP libraries on the presentation server. Another is that the fully qualified filename can not exceed the 132 character limit. Most people will want to use a file on C:, on a Windows platform. Here's how to tell the dialog box to start in C:

parameters: wsfile(132) default 'C:input.txt'

Importing the raw pattern:

In the ABAP editor click the Pattern button.

In the interactive dialog (see image, right), enter the function name WS_UPLOAD. The pattern inserted is shown below.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/190059/viewspace-476540/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/190059/viewspace-476540/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值