Small doubt reg upload from tab delimited text file
Hi all,
i am uploading a tab delimited text file to a ztable.
I moving the text file in to internal table
data : begin of i_tab occurs 0,
text(1024) type c,
end of i_tab.
then i have passed to FM GUI_UPLOAD.
and then splitting
loop at i_tab.
split i_tab at con_tab
into i_xyz-matnr
i_xyz-werks.
append i_xyz.
endloop..
is this the right approach . iam getting the results but iam just curious to know.
Do i need to internal like the one i created
data : begin of i_tab occurs 0,
text(1024) type c,
end of i_tab.
or do i need to create one with field that i have in text file.
data : begin of i_tab occurs 0,
matnr like mara-matnr,
werks like marc-werks
end of i_tab.
WHICH ONE OF THE TWO IS RIGHT.
THANKS IN ADVANCE
There will be NO difference,i guess in the 2 methods.
you can use which you like.
Check the below program,i also given quantity fields F2,F3.
its working fine
REPORT ZSRIM_TEMP13.
data : begin of itab occurs 0,
f1(20) type c,
f2 type i,
f3(10) type p DECIMALS 2,
end of itab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'c:a.txt'
FILETYPE = 'ASC'
<b>HAS_FIELD_SEPARATOR = 'X'</b>
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* VIRUS_SCAN_PROFILE = VIRUS_SCAN_PROFILE
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH = FILELENGTH
* HEADER = HEADER
TABLES
DATA_TAB = ITAB
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
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB.
WRITE :/ ITAB-F1, ITAB-F2,ITAB-F3.
ENDLOOP.
my input file i created with TAB seperated text file,
here is the input file
LINE1 1000 123.25
LINE2 2000 234.25
LINE3 3000 345.25
LINE1 1000 123.25
LINE2 2000 234.25
LINE3 3000 345.25
Regards
Srikanth
Message was edited by: Srikanth Kidambi
Similar Messages
-
Pgm to upload a tab delimited text file
Hi ,
can anyone send me a program to upload a tab delimited text file into a ztable.
My email id is : [email protected]
Thanks
KajolCheck the below code:
*& Report Z_UPLOAD_MUNCPCODE *
REPORT z_upload_muncpcode.
PARAMETERS : p_fname LIKE rlgrap-filename.
TYPES: BEGIN OF ty_munc,
land1 TYPE tzone-land1,
zone1 TYPE tzone-zone1,
vtext TYPE tzont-vtext,
END OF ty_munc.
DATA: i_munc TYPE STANDARD TABLE OF ty_munc,
i_tzone TYPE STANDARD TABLE OF tzone,
i_tzont TYPE STANDARD TABLE OF tzont,
wa_munc TYPE ty_munc,
wa_tzone TYPE tzone,
wa_tzont TYPE tzont.
CONSTANTS: c_path TYPE char20 VALUE 'C:\',
c_mask TYPE char9 VALUE ',*.*,*.*.',
c_mode TYPE char1 VALUE 'O',
c_filetype TYPE char10 VALUE 'ASC',
c_x TYPE char01 VALUE 'X'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
*-- Browse Presentation Server
PERFORM f4_presentation_file.
START-OF-SELECTION..
*-- Read presentation server file
PERFORM f1003_pre_file.
LOOP AT i_munc INTO wa_munc.
wa_tzone-mandt = wa_tzont-mandt = sy-mandt.
wa_tzone-land1 = wa_tzont-land1 = wa_munc-land1.
wa_tzone-zone1 = wa_tzont-zone1 = wa_munc-zone1.
wa_tzont-spras = sy-langu.
wa_tzont-vtext = wa_munc-vtext.
APPEND wa_tzont TO i_tzont.
APPEND wa_tzone TO i_tzone.
CLEAR: wa_munc, wa_tzont, wa_tzone.
ENDLOOP.
END-OF-SELECTION.
Modify Table TZONT
PERFORM enqueue_table USING text-001.
MODIFY tzont FROM TABLE i_tzont.
PERFORM dequeue_table USING text-001.
Modify Table TZONE
PERFORM enqueue_table USING text-002.
MODIFY tzone FROM TABLE i_tzone.
PERFORM dequeue_table USING text-002.
WRITE: 'Tables TZONE & TZONT are updated'.
*& Form f4_presentation_file
*& F4 Help for presentation server
FORM f4_presentation_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = c_path
mask = c_mask
mode = c_mode
title = text-001
IMPORTING
filename = p_fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_presentation_file
*& Form f1003_pre_file
*& Upload File
FORM f1003_pre_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = c_filetype
has_field_separator = c_x
TABLES
data_tab = i_munc
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDFORM. " f1003_pre_file
*& Form enqueue_table
*& Enqueue Table
FORM enqueue_table USING p_tabname.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = p_tabname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " enqueue_table
*& Form dequeue_table
*& Dequeue Table
FORM dequeue_table USING p_tabname.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = p_tabname.
ENDFORM. " dequeue_table
Regards,
Prakash. -
Efficent method to sort data from tab delimited text file
I am currently writing a program to sort through data that was acquired and display it on a graph and some other indicators. The file is a tab delimited text file with possibly 100,000s of data points. the current method that I have tried using was that if I wanted all of the data from Oct, I would parse out the month from the timestamp, compare that to the desired month, and add it to the array if it is the same. Other possible options of sorting are yearly and daily, possibly even hourly.
The method does work, however it does take some time (up to a minute on a P4 3.6 GHz with 2 gb ram), and most of the other computers are not nearly as fast or with as much memory. Is there a more efficent method to sorting the data??
I attached my sorting vi as well as a sample data file.
thanks for the advice. It is saved in LV8.0.1
Kenny
Kenny
Attachments:
data sort.zip 84 KB
oven1.txt 21 KBFirst of all, "sorting" has usually a different meaning (Sorting and numeric array ascending or descending, a string array aphabetically, etc.). Your data already seems sorted by date and time, you just want to pick a subset having certain characteristics.
The main problem that is slowing you down is your constant growing of large arrays. This causes constant memory reallocations.
Since your data is already sorted by date and time, all you need is to place your data in a sutable data structure, find the start and end point of your selection, then use "array subset" for example.
Your code also seems to have a lot of unecessary complexity. See for example your "test for sort data" (see image below).
the four cases only differ by filename --> only the file name belongs into the case and the file operation outside the inner case. Even better, just use autoindexing.
that shift register does not do anything, because it always contains the same data. Using "index array" with index wired to [i] is equivalent to an autoindexing tunnel.
You have a case structure to select which files to read, skipped files give you an empty array. Do you really need to do all these operations on an empty array. Why not place all code inside the TRUE case??
Below is an image of one possible code alternative that addresses some of these points.
Message Edited by altenbach on 10-26-2006 09:32 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
testForSortData.png 33 KB -
Help creating 2D array from tab delimited text file
I can print the info from the file, but darned if I can't make a 2-D array.
import java.util.regex.*;
import java.io.*;
public final class goodSplitter {
private static BufferedReader br;
private static BufferedReader br2;
private static String INPUT;
private static int numLines;
private static int numLine2;
private static int q;
private static int t;
private static int n;
private static String [][] indexArray;
public static void main(String[] argv) {
initResources();
processTest();
closeResources();
private static void initResources() {
try {
br = new BufferedReader(new FileReader("index.txt"));
System.out.println("found the input file.");
} catch (FileNotFoundException fnfe)
System.out.println("Cannot locate input file! "+fnfe.getMessage());
System.exit(0);
try {
br2 = new BufferedReader(new FileReader("index.txt"));
System.out.println("found file again.");
} catch (FileNotFoundException fnfe)
System.out.println("Cannot locate input file again! "+fnfe.getMessage());
System.exit(0);
try {
int numLines = 0;
while ( ( INPUT = br.readLine( ) ) != null )
{ numLines++; } // end while
System.out.println("file has the number of lines: " + numLines);
q = numLines;
System.out.println("creating the array.");
String [][] indexArray = new String[q][];
System.out.println("populating the array.");
while ( ( INPUT = br2.readLine( ) ) != null ) {
n = t++;
System.out.println("first array index = " + n);
String[] ss = INPUT.split("\\s");
for(int i = 0; i < ss.length; i ++)
System.out.println( new String( ss[i] ) );
indexArray[n] = ss[i];
} // end for
} // end while
} catch (Exception e)
{System.out.println("something went wrong in populating the array of length " + q); }}
private static void processTest() { System.out.println("processed text."); }
private static void closeResources() {
try{ br.close(); }catch(IOException ioe){} }you haven't sized the 2nd part of the 2d array
add this line
String[] ss = INPUT.split("\\s");
indexArray[n] = new String[ss.length];//<--------------
for(int i = 0; i < ss.length; i ++)
but note you have declared indexArray both as a class variable
private static String [][] indexArray;
and a variable local to the try/catch block
String [][] indexArray = new String[q][];
probably what you want is
indexArray = new String[q][]; -
FM to upload TAB DELIMITED TEXT file into Internal table.
Hello Friends,
The FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' is used to upload EXCEL file into a Internal table.
Is there any FM which performs the simillar operation on TAB DELIMITED TEXT FILE.
Thanks in advance!
AshishHi,
To upload text file with tab delimated you can use FM
GUI_OPLOAD.
In this function you have put X in the field HAS_FIELD_SEPARATOR.
Regards,
Sujit -
Tab Delimited Text File to be Emailed (External Email ID) from SAP
Hi,
I have a requirement to email a tab delimited text file as an attachment to external email id from SAP. The text file is of line with type string and the length of each line is about 1024 char size. Can you please suggest me a suitable solution to this requirement? It looks like the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 can handle a text file of 255 char length. I am not sure how to attach a text file of records with length more than 1025 char size.
Appreciate your help in advance.
Thanks,
KannanHi,
I have a requirement to email a tab delimited text file as an attachment to external email id from SAP. The text file is of line with type string and the length of each line is about 1024 char size. Can you please suggest me a suitable solution to this requirement? It looks like the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 can handle a text file of 255 char length. I am not sure how to attach a text file of records with length more than 1025 char size.
Appreciate your help in advance.
Thanks,
Kannan -
Application Server Download - Tab Delimited Text File
Hi,
I am trying to create a tab delimited text file in application server. Is there any option should i use with the Open Dataset / Transfer statements? My requirement is to download the file (Text - Tab Delimited) into Excel for further analysis. Can you please suggest me a suitable solution for this?
Thanks,
Kannan.Hi,
You can use transactions CG3Y and CG3Z. Its very simple.
Refer sample code:
constants: c_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_path TYPE VALUE char100 '/local/data/interface/A28/DM/OUT'.
*& Form f1001_browse_appl_file
Pick up the file path for the file in the application server
FORM f1001_browse_appl_file .
DATA: lcl_directory TYPE char128.
lcl_directory = p_direct.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = lcl_directory
filemask = c_mask
IMPORTING
serverfile = p_f2
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE s000 WITH text-039.
EXIT.
ENDIF.
ENDFORM. " f1001_browse_appl_file
*& Form f1004_app_file
upload the file from the application server
FORM f1004_app_file .
REFRESH: i_input.
OPEN DATASET p_f2 IN TEXT MODE ENCODING DEFAULT FOR INPUT.
IF sy-subrc EQ 0.
DO.
READ DATASET p_f2 INTO wa_input_rec.
IF sy-subrc 0.
MESSAGE s000 WITH text-030.
EXIT.
ENDIF.
o
+ Split The CSV record into Work Area
PERFORM f0025_record_split.
o
+ Populate internal table.
APPEND wa_input TO i_input.
CLEAR wa_input.
ENDDO.
ENDIF.
ENDFORM. " f1004_app_file
*& Form f0025_record_split
Move the assembly layer file into the work area
FORM f0025_record_split .
CLEAR wa_input.
SPLIT wa_input_rec AT c_split INTO
wa_input-legacykey
wa_input-profile_role
wa_input-read_date.
ENDFORM. " f0025_record_split
DO your manipulation with the data records here.
Popualte data into final internal table and write it back to application server at the desired path.
*& Form f0020_write_application
Write error log to application Server
FORM f0020_write_application .
IF p_f1 IS NOT INITIAL.
CONCATENATE p_direct p_obj sy-datum text-037 INTO p_f2.
ELSEIF p_f2 IS NOT INITIAL.
REPLACE text-036 IN p_f2 WITH text-037.
ENDIF.
OPEN DATASET p_f2 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc 0.
EXIT.
ENDIF.
LOOP AT i_error INTO wa_error.
TRANSFER wa_error TO p_f2.
IF sy-subrc 0.
EXIT.
ENDIF.
CLEAR wa_error.
ENDLOOP.
CLOSE DATASET p_f2.
ENDFORM. " f0020_write_application
HTH,
Regards,
Dhruv Shah -
Hi,
Can someone provide me a sample code on how to read data from a tab delimited text file into an internal table?.
Thanks,
SandeepFor example if u have 15 columns, define a internal table like this.
TYPES: BEGIN OF ty_input_file,
column1 TYPE char30,
column2 TYPE char50,
column3 TYPE char50,
column4 TYPE char50,
column5 TYPE char50,
column6 TYPE char50,
column7 TYPE char50,
column8 TYPE char50,
column9 TYPE char50,
column10 TYPE char50,
END OF ty_input_file.
DATA: i_input TYPE STANDARD TABLE OF ty_input_file.
Or if u know the data type of the value which is coming in the file u can define that in the internal table.
Then the use the below FM to upload the value to internal table.
lcl_filename will contain the file path in the file lies in the presentation server.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = i_input
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.
Also check a sample Program:
REPORT z_upload_muncpcode.
PARAMETERS : p_fname LIKE rlgrap-filename.
TYPES: BEGIN OF ty_munc,
land1 TYPE tzone-land1,
zone1 TYPE tzone-zone1,
vtext TYPE tzont-vtext,
END OF ty_munc.
DATA: i_munc TYPE STANDARD TABLE OF ty_munc,
i_tzone TYPE STANDARD TABLE OF tzone,
i_tzont TYPE STANDARD TABLE OF tzont,
wa_munc TYPE ty_munc,
wa_tzone TYPE tzone,
wa_tzont TYPE tzont.
CONSTANTS: c_path TYPE char20 VALUE 'C:\',
c_mask TYPE char9 VALUE ',*.*,*.*.',
c_mode TYPE char1 VALUE 'O',
c_filetype TYPE char10 VALUE 'ASC',
c_x TYPE char01 VALUE 'X'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
*-- Browse Presentation Server
PERFORM f4_presentation_file.
START-OF-SELECTION..
*-- Read presentation server file
PERFORM f1003_pre_file.
LOOP AT i_munc INTO wa_munc.
wa_tzone-mandt = wa_tzont-mandt = sy-mandt.
wa_tzone-land1 = wa_tzont-land1 = wa_munc-land1.
wa_tzone-zone1 = wa_tzont-zone1 = wa_munc-zone1.
wa_tzont-spras = sy-langu.
wa_tzont-vtext = wa_munc-vtext.
APPEND wa_tzont TO i_tzont.
APPEND wa_tzone TO i_tzone.
CLEAR: wa_munc, wa_tzont, wa_tzone.
ENDLOOP.
END-OF-SELECTION.
Modify Table TZONT
PERFORM enqueue_table USING text-001.
MODIFY tzont FROM TABLE i_tzont.
PERFORM dequeue_table USING text-001.
Modify Table TZONE
PERFORM enqueue_table USING text-002.
MODIFY tzone FROM TABLE i_tzone.
PERFORM dequeue_table USING text-002.
WRITE: 'Tables TZONE & TZONT are updated'.
*& Form f4_presentation_file
*& F4 Help for presentation server
FORM f4_presentation_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = c_path
mask = c_mask
mode = c_mode
title = text-001
IMPORTING
filename = p_fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_presentation_file
*& Form f1003_pre_file
*& Upload File
FORM f1003_pre_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = c_filetype
has_field_separator = c_x
TABLES
data_tab = i_munc
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDFORM. " f1003_pre_file
*& Form enqueue_table
*& Enqueue Table
FORM enqueue_table USING p_tabname.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = p_tabname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " enqueue_table
*& Form dequeue_table
*& Dequeue Table
FORM dequeue_table USING p_tabname.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = p_tabname.
ENDFORM. " dequeue_table
Regards,
Prakash.
Message was edited by: Prakash Ramu -
How to get tab delimited text file when Stored Procedure executes ?
Hello Everyone,
I have a stored procedure which returns 1 result set as an output.
I want the output as a Tab Delimited Text file.
I know that I can use SSIS and get the same output but I am not allowed to use SSIS in this case.
Is there any other ways ?
I will be really appreciate If someone can answer with, How many different ways I can get Tab delimited text file ?
Thanks in advance
Henaryyou can do that by using SQLCMD
http://blog.sqlauthority.com/2013/03/05/sql-server-exporting-query-results-to-csv-using-sqlcmd/
you can also use BCP
EXEC master..xp_cmdshell 'bcp "select * from tempdb.dbo.orders" queryout "c:\output.txt" -c -T'
EXEC master..xp_cmdshell 'bcp "exec usertest.dbo.proctest" queryout "c:\output.txt" -c -T'
--Prashanth -
EXcel to tab delimited text file
I am saving an excel file into a tab delimited text file so that i can use it for uploading data.
The excel file contains a text field in which there is a comma ',' .
for all the fields which has a comma in the excel file
the text file is adding double qoutes " in the beginning and end of the filed.
for example
contents of filed in excel file is : GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE
and in the text file it is coming as "GASKET, FLAT OEM 1380X1530X3 SIL ARAMIDE"
i dont want the " in the beginning and end
can anybody help.
points will be rewarded.
I am just saving the excel file as tab delimited text file and i am getting the quotes added in the begining and end.
Thanks.Thats to preserer the comma in between otherwise when you upload the same the data will split at comma.
Regards,
Amit
Reward all helpful replies. -
Reading Tab Delimited Text File
HI
I am having problem in reading Tab Delimited text file.
If i place some spaces in name of text file. it dosn`t read the file.
if there is a simple name without space, then it reads easily.
but when having space in file name then it shows nothing.
PLZ help me .......
give me some code or links to solution
thanks!Could you post up an example of the file? With a FedEx report file, I created an application to read each line and split the String into an array where ever a [tab] exists. Since the columns aren't evenly tabbed, I used a regular expression to replace any whitespace in a with a \t (tab). Now it takes that line and splits it into an array where the [tab] exists. Then I access that specific column in the String by line.
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 1
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
0101 8001 0 11 0 0
0102 5333 0 9 0 0
0104 0142 0 441 0 0
0106 0328 0 5 0 0
0107 0452 0 2 0 0
0110 0333 0 2 0 0
0113 0447 0 7 0 0
0114 0447 0 1 0 0
0115 0303 0 11 0 0
0127 0132 0 2 0 0
0128 0132 0 11 0 0
0129 0132 0 9 0 0
0130 0405 0 102 0 0
0131 0371 0 270 0 0
0132 0371 0 168 0 0
0133 0122 0 13 0 0
0134 0456 0 36 0 0
0135 0146 0 152 0 0
0136 0146 0 2 0 0
0138 0371 0 24 0 0
0201 0552 0 9 0 0
0204 0445 0 69 0 0
0205 0445 0 51 0 0
0207 0641 0 1 0 0
0211 0551 0 1 0 0
0212 0454 0 7 0 0
0213 3441 0 39 0 0
0216 0841 0 1 0 0
0217 0631 0 211 0 0
0222 0441 0 12 0 0
0223 0 5 0 0
0224 0441 0 9 0 0
0225 0441 0 42 0 0
0226 0441 0 11 0 0
0227 0441 0 5 0 0
0229 0619 0 753 0 0
0230 0619 0 188 0 0
0231 0602 0 2 0 0
0232 0604 0 91 0 0
0233 0604 0 3 0 0
0238 0601 0 1 0 0
0304 1435 0 12 0 0
0307 2430 0 477 0 0
0309 1430 0 98 0 0
0310 1430 0 1 0 0
0311 0971 0 1 0 0
0312 0449 0 19 0 0
0313 0449 0 128 0 0
0315 0923 0 31 0 0
0316 0981 0 11 0 0
0317 0972 0 9 0 0
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 2
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
0318 0972 0 6 0 0
0319 2431 0 1 0 0
0323 0436 0 9 0 0
0324 0 3 0 0
0326 3431 0 12 0 0
0328 0958 0 55 0 0
0332 0430 0 84 0 0
0333 0430 0 16 0 0
0334 4430 0 29 0 0
0337 0480 0 2 0 0
0343 0555 0 36 0 0
0405 1437 0 52 0 0
0406 1437 0 51 0 0
0407 3152 0 58 0 0
0408 3152 0 2 0 0
0410 0152 0 5 0 0
0411 0152 0 3 0 0
0415 0100 0 55 0 0
0417 0253 0 95 0 0
0420 0282 0 1 0 0
0421 0282 0 82 0 0
0422 0753 0 13 0 0
0425 0165 0 9 0 0
0426 0165 0 8 0 0
0427 0089 0 21 0 0
0428 0089 0 10 0 0
0434 0437 0 3 0 0
0436 0170 0 4 0 0
0441 0263 0 9 0 0
0442 0219 0 1 0 0
0443 0219 0 20 0 0
0444 3258 0 3 0 0
0447 0156 0 89 0 0
0448 0156 0 59 0 0
0449 0156 0 1 0 0
0450 0760 0 14 0 0
0451 3163 0 16 0 0
0453 0212 0 27 0 0
0454 7760 0 2 0 0
107A 0219 0 0 0 88
108A 0219 0 0 0 89
110A 7061 0 0 0 185
111A 7061 0 0 0 190
112A 0170 0 0 0 3
113A 0170 0 0 0 1
114A 0170 0 0 0 3
118A 0089 0 0 0 261
119A 0089 0 0 0 255
120A 0282 0 0 0 5
121A 0282 0 0 0 4
122A 0753 0 0 0 6
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 3
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
124A 3156 0 0 0 258
125A 0258 0 0 0 74
126A 3258 0 0 0 3
127A 0263 0 0 0 34
128A 3263 0 0 0 7
129A 0152 0 0 0 39
130A 0152 0 0 0 44
131A 0152 0 0 0 33
132A 3152 0 0 0 176
133A 3152 0 0 0 181
134A 0253 0 0 0 34
135A 0253 0 0 0 34
136A 3253 0 0 0 103
137A 0156 0 0 0 85
138A 0156 0 0 0 87
139A 0437 0 0 0 271
140A 3437 0 0 0 111
141A 0165 0 0 0 204
142A 3165 0 0 0 5
143A 0163 0 0 0 9
144A 3163 0 0 0 5
147A 7760 0 0 0 9
201A 8001 0 0 0 1
202A 8001 0 0 0 2
205A 3435 0 0 0 62
206A 0402 0 0 0 218
208A 0405 0 0 0 15
212A 0411 0 0 0 5
213A 0411 0 0 0 5
214A 3441 0 0 0 224
215A 3441 0 0 0 225
216A 0410 0 0 0 9
217A 0449 0 0 0 49
218A 0449 0 0 0 51
219A 3452 0 0 0 12
220A 0452 0 0 0 4
221A 0452 0 0 0 6
222A 3431 0 0 0 33
223A 3431 0 0 0 38
224A 2430 0 0 0 14
225A 2430 0 0 0 14
226A 4430 0 0 0 15
227A 4430 0 0 0 15
228A 0430 0 0 0 4
229A 0430 0 0 0 4
230A 1430 0 0 0 11
231A 1430 0 0 0 23
232A 0456 0 0 0 96
233A 7433 0 0 0 9
234A 0333 0 0 0 3
235A 7641 0 0 0 10
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 4
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
236A 0802 0 0 0 5
240A 0631 0 0 0 111
241A 0551 0 0 0 3
245A 0958 0 0 0 71
246A 0554 0 0 0 72
247A 0923 0 0 0 48
248A 0371 0 0 0 31
249A 0972 0 0 0 49
250A 0381 0 0 0 3
251A 0619 0 0 0 27
253A 0604 0 0 0 48
254A 0132 0 0 0 57
255A 0132 0 0 0 53
257A 0942 0 0 0 16
307A 0951 0 0 0 138
308A 0464 0 0 0 22
309A 0641 0 0 0 45
310A 0641 0 0 0 47
311A 0122 0 0 0 16
312A 0971 0 0 0 76
313A 0602 0 0 0 37
314A 0841 0 0 0 9
315A 0841 0 0 0 8
317A 0958 0 0 0 2
318A 0532 0 0 0 35
320A 0604 0 0 0 16
322A 0981 0 0 0 90
323A 0371 0 0 0 42
324A 0972 0 0 0 13
325A 0372 0 0 0 35
326A 0928 0 0 0 14
327A 0619 0 0 0 78
328A 0328 0 0 0 17
330A 0303 0 0 0 27
331A 0923 0 0 0 1
332A 0336 0 0 0 3
333A 7850 0 0 0 7
335A 0146 0 0 0 8
337A 0454 0 0 0 20
338A 3445 0 0 0 86
339A 0445 0 0 0 371
340A 1441 0 0 0 42
341A 2442 0 0 0 111
342A 0441 0 0 0 59
343A 1442 0 0 0 23
344A 0442 0 0 0 28
345A 7441 0 0 0 66
346A 4441 0 0 0 73
347A 2441 0 0 0 72
348A 3462 0 0 0 12
349A 0462 0 0 0 62
08/28/2007 FedEx Ground COLO2
23:16:29 LANE FULL REPORT reptClaneFulls
Page 5
Next Sorters
Load Main Auto Smalls
Chute Point Primary Secondary Primary Secondary
350A 0447 0 0 0 36
351A 0447 0 0 0 43
352A 3468 0 0 0 2
353A 0468 0 0 0 13
354A 0142 0 0 0 26
356A 0436 0 0 0 7
357A 0436 0 0 0 5
359A 0480 0 0 0 20
RLBL 0 47 0 0
SSBL 0 127 0 0
SSGN 0 32 0 0
SSRD 0 323 0 0
======================================================
TOTAL: 0 5071 0 6630 -
How to create a tab-delimited text file?
Hi,
I need to create a tab-delimited text file at presentation server getting content from an internal table. My file should also have a header - also tab-delimited. Data for a header is stored in some work area.
Any ideas how to add tab-delimiter into a text file? Or should I go for a HEX file and use
CONSTANTS: c_tab TYPE x VALUE '09'.
and separate my data with this constant instead?
Any thoughts whould be appreciated.
TIA
Ivaylo MutafchievHi Ivaylo,
Refer sample code:
IF i_final_head[] IS NOT INITIAL.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lcl_filename
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = i_final_head
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.
IF sy-subrc <> 0.
MESSAGE s000 WITH text-031.
EXIT.
ENDIF.
ENDIF.
Reward points if this helps.
Manish
Message was edited by: Manish Kumar -
Receiver File Adapter - Tab delimited Text file
I am using receiver file adapter to convert message created by ABAP PROXY to convert tab delimited text file format.
XML message is in following format.
- <DT_R3_ROLES_OUTBOUND_REC>
<LIST_CATEGORY>SAP_HR</LIST_CATEGORY>
<USRID>MRUDULAP</USRID>
<EMAIL>[email protected]</EMAIL>
<NAME>MRUDULA PATEL</NAME>
</DT_R3_ROLES_OUTBOUND_REC>
- <DT_R3_ROLES_OUTBOUND_REC>
<LIST_CATEGORY>SAP_HR</LIST_CATEGORY>
<USRID>HCHD</USRID>
<EMAIL>[email protected]</EMAIL>
<NAME>H CHD</NAME>
</DT_R3_ROLES_OUTBOUND_REC>
I have used file content conversion in the adapter configuration.
Recordset structure = DT_LISTSERV_INBOUND_REC
DT_LISTSERV_INBOUND_REC.addHeaderLine = 0
DT_LISTSERV_INBOUND_REC.fieldSeparator = ','
How to use Tab as the delimiter in the fieldSeparator field?
Now the output in the file is as follows :
[email protected]'MRUDULA PATEL
[email protected]'H CHD
What I need to do to make the file as the tab delimited file?
Thanks in advance!
Mrudula PatelHi Mruddula,
Use fieldSeparator: '0x09' for horizontal tab
<b>DT_LISTSERV_INBOUND_REC.fieldSeparator: '0x09'</b>
Naveen -
OPEN DATASET output to Tab delimited text file???
Can anyone suggest the best way for downloading a TAB DELIMITED text file to the application server using open dataset.
I'm currently downloading the file, but I find that it puts "#"'s in place of empty numeric fields.
any help appreciated,
LeeHi Lee,
System identifies Tab delimited as #.
But its not a problem.
If you wang to download the data into intenal table,
you need to do declare delimiter.
Refer code:
CONSTANTS: c_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
c_hash TYPE c VALUE '#'.
data:wa_input_rec TYPE char2000.
OPEN DATASET p_appl IN TEXT MODE ENCODING DEFAULT FOR INPUT.
IF sy-subrc = 0.
DO.
READ DATASET p_appl INTO wa_input_rec.
IF sy-subrc <> 0.
EXIT.
ELSE.
*-- Split the Tab # into corresponding Columns fields.
PERFORM f0056_split_records.
APPEND wa_input_file TO i_input_file.
CLEAR: wa_input_rec, wa_input_file.
ENDIF.
ENDDO.
FORM f0056_split_records .
CLEAR wa_input_file.
SPLIT wa_input_rec AT c_split INTO
wa_input_file-column0
wa_input_file-column1
wa_input_file-column2
wa_input_file-column3
wa_input_file-column4 IN CHARACTER MODE.
ENDFORM. " f0056_split_records
Reward points if this helps.
Manish
Message was edited by: Manish Kumar
Message was edited by: Manish Kumar -
GUI_UPLOAD can't upload data in a tab-delimited text file
Hi.
I was trying to upload data in a tab-delimited textfile.
I could do it for a ASC textfile (by setting FILETYPE = 'ASC'), but I couldn't do it for a tab-delimited textfile (by setting FILETYPE = 'DAT').
Any help is appreciated.hi kian,
If u r using DAT file then HAS_FIELD_SEPERATOR should contain X.
<b>check the following code:</b>
parameters: p_file like rlgrap-filename. " File Name.
call function 'GUI_UPLOAD'
exporting
filename = p_file " NAME of the file
<b> filetype = 'DAT'
has_field_separator = 'X '</b> " <b>X indicates Fields are separated by tabs.</b>
tables
data_tab = t_file " Internal table that contains the file data
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.
<b>IF the file type is DAT then following rules applies.</b>
The components of the internal table are filled from the file. If the
table contains several columns, the entries in the file must be
separated by tabs. No conversion exits are carried out.
The following applies for the different data types:
- I or N or P or F
The numbers must be formatted according to the decimal representation
defined in the user settings.
- D
The date must be defined according to the date format defined in the
user settings.
- T
The time must have the format hh:mm:ss.
Reward me if useful...
Harimanjesh AN
Maybe you are looking for
-
Apache+mod_jk+ssl
Hello, Is it possible to have an apache web server in front of a cluster of Tomcat servers and still force the ssl connection to go all the way to the tomcat servers or must ssl negotiation stop at the web server ? This would involve ssl session main
-
Please tell me how to edit my iTunes account info. The we're charges from iTunes on my husband's company credit card. I can't tell by the amount if they were mine that were supposed to go on my card. There's just a total charge and not a detailed
-
Vendor Payment Terms Changes - Listing?
Hi SDN We are trying to track all the Vendor Payment Terms Changes done in the Vendor Master, and I was wondering if SAP offers some reports that could list, for a given time period, all the vendors that their payment terms changed, as well as what w
-
Data Conversion for profit center group
Hi, I need help uploading profit center groups (KCH1) into the R/3 system. Which is recommended - to use LSMW or create a BDC program? Thanks in advance!
-
"Error writing metadata to" when applying keywords
This is the initial post of the thread in this new forum, as requested. A link to the history of the issue is here. In a nutshell, this thread documents the irritating and difficult-to-track-down issue where Bridge is unable to write metatdata to a f