‎2007 May 15 10:19 AM
hi all,
how to create a file on application server and use it in a bdc.
Thanks In Advance
Assad
‎2007 May 15 10:22 AM
hi u can create a file on app server using tcode CG3Z...
U CAN use that file in BDC by reading the file(read dataset.....) and uploading the data into an internal table.
Message was edited by:
Premalatha G
‎2007 May 15 10:22 AM
hi u can create a file on app server using tcode CG3Z...
U CAN use that file in BDC by reading the file(read dataset.....) and uploading the data into an internal table.
Message was edited by:
Premalatha G
‎2007 May 15 10:25 AM
U can create a File in Application Server by using a program with
OPEN DATA SET INPUT Statement &
OPEN DATA SET OUTPUT statement in the BDC program for retrivng the data ino Internal table in the BDC program
Vikram.M
‎2007 May 15 10:56 AM
Hi,
You can copy a local file from presentation server to the application server using transaction USS_FAS.
<b>ABAP code to create and write to a file:</b>
Check whether file already exists
OPEN DATASET g_out_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc IS INITIAL.
File g_out_file already exists. Do not write to an existing file
Error message
STOP.
ENDIF.
open outbound file for writing
OPEN DATASET g_out_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
write detail record to outbound file
LOOP AT t_iout INTO g_out.
TRANSFER g_out TO g_out_file.
ENDLOOP.
CLOSE DATASET g_out_file.
IF sy-subrc IS INITIAL.
Success message
ENDIF.
CATCH cx_root INTO l_oref.
l_text = l_oref->get_text( ).
log free text message if exception is catched
Error message
STOP.
ENDTRY.
‎2007 May 15 11:05 AM
hi assad,
You can directly upload the data in the Applocation layer with the help of transaction...
<b>CG3Z is the transaction to upload data from Presentation server to Application server.
CG3Y is the transaction to upload data from Application server toPresentation server.</b>
You can see whether the data has been uploaded or not thr Al11 transaction... an going on to that particular dierctly...
for uploading the same data inthe internal table, yo have to use ..opendata set and close dataset...
Regards,
Jayant.
‎2008 Feb 21 12:41 PM
APPLICATION FILE CREATION.
Check whether file already exists vkont
OPEN DATASET c_filepath_fpb3 "/tmp/file_FI009_01_fpb3.txt
FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
File c_filepath_fpb3 already exists then delete that file
DELETE DATASET c_filepath_fpb3. "/tmp/file_FI009_01_fpb3.txt
ENDIF.
Open the filepath / dataset on the application server for writing
OPEN DATASET c_filepath_fpb3 "/tmp/file_FI009_01_fpb3.txt
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Check if the OPEN has been successful
IF sy-subrc EQ 0.
Transfer file header data
TRANSFER wa_bfkkzgr00 TO c_filepath_fpb3.
"/tmp/file_FI009_01_fpb3.txt
CLEAR: wa_bfkkzgr00.
Transfer paymentlot header data
TRANSFER wa_bfkkzk TO c_filepath_fpb3.
"/tmp/file_FI009_01_fpb3.txt
CLEAR: wa_bfkkzk.
LOOP AT it_bfkkzp INTO wa_bfkkzp.
TRANSFER wa_bfkkzp TO c_filepath_fpb3.
"/tmp/file_FI009_01_fpb3.txt
CLEAR: wa_bfkkzp.
ENDLOOP.
Close the dataset / filepath
CLOSE DATASET c_filepath_fpb3.
"/tmp/file_FI009_01_fpb3.txt
ENDIF.
Call the report for creating the payment lots(Transaction FPB3)
Submit the data to park the document
SUBMIT rfkkze00 WITH as_fname = c_filepath_fpb3
"/tmp/file_FI009_01_fpb3.txt
AND RETURN.
ENDIF.