‎2006 Dec 20 8:14 AM
Hi All,
I want to upload tha data from application server automatically. here is the requirement.
1. Auto uploading of the BDC from application server
2. End of each file they would like to give the Statistics of the File i.e. How many records we uploaded and how many failed and log of failed records i.e. Error Handling / records details (This is required while uploading)
Venu
‎2006 Dec 20 8:52 AM
Venu,
you can use the foll steps
1. Read the file App Server using OPEN Dataset..
2. Process the record for validations/ BDC tansaction.
3. mark out the error records
4. Create a Error file with HEADER & TRAILER records , header will have date/time stamp, trailer will have summary of the records.
Similarly you can update the original file too with a summary trailer record.
Also you can use record indicators for record type..like H,D & T for header, detail & trailer records.
Kyamuddin.
‎2006 Dec 20 11:04 AM
Hi Kyamuddin Shah,
Actually I know the opendata set read/transfer and Closedata but in all these I am unable to readdata set. Below I am giving the code. Please Correct me.
DATA : BEGIN OF I_KNA1 OCCURS 0,
KUNNR TYPE KNA1-KUNNR,
SORT1 TYPE ADDR1_DATA-SORT1,
END OF I_KNA1.
*DATA : P_F_NAME TYPE STRING.
DATA: BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.
DATA: SAM(40) VALUE 'G:\USER\SAP\H11\DEVEBMGS10',
MSG(100).
DATA: str type string.
MSG = 'NOT OK'.
START-OF-SELECTION.
*INCLUDE BDCRECX1.
OPEN DATASET SAM FOR INPUT IN TEXT MODE.
DO.
READ DATASET SAM INTO str.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
WRITE: / str.
ENDDO.
CLOSE DATASET SAM.
Venu
‎2006 Dec 20 1:41 PM
Hi Venu
Looks like you are accessing from share drive, in that case maybe you can try using FM: GUI_UPLOAD
If this is application server, please check for Upper & Lower Case of directory and file name. Maybe that can help.
Kind Regards
Eswar