08-13-2012 12:07 PM
Dear All,
Requirement is:
While copying Sales Order XXX, it should be copy the folder XXX from Remote server,
I mean in VA01 we have the push button : Create with reference. there we ll give the Old order number right so once we select the copy.
system will full fill the all details from the order XXX (line item pricing..etc etc) ones you save save the order system will generate the new order YYY ( Internal number range).
So at the same time system has to go remote server and create a new folder (YYY) with reference of older folder (XXX) and also it should be copy the content from the old folder.
How to do this?
i have used class for crating folder under the remote server:
class : CL_GUI_FRONTEND_SERVICES
DIRECTORY1 = '\\255.254.1.196\WIN_Folder\VBAP-VBELN\'.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_CREATE
EXPORTING
DIRECTORY = DIRECTORY1 " ip
CHANGING
RC = RC1
EXCEPTIONS
DIRECTORY_CREATE_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
DIRECTORY_ACCESS_DENIED = 4
DIRECTORY_ALREADY_EXISTS = 5
PATH_NOT_FOUND = 6
UNKNOWN_ERROR = 7
NOT_SUPPORTED_BY_GUI = 8
WRONG_PARAMETER = 9
others = 10.
IF SY-SUBRC <> 0.
Ip address for remote server = 255.254.1.196
WIN_Folder = Default folder / Fixed folder ( under this i have to create folder based on sales order number VBELN)
Regards,
Ali / Akshath
08-13-2012 8:47 PM
In general, if you need to rename a folder on a "remote server" you'd probably need to use FTP or an external command. Class you're trying to use is for the "presentation server", i.e. user's local PC.
However, the whole idea of imlementing this within VA01 seems very odd to me. Can you explain what's the purpose of this rather unorthodox design?
08-23-2012 2:45 PM
Our client requirement is :
Clint is : NDF they having printing business,
Customer will give the order either online (they are using WC),phone (they have call with customer or its like a customer care center) or direct interaction ( customer has to come directly office and give the order).
here i am taking phone option.
Customer call to CSR (care center) and they will give the order. and
while giving order its self they has to send images via emails (csr@ndf.com).
or they may be send later (1st book the order after some days they will send the images)
Case1 : while creating order they has to upload the images based on Sales order number and line item number (it should be dynamically) and remote server path is (\\198.168.1.10\Images\)
for this reason i have created custom button 'ZIMG' at VA02. ones user click the button it will take image upload over view screen, there they can upload the images for line item.
For this i have used below fm / methods for creating a folder in remote server:
SXPG_COMMAND_EXECUTE
or
CL_GUI_FRONTEND_SERVICE=> Create Directory
Here my question is:
which method is best ?
Why its best?
Which method sap would prefer and why?
either
SXPG_COMMAND_EXECUTE
or
CL_GUI_FRONTEND_SERVICE=> Create Directory
and how to rename the folder name of remote server through ABAP program.?
i hope you will understand my requirement, if you not i ll send the details document what i did in VA01 and VA02.
Regards,
Akshath
08-23-2012 3:16 PM
Quite honestly, I think the best method is to reach to an SD consultant and to a document management specialist. This project with remote server and lots of customization have "maintenance nightmare" written all over it. There is document management system (DMS, look it up) available within SAP (although I don't know its functionality in detail) and there could be other possible solutions.
A requirement to include some documents with an order doesn't seem that unique to me. In this case I feel there was not enough analysis done of other options available in SAP.