‎2006 Dec 04 8:14 PM
Hi i am new to ABAP..my client maintains a software called LOGPRO that actually assigns tracking number to all of their shipements sent via UPS..the requirement is i get all the details of the tracking info in a flat file..i am rewuireed to create a Ztable so as to maintain that data given by LOGPRO software in SAP SYSTEM..how can i do that
‎2006 Dec 04 8:27 PM
‎2006 Dec 04 8:29 PM
‎2006 Dec 04 8:33 PM
Hi,
Goto Tcode SE11 & create the Ztable and then write the Program which read the flat file & update it to Ztable.
To Read the File use Function Module
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:dataemp.txt'
FILETYPE = 'ASC'
tables
data_tab = itab.Raja T
‎2006 Dec 04 8:38 PM
Hi,
Check this link to create a table in SAP.
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
After creating the table(Eg: ZLOGPRO) by above process, you can upload the data in LOGPRO into this table by using FunctionModule 'GUI_UPLOAD'.
Sample code:
DATA: it_record LIKE ZLOGPRO OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_filename
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_record
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
Thanks,
Vinay
‎2006 Dec 04 8:50 PM
you could do the following:
**selection screen***
PARAMETERS: P_INFILE(128) DEFAULT
'/interfaces/hr/PSS_PENFAX_PAYR_NSPG.txt' LOWER CASE.
OPEN DATASET P_INFILE FOR INPUT IN TEXT MODE.
IF SY-SUBRC = 0.
DO.
READ DATASET P_INFILE INTO I_STRING.
IF SY-SUBRC NE 0.
EXIT.
ELSE.
APPEND I_STRING.
ENDIF.
ENDDO.
ELSE.
WRITE: / 'Could not open ' , P_INFILE .
ENDIF.
CLOSE DATASET P_INFILE.
***loop and append to your internal table.
LOOP AT I_STRING.
APPEND I_STRING TO I_RESULTS.
ENDLOOP.
loop at i_results.
MODIFY Ztable FROM I_RESULTS.
endloop.
Warren
‎2006 Dec 04 8:51 PM
sorry, ignore the default file i am opening, and replace with your own