Concatenate with tab delimiter
Hi,
I need to put 3 fields in a Unix text file separating them with a tab delimiter.I know How to send it to unix but anyone tell me how I write the concatenate .
I have another issue ...when I bring it back from unix to r/3...then how should I check for it to split the fields?
anyone help ASAP
Message was edited by:
ramana peddu
To split use something like this:
Data: rec_str(180).
data: F1(60),
F2(60),
F3(60)
do.
read dataset YourFile into rec_str.
if sy-subrc <> 0.
exit.
endif.
SPLIT rec_str AT cl_abap_char_utilities=>horizontal_tab INTO F1 F2 F3.
write:/ F1, F2, F3.
enddo.
Similar Messages
-
Concatenate with 'tab' delimiter in Unicode system
Hi All,
In current system we have a program that creates a tab-delimited file with following code where wa1 and wa2 are character-type fields.
data: delim type x value '09'. (a tab in hex)
concatenate wa1 delim wa2 into wm_lstfil.
Unicode system won't allow char and hex fields to intermix. Suggestions on how to replace this code so that we continue to create a tab-delimited output line?
Thanks,
KirstenHi
You can use the following...
CLASS cl_abap_char_utilities DEFINITION LOAD.
DATA: text TYPE string.
<b>Concatenate your data into variable text .... and then,</b>
REPLACE cl_abap_char_utilites=>horizontal_tab WITH space INTO text.
Regards,
Raj -
Transfer data in unix with tab-delimited
Hi,
How can we transfer data to unix with tab-delimited? I have incoming file with tab-delimited and want to copy as backup file in another folder in unix. When I read the incoming file, tab separator is translated into '#' so when I do transfer data to the backup folder, the file contains '#'.
Is there a way to transfer data in tab-delimited?
thank you
aliatry to use delimiter cl_abap_char_utilities=>HORIZONTAL_TAB.
here is a piece of code:
REPORT ztestfile .
DATA: BEGIN OF gt_file_out OCCURS 0,
filed(2000),
END OF gt_file_out.
START-OF-SELECTION.
DATA: lv_file_out LIKE filename-fileextern.
CONCATENATE 'Hello' 'World' INTO gt_file_out SEPARATED
BY cl_abap_char_utilities=>horizontal_tab.
APPEND gt_file_out.
lv_file_out = '
XXXX\XXXX\mytest1.txt'.
OPEN DATASET lv_file_out FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT gt_file_out.
TRANSFER gt_file_out TO lv_file_out.
ENDLOOP.
CLOSE DATASET lv_file_out.
Message was edited by: joseph fryda -
Download the file in Presentation server with TAB Delimited
Hi,
I have to download the data of the finla internal table in presentation servr.
The oup put file should be TAB Delimited. I can do the same with using LOOP.
Is there any class or FM to do the same so that the out put file can be TAB Delimited.
SandeepHI,
you can use the fm
GUI_DOWNLOAD
in that if you see the
WRITE_FIELD_SEPARATOR - the import parameter, you can use this
so that the fille will be downloaded with tab delimited.
Regards,
Venkatesh -
Output file as a text file with tab delimited and fixed length fields
Hi all,
I have developed a custom report which outputs an excel file on the user desktop who executes that report.Now i need to create an additional (second) excel file with almost the same data as the first file.
Im using the FM GUI_DOWNLOAD to create the file.i need have the 2nd file as txt file(seperated by space/tab delimited) and also i want the fields to have fixed length.For this format of the file,what parameters do I need to pass to the FM ?
BR,
SRM Tech.Thanks for the prompt reply.
Also in the sel screen,Im entering the path where the o/p file needs to be downloadede.g. C:/Output_folder/Output.xls...Now if I need a text file,do I need to give the fielname as C:/Output_folder/Output.txt.? -
Building a CSV with TAB Delimited
Apex 3.1.2
Customer wants to build a Apex Report with CSV output, but have TAB delimited columns, not comma delimited. Any ideas on how to insert a TAB into the CSV "Separator" column?
Thanks,
DwightThanks Tony.
Appears that in my version of Apex at least, only one character can be entered in the "Separator" column so putting "\t" doesn't work. Going to massage the file afterwards. Thanks for the help.
Dwight -
Date is not show up in correct format from excel with tab-delimited was generated from query
Hi,
My code below worked file and save file into txt file. However, the date is the problem. I have to open excel file and manulay change the format of the date to make it shows the correct date, other way, it alutomatic shows 00:00:00 when i first open the file. How can i make the date automatic shows from the file i generated in excel?
<cfset tab = chr(9)>
<cfset Str = "">
<cfloop query="q_report">
<cfset Str = Str & q_report.purchasedNo & tab & q_report.desc & tab & q_report.Del_date & chr(13) & chr(10)>
</cfloop>
<cffile action="write" output="#Str#" file="#variables.file#">
thanksHave you tried using DateFormat() on the date?
^_^ -
Re: Tab delimited file(interface prg)
Hi,
I have a problem with tab delimited file.
i am getting one tab delimited file from the user i ahve to import it to the application sever and from the i will give tht prg as input to my prg and i will do some processing and accrodingly i will genrate some file in the format they need till now i dont have any problem
but the records which have errors in the input file it self, for those records i need to generate the error file but while importing it to presentation server from application server that should be again genrate the tab delimited file .. so while genrating error file wht need to be done.. please help me...
am i clear with my explanation
i will reward for all usefull answers....If you are using a 4.7 or older systems then use this
Declare a constant of HEX
constants c_hextab(1) type x value '09'.
and use this constant in concatenate statement to generate a tab character.
Reward points please. -
Tab delimited file on app server. How to do that?
Hello,
When i transfer a tab delimited file from pre. server(windows) to app. server(windows) using CG3Z , the tab delimitation is not working.
for eg : the file with below layout
01.04.2007 31.03.2008 1 120
01.05.2007 31.07.2008 2 140
is getting changed like
01.04.2007#31.03.2008#1#120
01.05.2007#31.07.2008#2#140
All i need is a tab delimited file in app server also . Wats that i need to do for this ? Also how can i write a tab delimited file on app server through my program using open dataset.
Thanks for ur time.
Jeeva.Hi..
Check this code: you will find the solution:
Using the Static Attribute <b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB</b>
Example:
This is the Simple way you can download the ITAB with Tab delimiter:
DATA : V_REC(200).
OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT ITAB INTO WA.
Concatenate WA-FIELD1 WA-FIELD2
INTO V_REC
SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
TRANSFER V_REC TO P_FILE.
ENDLOOP.
CLOSE DATASET P_FILE.
Note: if there are any Numeric fields ( Type I, P, F) In your ITAB then before CONCATENATE you have to Move them to Char fields ..
Reward if Helpful.
Example:
DATA: V_RECORD(200).
OPEN DATASET P_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
DO.
READ DATASET P_FILE INTO V_RECORD.
IF SY-SUBRC NE 0.
EXIT.
ENDIF.
SPLIT V_Record at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
INTO WA-FIELD1 WA-FIELD2.
APPEND WA TO ITAB.
ENDDO.
<b>reward if Helpful.</b> -
Download into tab delimited text file
Hi all
I am uploading data from a text file with tab delimited.
For some reason if the record doesnot satisfy the criteria i cannot upload the record .
In the program i am moving those records into another internal table and deleting from the actual that i ausing to update the ztable.
I need to download those fault records into another text file with tab delimited space with the same format so that they can correct those records and upload again.
Thanks
PreetiPreeti,
Look at the code below. It should do everything that U want to do. However it uploads data from excel and downloads data into a text file.
Hope this helps,
Shreekant.
Program Name : ZRSD0177_XREF_EXCEL_UPLOAD *
REPORT zrsd0177_xref_excel_upload NO STANDARD PAGE HEADING .
TABLES : zzsd0010,
knvv.
DATA : g_repid LIKE sy-repid,
$v_start_col TYPE i VALUE '1',
$v_start_row TYPE i VALUE '2',
$v_end_col TYPE i VALUE '256',
$v_end_row TYPE i VALUE '65536',
gd_currentrow TYPE i.
*Data Declaration for the table ZZSD0010
DATA : BEGIN OF it_zzsd0010 OCCURS 0.
INCLUDE STRUCTURE zzsd0010.
DATA : END OF it_zzsd0010.
*DATA : it1_zzsd0010 LIKE it_zzsd0010 OCCURS 0 WITH HEADER
LINE.
*Data Declaration for EXCEL TABLES
DATA :BEGIN OF it_tab_driver OCCURS 0,
mandt LIKE zzsd0010-mandt,
sorg LIKE zzsd0010-vkorg,
sdis LIKE zzsd0010-vtweg,
sdiv LIKE zzsd0010-spart,
gelco_princ_customer LIKE zzsd0010-princ_customer,
sell_div LIKE zzsd0010-kdgrp,
payer LIKE zzsd0010-payer,
qad_cust(10) TYPE c,
name(30) TYPE c,
broker(3) TYPE c,
END OF it_tab_driver.
DATA : it_tab_driver1 LIKE it_tab_driver OCCURS 0 WITH HEADER LINE.
DATA :BEGIN OF it_tab_lookup OCCURS 0,
rpc_ship_to(10) TYPE c,
rpc_sold_to(10) TYPE c,
rpc_bill_to(10) TYPE c,
type(10) TYPE c,
qad_ship_to(10) TYPE c,
qad_sold_to(10) TYPE c,
qad_bill_to(10) TYPE c,
sell_div1 LIKE zzsd0010-kdgrp,
broker(3) TYPE c,
END OF it_tab_lookup.
DATA : BEGIN OF it_knvv OCCURS 0,
kunnr LIKE knvv-kunnr,
vkorg LIKE knvv-vkorg, "V004
vtweg LIKE knvv-vtweg, "V004
spart LIKE knvv-spart, "V004
kdgrp LIKE knvv-kdgrp,
END OF it_knvv.
DATA: it_outfile(200) OCCURS 0 WITH HEADER LINE.
DATA: it_outfile1(200) OCCURS 0 WITH HEADER LINE. "V004
DATA: it_outfile2(200) OCCURS 0 WITH HEADER LINE. "V004
DATA: it_outfile3(200) OCCURS 0 WITH HEADER LINE. "V004
DATA: it_outfile4(200) OCCURS 0 WITH HEADER LINE. "V004
DATA: it_driver LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA: it_lookup LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
*--- Selection Screen
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text.
PARAMETERS : p_file LIKE rlgrap-filename DEFAULT
'C:\zzsd0010\driver.xls'.
PARAMETERS : p1_file LIKE rlgrap-filename DEFAULT
'C:\zzsd0010\lookup.xls'.
PARAMETERS : p2_file LIKE rlgrap-filename DEFAULT
'C:\zzsd0010\error.txt'.
PARAMETERS : p3_file LIKE rlgrap-filename DEFAULT
'C:\zzsd0010\warning_Sales_Div.txt'.
PARAMETERS : p4_file LIKE rlgrap-filename DEFAULT "V004
'C:\zzsd0010\warning_Sales_Org.txt'. "V004
PARAMETERS : p5_file LIKE rlgrap-filename DEFAULT "V004
'C:\zzsd0010\warning_Dist_channel.txt'. "V004
PARAMETERS : p6_file LIKE rlgrap-filename DEFAULT "V004
'C:\zzsd0010\warning_Division.txt'. "V004
PARAMETERS : p7_file LIKE rlgrap-filename DEFAULT "V004
'C:\zzsd0010\cust_not_found.txt'.
SELECTION-SCREEN : END OF BLOCK blk.
INITIALIZATION.
g_repid = sy-repid.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = g_repid
IMPORTING
file_name = p_file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p1_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = g_repid
IMPORTING
file_name = p1_file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p2_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = g_repid
IMPORTING
file_name = p2_file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p3_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = g_repid
IMPORTING
file_name = p3_file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p4_file. "V004
CALL FUNCTION 'F4_FILENAME' "V004
EXPORTING "V004
program_name = g_repid "V004
IMPORTING "V004
file_name = p4_file. "V004
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p5_file. "V004
CALL FUNCTION 'F4_FILENAME' "V004
EXPORTING "V004
program_name = g_repid "V004
IMPORTING "V004
file_name = p5_file. "V004
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p6_file. "V004
CALL FUNCTION 'F4_FILENAME' "V004
EXPORTING "V004
program_name = g_repid "V004
IMPORTING "V004
file_name = p6_file. "V004
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p7_file. "V004
CALL FUNCTION 'F4_FILENAME' "V004
EXPORTING "V004
program_name = g_repid "V004
IMPORTING "V004
file_name = p7_file. "V004
START-OF-SELECTION.
Get the data from XLS to Internal Table
PERFORM f1000_upload_driver_data.
PERFORM f2000_upload_lookup_data.
*UPDATE DATA BASE
SORT it_tab_driver BY gelco_princ_customer qad_cust.
SORT it_tab_lookup BY qad_sold_to.
CLEAR : it_tab_lookup,
it_tab_driver.
LOOP AT it_tab_driver.
CLEAR : it_tab_lookup.
IF
it_tab_driver-gelco_princ_customer = it_tab_driver-qad_cust.
Hit the sold-to column first, and if does not find a hit then try
the bill-to column.
READ TABLE it_tab_lookup
WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-mandt = it_tab_driver-mandt.
it_zzsd0010-vkorg = it_tab_driver-sorg.
it_zzsd0010-vtweg = it_tab_driver-sdis.
it_zzsd0010-spart = it_tab_driver-sdiv.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
it_zzsd0010-kunnr = it_tab_lookup-rpc_sold_to.
it_zzsd0010-payer = ' '.
it_zzsd0010-kdgrp = it_tab_driver-sell_div.
it_zzsd0010-ernam = sy-uname.
it_zzsd0010-erdat = sy-datum.
it_zzsd0010-erzet = sy-uzeit.
it_zzsd0010-aenam = sy-uname.
it_zzsd0010-aedat = sy-datum.
it_zzsd0010-aezat = sy-uzeit.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSEIF sy-subrc <> 0.
READ TABLE it_tab_lookup
WITH KEY qad_bill_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-mandt = it_tab_driver-mandt.
it_zzsd0010-vkorg = it_tab_driver-sorg.
it_zzsd0010-vtweg = it_tab_driver-sdis.
it_zzsd0010-spart = it_tab_driver-sdiv.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_bill_to.
it_zzsd0010-kunnr = it_tab_lookup-rpc_bill_to.
it_zzsd0010-payer = 'X'.
it_zzsd0010-kdgrp = it_tab_driver-sell_div.
it_zzsd0010-ernam = sy-uname.
it_zzsd0010-erdat = sy-datum.
it_zzsd0010-erzet = sy-uzeit.
it_zzsd0010-aenam = sy-uname.
it_zzsd0010-aedat = sy-datum.
it_zzsd0010-aezat = sy-uzeit.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSE.
it_tab_driver1 = it_tab_driver.
APPEND it_tab_driver1.
ENDIF.
ENDIF.
ELSEIF it_tab_driver-gelco_princ_customer <> it_tab_driver-qad_cust.
Hit the sold-to column first, and if does not find a hit then try
the bill-to column.
READ TABLE it_tab_lookup
WITH KEY qad_sold_to = it_tab_driver-qad_cust.
IF sy-subrc = 0.
it_zzsd0010-mandt = it_tab_driver-mandt.
it_zzsd0010-vkorg = it_tab_driver-sorg.
it_zzsd0010-vtweg = it_tab_driver-sdis.
it_zzsd0010-spart = it_tab_driver-sdiv.
it_zzsd0010-kunnr = it_tab_lookup-rpc_sold_to.
it_zzsd0010-payer = ' '.
it_zzsd0010-kdgrp = it_tab_driver-sell_div.
it_zzsd0010-ernam = sy-uname.
it_zzsd0010-erdat = sy-datum.
it_zzsd0010-erzet = sy-uzeit.
it_zzsd0010-aenam = sy-uname.
it_zzsd0010-aedat = sy-datum.
it_zzsd0010-aezat = sy-uzeit.
READ TABLE it_tab_lookup
WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSEIF sy-subrc <> 0.
READ TABLE it_tab_lookup
WITH KEY qad_bill_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_bill_to.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSE.
it_tab_driver1 = it_tab_driver.
APPEND it_tab_driver1.
ENDIF.
ENDIF.
ELSEIF sy-subrc <> 0.
READ TABLE it_tab_lookup
WITH KEY qad_bill_to = it_tab_driver-qad_cust.
IF sy-subrc = 0.
it_zzsd0010-mandt = it_tab_driver-mandt.
it_zzsd0010-vkorg = it_tab_driver-sorg.
it_zzsd0010-vtweg = it_tab_driver-sdis.
it_zzsd0010-spart = it_tab_driver-sdiv.
it_zzsd0010-kunnr = it_tab_lookup-rpc_bill_to.
it_zzsd0010-payer = 'X'.
it_zzsd0010-kdgrp = it_tab_driver-sell_div.
it_zzsd0010-ernam = sy-uname.
it_zzsd0010-erdat = sy-datum.
it_zzsd0010-erzet = sy-uzeit.
it_zzsd0010-aenam = sy-uname.
it_zzsd0010-aedat = sy-datum.
it_zzsd0010-aezat = sy-uzeit.
READ TABLE it_tab_lookup
WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSEIF sy-subrc <> 0.
READ TABLE it_tab_lookup
WITH KEY qad_bill_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_bill_to.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSE.
it_tab_driver1 = it_tab_driver.
APPEND it_tab_driver1.
ENDIF.
ENDIF.
ELSE.
it_tab_driver1 = it_tab_driver.
APPEND it_tab_driver1.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT it_tab_driver.
IF
it_tab_driver-gelco_princ_customer <> it_tab_driver-qad_cust.
READ TABLE it_tab_lookup
WITH KEY qad_sold_to = it_tab_driver-gelco_princ_customer.
IF sy-subrc = 0.
it_zzsd0010-mandt = it_tab_driver-mandt.
it_zzsd0010-vkorg = it_tab_driver-sorg.
it_zzsd0010-vtweg = it_tab_driver-sdis.
it_zzsd0010-spart = it_tab_driver-sdiv.
it_zzsd0010-princ_customer = it_tab_lookup-rpc_sold_to.
it_zzsd0010-kunnr = it_tab_lookup-rpc_sold_to.
it_zzsd0010-payer = ' '.
it_zzsd0010-kdgrp = it_tab_driver-sell_div.
it_zzsd0010-ernam = sy-uname.
it_zzsd0010-erdat = sy-datum.
it_zzsd0010-erzet = sy-uzeit.
it_zzsd0010-aenam = sy-uname.
it_zzsd0010-aedat = sy-datum.
it_zzsd0010-aezat = sy-uzeit.
PERFORM f6000_add_zeros_to_cust. "V004
APPEND it_zzsd0010.
INSERT INTO zzsd0010 VALUES it_zzsd0010.
PERFORM f5000_warning_file. "V004
CLEAR it_zzsd0010.
ELSE.
it_tab_driver1 = it_tab_driver.
APPEND it_tab_driver1.
ENDIF.
ENDIF.
ENDLOOP.
PERFORM f3000_data_base_not_updated.
PERFORM f4000_check_sales_division.
*& Form f1000_upload_driver_data
FORM f1000_upload_driver_data.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = $v_start_col
i_begin_row = $v_start_row
i_end_col = $v_end_col
i_end_row = $v_end_row
TABLES
intern = it_driver
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/10 'File '.
ENDIF.
IF sy-subrc EQ 0.
READ TABLE it_driver INDEX 1.
gd_currentrow = it_driver-row.
LOOP AT it_driver.
IF it_driver-row NE gd_currentrow.
APPEND it_tab_driver.
CLEAR it_tab_driver.
gd_currentrow = it_driver-row.
ENDIF.
CASE it_driver-col.
WHEN '0001'.
it_tab_driver-mandt = it_driver-value.
WHEN '0002'.
it_tab_driver-sorg = it_driver-value.
WHEN '0003'.
it_tab_driver-sdis = it_driver-value.
WHEN '0004'.
it_tab_driver-sdiv = it_driver-value.
WHEN '0005'.
it_tab_driver-gelco_princ_customer = it_driver-value.
WHEN '0006'.
it_tab_driver-sell_div = it_driver-value.
WHEN '0007'.
it_tab_driver-payer = it_driver-value.
WHEN '0008'.
it_tab_driver-qad_cust = it_driver-value.
WHEN '0009'.
it_tab_driver-name = it_driver-value.
WHEN '0010'.
it_tab_driver-broker = it_driver-value.
ENDCASE.
ENDLOOP.
ENDIF.
APPEND it_tab_driver.
ENDFORM. " f1000_upload_driver_data
*& Form f2000_upload_lookup_data
FORM f2000_upload_lookup_data.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p1_file
i_begin_col = $v_start_col
i_begin_row = $v_start_row
i_end_col = $v_end_col
i_end_row = $v_end_row
TABLES
intern = it_lookup
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/10 'File '.
ENDIF.
IF sy-subrc EQ 0.
READ TABLE it_lookup INDEX 1.
gd_currentrow = it_lookup-row.
LOOP AT it_lookup.
IF it_lookup-row NE gd_currentrow.
APPEND it_tab_lookup.
CLEAR it_tab_lookup.
gd_currentrow = it_lookup-row.
ENDIF.
CASE it_lookup-col.
WHEN '0001'.
it_tab_lookup-rpc_ship_to = it_lookup-value.
WHEN '0002'.
it_tab_lookup-rpc_sold_to = it_lookup-value.
WHEN '0003'.
it_tab_lookup-rpc_bill_to = it_lookup-value.
WHEN '0004'.
it_tab_lookup-type = it_lookup-value.
WHEN '0005'.
it_tab_lookup-qad_ship_to = it_lookup-value.
WHEN '0006'.
it_tab_lookup-qad_sold_to = it_lookup-value.
WHEN '0007'.
it_tab_lookup-qad_bill_to = it_lookup-value.
WHEN '0008'.
it_tab_lookup-sell_div1 = it_lookup-value.
WHEN '0009'.
it_tab_lookup-broker = it_lookup-value.
ENDCASE.
ENDLOOP.
ENDIF.
APPEND it_tab_lookup.
ENDFORM. " f2000_upload_lookup_data
*& Form f3000_data_base_not_updated
text
FORM f3000_data_base_not_updated .
CALL FUNCTION 'DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
filename = p2_file
filetype = 'ASC'
TABLES
data_tab = it_tab_driver1
FIELDNAMES =
EXCEPTIONS
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
customer_error = 7
OTHERS = 8
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. " data_base_not_updated
*& Form f4000_Check_Sales_Division
text
FORM f4000_check_sales_division .
SORT it_outfile.
SORT it_outfile1.
SORT it_outfile2.
SORT it_outfile3.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = p3_file
filetype = 'ASC'
TABLES
data_tab = it_outfile
EXCEPTIONS
invalid_filesize = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
customer_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'DOWNLOAD' "V004
EXPORTING "V004
filename = p4_file "V004
filetype = 'ASC' "V004
TABLES "V004
data_tab = it_outfile1 "V004
EXCEPTIONS "V004
invalid_filesize = 1 "V004
invalid_table_width = 2 "V004
invalid_type = 3 "V004
no_batch = 4 "V004
unknown_error = 5 "V004
gui_refuse_filetransfer = 6 "V004
customer_error = 7 "V004
OTHERS = 8. "V004
IF sy-subrc <> 0. "V004
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO "V004
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. "V004
ENDIF. "V004
CALL FUNCTION 'DOWNLOAD' "V004
EXPORTING "V004
filename = p5_file "V004
filetype = 'ASC' "V004
TABLES "V004
data_tab = it_outfile2 "V004
EXCEPTIONS "V004
invalid_filesize = 1 "V004
invalid_table_width = 2 "V004
invalid_type = 3 "V004
no_batch = 4 "V004
unknown_error = 5 "V004
gui_refuse_filetransfer = 6 "V004
customer_error = 7 "V004
OTHERS = 8. "V004
IF sy-subrc <> 0. "V004
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO "V004
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. "V004
ENDIF. "V004
CALL FUNCTION 'DOWNLOAD' "V004
EXPORTING "V004
filename = p6_file "V004
filetype = 'ASC' "V004
TABLES "V004
data_tab = it_outfile3 "V004
EXCEPTIONS "V004
invalid_filesize = 1 "V004
invalid_table_width = 2 "V004
invalid_type = 3 "V004
no_batch = 4 "V004
unknown_error = 5 "V004
gui_refuse_filetransfer = 6 "V004
customer_error = 7 "V004
OTHERS = 8. "V004
IF sy-subrc <> 0. "V004
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO "V004
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. "V004
ENDIF. "V004
CALL FUNCTION 'DOWNLOAD' "V004
EXPORTING "V004
filename = p7_file "V004
filetype = 'ASC' "V004
TABLES "V004
data_tab = it_outfile4 "V004
EXCEPTIONS "V004
invalid_filesize = 1 "V004
invalid_table_width = 2 "V004
invalid_type = 3 "V004
no_batch = 4 "V004
unknown_error = 5 "V004
gui_refuse_filetransfer = 6 "V004
customer_error = 7 "V004
OTHERS = 8. "V004
IF sy-subrc <> 0. "V004
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO "V004
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. "V004
ENDIF. "V004
ENDFORM. " f4000_Check_Sales_Division
*& Form f5000_warning_file
Sales area in KNVV table is compared with the sales area in
ZZSD0010 table and a warning file is created if any mismatch *
occurs *
FORM f5000_warning_file . "V004
IF it_zzsd0010-payer <> 'X'. "V003
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' "V002
EXPORTING "V002
input = it_zzsd0010-kunnr "V002
IMPORTING "V002
output = it_zzsd0010-kunnr. "V002
SELECT kunnr "V002
vkorg "V004
vtweg "V004
spart "V004
kdgrp "V002
INTO TABLE it_knvv "V002
FROM knvv "V002
WHERE kunnr = it_zzsd0010-kunnr. "V002
IF sy-subrc = 0. "V002
READ TABLE it_knvv WITH KEY kunnr = it_zzsd0010-kunnr.
IF it_zzsd0010-kdgrp <> it_knvv-kdgrp. "V002
CONCATENATE it_zzsd0010-princ_customer "V002
it_zzsd0010-kunnr "V002
it_zzsd0010-kdgrp "V002
it_knvv-kdgrp "V002
INTO it_outfile SEPARATED BY space. "V002
APPEND it_outfile. "V002
ENDIF. "V002
IF it_zzsd0010-vkorg <> it_knvv-vkorg. "V004
CONCATENATE it_zzsd0010-princ_customer "V004
it_zzsd0010-kunnr "V004
it_zzsd0010-vkorg "V004
it_knvv-vkorg "V004
INTO it_outfile1 SEPARATED BY space. "V004
APPEND it_outfile1. "V005
ENDIF. "V004
IF it_zzsd0010-vtweg <> it_knvv-vtweg. "V004
CONCATENATE it_zzsd0010-princ_customer "V004
it_zzsd0010-kunnr "V004
it_zzsd0010-vtweg "V004
it_knvv-vtweg "V004
INTO it_outfile2 SEPARATED BY space. "V004
APPEND it_outfile2. "V005
ENDIF. "V004
IF it_zzsd0010-spart <> it_knvv-spart. "V004
CONCATENATE it_zzsd0010-princ_customer "V004
it_zzsd0010-kunnr "V004
it_zzsd0010-spart "V004
it_knvv-spart "V004
INTO it_outfile3 SEPARATED BY space. "V004
APPEND it_outfile3. "V005
ENDIF. "V004
CLEAR it_outfile. "V002
CLEAR it_outfile1. "V004
CLEAR it_outfile2. "V004
CLEAR it_outfile3. "V004
CLEAR it_knvv. "V002
REFRESH it_knvv. "V002
ELSE. "V002
CONCATENATE 'CUSTOMER' "V002
it_zzsd0010-kunnr "V002
'NOT FOUND IN KNVV TABLE' "V002
INTO it_outfile4 SEPARATED BY space. "V002
APPEND it_outfile4. "V002
ENDIF. "V002
ENDIF. "V003
ENDFORM. " f5000_warning_file "V004
*& Form f6000_add_zeros_to_cust
text
--> p1 text
<-- p2 text
form f6000_add_zeros_to_cust .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' "V002
EXPORTING "V002
input = it_zzsd0010-kunnr "V002
IMPORTING "V002
output = it_zzsd0010-kunnr. "V002
endform. " f6000_add_zeros_to_cust -
Inserting a tab delimited file
Hi there,
I am inserting data into a database from text files. I can easily do this in sql with csv files but I need to be able to do it with tab delimited files. I know you can do this from the built in Oracle tool (I am using express edition) but I was wandering if anyone know how to write a script for it in sql.
Any help would be greatly appreciated.
ThanksIf you are using SQL Loader to load the data use below syntex
FIELDS TERMINATED BY X'9'
The X'9' is Hexadecimal Format -> X
and Hex 9 is the ASCII code of the TAB character.
Check out the link for more details:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:533222350291
Regards
Arun -
Download Tab Delimited file from spool!
Hi Experts,
Is there any way to download tab delimited txt file from spool?
Spool is created for Statements and Invoices from Sap Script and Smartform which is in OTF format.
I am able to download this in Text file but I need this file in tab delimited format.I don't understand what you want to do as it seems impossible : the spool contains miscellaneous data, not compatible with tab delimited files which are used to store 2-dimensional tables (columns, rows).
-
SQL-Loader Control file for Tab-delimited fields
i want to import a text-file with TAB-DELIMITED fields and a line-break + return at the end of each record.
a want to do this by sql-loader and a control file.
please, can someone give me the statement:
e.g.
load data
infile 'exaple.txt' .......
(...field1, field2,....)
thank you very muchCase Study 3: Loading a Delimited, Free-Format File
http://otn.oracle.com/pls/db92/db92.to_URL?urlname=http:%2F%2Fdownload-west.oracle.com%2Fdocs%2Fcd%2FB10501_01%2Fserver.920%2Fa96652%2Fch10.htm%231006907
Modify the example and use 'terminated by whitespace' instead
For more information on TERMINATED Fields see
http://otn.oracle.com/pls/db92/db92.to_URL?remark=drilldown&urlname=http:%2F%2Fdownload-west.oracle.com%2Fdocs%2Fcd%2FB10501_01%2Fserver.920%2Fa96652%2Fch06.htm%231013838 -
Report script. with pipe delimited?
hi
when i create script to extract some selective data with tab delimited it was ok
but how abt pipe delimited isit possible ?
i tried checking in oracle technical help but no use
for example
Account | Year | Period | instead of Account Year Period ( present script)
cheersi really appreciate ur help glenn
but i have this kind of issue
{Tabdelimited Rowrepeat no indentgen outmbrnames
supemptyrows supmissingrows supfeed sup commas supheading}
{ decimal 8 } {indentGen -5}
<row("year","period","scenario","Account".....blah blah
and i get output like this
jan FY09 Actual SG cust1
jan FY09 Actual UK
jan FY09 Actual IND
But iam looking for this
JKSG | 1 | FY09 | Actual | SG
JKUK | 2 | FY09 | Actual | UK
JKIND | 3 | Fy09 | Actual | IND
Tab delimited = pipe delimited
here i want to join Jk with calculating legal entity but what i wonder is Jk is not present in OUtline how can i keep in <ROW(....)
Can possible?
Edited by: user8800516 on Mar 9, 2010 12:02 AM -
File content conversion tab delimited
hello experts
I have a file sender txt interface with tab delimited.
in the channel I wrote row.fieldSeparator 0x09.
when the file is loading successfully to the PI' I see in the monitor that each line from the file is loaded to the first node of my DT file, and the rest of the nodes are still empty.
is there some other decleration that I need to write some where in order for the file to be loaded each row to the correct DT node? maybe to check some basis decleration? a regular file with comma delimited is working fine/
for example:
my DT is
aaaa
row
a
b
c
d
after loading the file the out put is
<aaaa>
<row>
<a>hello world good day</a>
</row>
<row>
<a>hi good day acvbd</a>
</row>
</aaaa>
(every space between the words is a TAB)
any suggestions?
Kfir
Kfirmy fault in writing the condition correctly.
forgot to add '
Maybe you are looking for
-
Stop Video when moving to another "state"?
Hello, I am not sure if this is a Flash Builder topic or a Flash Catalyst topic or I am guessing it is both. I have a Catalyst that contains multiple flv clips. I am discovering that when you play a video and then you decide to navigate to another
-
While using "dbua" I encountered a problem on the screen saying "cannot open the specified control file" and I was directed to see the new alert log. The alert log has several lines with messages like: WARNING:NFS mount of file <PATH>control01.ctl on
-
Appending a file using i/o
import java.io.Console; import java.io.FileWriter; import java.io.PrintWriter; import java.io.Writer; import java.io.IOException; import java.io.File; class appendfilewritter public static void main(String args[]) throws IOException Console c=System.
-
Hi, I'm about to get an iPod touch and this will be the first time that I'll have a mobile device that can support apps. So I'm downloading a couple and I notice they load into the dock and not iTunes. Will they transfer over to the iPod automaticall
-
STS hierarchy error Hi there After we upgraded to BI 7.0 and SEM 6.0 we are facing problem with the STS hierarchy. Before the upgrade each user will go to the planning page corresponding to his/her assigned department directly. After the upgrade, all