2009 Apr 13 9:50 AM
Hi Guys,
I am using the application server file to create the sales order using BAPI, if BAPI through the any error records, i need to create error file and upload into Application server.
Now i could able to create the sales order, but i need to further developement for uploading the file to Application server. could any one please provide step by step process to upload the file into Application server.
Thanks,
Gourisankar.
Hi Guys,
I am using the application server file to create the sales order using BAPI, if BAPI through the any error records, i need to create error file and upload into Application server.
Now i could able to create the sales order, but i need to further developement for uploading the file to Application server. could any one please provide step by step process to upload the file into Application server.
Thanks,
Gourisankar.
2009 Apr 13 9:54 AM
this you can do by using trancation cg3z .
and ther is one FM also
ARCHIVFILE_CLIENT_TO_SERVERcopy to default location as in working folder of server
this will definately do .
Ankit
2009 Apr 13 10:00 AM
Dear ,
U can also used open data set and closed data set
but the thing is some time there is space error arrived which you can easily solved by separating it by spaces .
OPEN DATASET dsn2 FOR APPENDING IN TEXT MODE ENCODING DEFAULT.
LOOP AT it_excel2 INTO wa_excel2.
CONCATENATE wa_excel2-pur_doc
wa_excel2-po_item
wa_excel2-header_txt INTO w_char SEPARATED BY c_tab.
TRANSFER w_char TO dsn2.
ENDLOOP.
CLOSE DATASET dsn2.thanks ankit
2009 Apr 13 9:56 AM
Refer following code
*__Open Application Server File
OPEN DATASET PFNAME1 FOR OUTPUT IN TEXT MODE.
IF SY-SUBRC NE 0.
MESSAGE E001(SY) WITH 'Error while opening File'.
EXIT.
ELSE.
*---Data is downloaded to the application server file path
LOOP AT GI_UPDATE ."INTO wa_tab2.
TRANSFER GI_UPDATE TO PFNAME1.
ENDLOOP.
ENDIF.
*--Close the Application server file (Mandatory).
CLOSE DATASET PFNAME1.
Regards,
Pritish
2009 Apr 13 9:56 AM
hi,
try this code it will download the file in application server:
here :
v_file is file path
it_tline is internal table has all data to be downloaded:
open dataset v_file for output in binary mode.
if not sy-subrc is initial.
retcode = sy-subrc.
exit.
endif.
loop at it_tline.
transfer it_tline to v_file.
endloop.
close dataset v_file.regards
rahul
2009 Apr 13 9:58 AM
HI,
Check this..
OPEN DATASET filename FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT MESSAGE msg.
IF SY-SUBRC EQ 0.
LOOP AT ITAB.
l_string = itab.
TRANSFER_l_string TO filename.
ENDLOOP.
CLOSE DATASET filename.
ENDIF.
2009 Apr 13 9:59 AM
ho do like this ...
use tcode cg3z give the file name of front end and application server path
or use open dataset in the code..
2009 Apr 13 9:59 AM
hi,
please refer this
http://www.sapdev.co.uk/file/file_uptabsap.htm
use OPEN DATASET ,TRANSFER ,and ClOSE DATASET
thanks
2009 Apr 13 10:00 AM
Hi check for BAPI return messages. loop through bapiret2 structure, search for error messages with msgid = 'E' and populate the internal table it_text_data with the error messages and other fields(whatever detials you want to have in the file ), then use the following code to write to appliacation server,
OPEN DATASET l_filename FOR OUTPUT IN TEXT MODE.
IF sy-subrc NE 0.
RAISE open_file.
ENDIF.
LOOP AT it_text_data. " into l_text_data.
TRANSFER it_text_data TO l_filename.
ENDLOOP.
CLOSE DATASET l_filename.
You can check if the file has been written to application server in AL11 transaction,
2009 Apr 13 10:06 AM
2009 Apr 13 10:07 AM
hi,
You can use the following code to upload file on application server
DATA: file TYPE string VALUE 'mara.txt'.
OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING DEFAULT .
DO.
READ DATASET file INTO wa_download1.
IF sy-subrc = 0.
APPEND wa_download1 TO gi_download1.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET file.
Regards,
Manish
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |