on 06-04-2014 6:27 PM
Hi experts,
I'm creating a NWDS application that executes a RFC. The RFC creates an excel Document and saves it atomatically in a path (like C:\documents) at the local host .If i execute the RFC from SE37 transaction, the file saves succesfully, but through the portal, the file is not saved in the path or anywhere.
Here is the code that saves the file:
* g_c_nomarch is the path where the file should had been saved.
CALL FUNCTION 'FLUSH'
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.
GET PROPERTY OF excel 'ActiveSheet' = hoja.
FREE OBJECT hoja.
FREE OBJECT libro.
GET PROPERTY OF excel 'ActiveWorkbook' = libro.
CALL METHOD OF libro 'SAVEAS'
EXPORTING
#1 = g_c_nomarch
#2 = 1.
CALL METHOD OF libro 'CLOSE'.
CALL METHOD OF excel 'QUIT'.
FREE OBJECT hoja.
FREE OBJECT libro.
FREE OBJECT excel.
So, can someone help me with any suggestion in order to solve this issue?
Thanks!!!
i don't think you can do this in portal with just one RFC call.
in portal case, rfc call can only return you some data, you have to write java code to consume the data and ask user to download to local drive.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. When you click on any action, you need to execute BAPI/RFC and Read the data from BAPI/RFC and Saved into the One Node.
2. At the same time you have to open one Popup Window. In the Popup window you have to create 2 Buttons. One for OK and another for Cancel.
3. Whenever you click on OK button.
a. Create One Excel file
File dir = new File("c:\\Folder Name");
File file = new File("c:\\Folder Name\\"_"+ new SimpleDateFormat("MM-dd-yyyy HHmm").format(new Date())+ ".excel");
file.createNewFile();
FileWriter fw = new FileWriter(file);
BufferedWriter logFile = new BufferedWriter(fw)
b. Now Read the all data from Value Node and saved into the Excel file
c. But you need to create folder path in EP Server system only.
4. Whenever you click on Cancel button. Your script is not generated. So that time file is not created.
I hope this is help full !!!
Regards
Vijay Kalluri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.