Regarding Date format in output text file
Hi Frnds,
i am taking the data from vbak table into one internal table T_vbak, in that i am having vdatu field also, and after that using GUI_Download function module i am downloading that internal table data to one text file into presentation server.
But the date format is displaying in yyyymmdd format in the text file, but i want the format like mm/dd/yyyy in the text file, can anybody plz help me....
Hey Bala,
You can use the following conversion routine for converting the date from yyyymmdd format into mm/dd/yyyy.
data: l_date(10) type c.
Loop at t_vbak into wa_vbak.
CONCATENATE wa_vbak-vdatu4(2) wa_vbak-vdatu6(2) wa_vbak-vdatu(4) INTO l_date SEPARATED BY '/'.
wa_vbak-vdatu = l_date.
modify t_vbak from wa_vbak.
Endloop.
Regards,
Chetan.
PS: Reward points if this helps.
Similar Messages
-
Formatting of output text file.
I am writing values of variables to a text file. I also have column headings. Some of the column headings are long, perhaps 14 characters. The field for my variable values is only 8 characters long. Thus I would like to install a tab or two between my column headings so that they line up w my values. How may I do that?
You can specify a length with the format string.
So, if the longest string is 14 characters, specify %14s as the format string. Your text will be right justified. If you want the text to appear at the left, use a format specifier of %-14s.
Don't play around with multiple TABs, it will make the file difficult to read in other apps like Excel.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness -
Error with the data format in the TXT file, sending as an Email attachment
Hi all,
I have an problem in the data formating in the TXT file while sending as an attachment via an email by using the FM "SO_DOCUMENT_SEND_API1".
For eg:
The data in the TXT file is looking like as follows:
0 0 0 0 2 L O U D S P E A K R O T H E R 3 8 W h i t e 0 0
0031 L O U D S P E A K R O T H E R 3 8 Black 0 000
38 L O U D S P E A K R O T H E R 3 8 Brown 0 00040
L O U D S P E A K R O T H E R 3 8 Brown 0 00042
and so on
But it should come as :
0 0 0 0 2 L O U D S P E A K R O T H E R 3 8 W h i t e
0 0 0031 L O U D S P E A K R O T H E R 3 8 Black
0 00038 L O U D S P E A K R O T H E R 3 8 Brown
0 00040 L O U D S P E A K R O T H E R 3 8 Brown
All the internal tables are correctly filled.
The code is as follows:
gwa_objtxt = 'Please find attached DATA EXTRACT Sheet'.
append gwa_objtxt to git_objtxt.
describe table git_objtxt lines gv_cnt.
clear git_doc_data.
read table git_objtxt index gv_cnt.
git_doc_data-doc_size = ( gv_cnt - 1 ) * 255 + strlen( gwa_objtxt ).
git_doc_data-obj_langu = sy-langu.
git_doc_data-obj_descr = lv_mtitle.
append git_doc_data.
clear git_packing_list.
refresh git_packing_list.
git_packing_list-transf_bin = space.
git_packing_list-head_start = 1.
git_packing_list-head_num = 0.
git_packing_list-body_start = 1.
git_packing_list-body_num = gv_cnt.
git_packing_list-doc_type = 'RAW'.
append git_packing_list.
Clear : gv_cnt.
Describe table git_objbin lines gv_cnt.
git_packing_list-transf_bin = 'X'.
git_packing_list-head_start = 1.
git_packing_list-head_num = 1.
git_packing_list-body_start = 1.
git_packing_list-body_num = gv_cnt.
git_packing_list-doc_type = 'TXT'.
git_packing_list-obj_descr = 'ATTACH.TXT'.
git_packing_list-obj_name = 'book'.
git_packing_list-doc_size = gv_cnt * 255.
APPEND git_packing_list.
clear git_receivers.
refresh git_receivers.
git_receivers-receiver = gv_eid.
git_receivers-rec_type = 'U'.
append git_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_DATA = git_doc_data
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = git_packing_list
CONTENTS_BIN = git_objbin
CONTENTS_TXT = git_objtxt
RECEIVERS = git_receivers
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.please give the code of
contents bin = git_objbin " how this is getting populated.
0 0 0 0 2 L O U D S P E A K R O T H E R 3 8 W h i t e <b>0 0</b>
0031 L O U D S P E A K R O T H E R 3 8 Black
0 000
38
from this im not able to understand is this over population or concatenation problem
y dont u make a append to the final table
like
data : begin of itxt occurs 0, ,
s1(132) type c ,
end of itxt.
loop at itab.
itxt-s1+0(4) = itab-f1.
itxt-s1+4(6) = itab-f2.
itxt-s1+10(8) = itab-f3.
itxts1+18(4) = itab-f4.
append itxt.
clear itxt.
endloop.
exchange this to the contents bin of hte Fm .
regards,
vijay.
can u please mail the text file and the expected o/p to my mail id [email protected] so that i can see the same from the data provided i m not able to check the result properly . -
Download data to Fixed Length Text File
Can anyone share the sample code on how to download data into fixed length text file and place the file in the server directory?
One way i would advice is to declare a text variable and move values using offset.
Eg:
move: <struc>-fld1 to l_text(8),
<struc>-fld2 to l_text+8(3),
<struc>-fld3 to l_text+11(15).
transfer l_text to <file>.
Try this approch and see the result.
Kind Regards
Eswar -
Problem with SQL*Loader and different date formats in the same file
DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
System: AIX 5.3.0.0
Hello,
I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
...;2010-12-31;22/11/1932;...
I load this data using the following lines in the control file:
EXECUTIONDATE1 TIMESTAMP NULLIF EXECUTIONDATE1=BLANKS "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
DELDOB TIMESTAMP NULLIF DELDOB=BLANKS "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
The relevant NLS parameters:
NLS_LANGUAGE=FRENCH
NLS_DATE_FORMAT=DD/MM/RR
NLS_DATE_LANGUAGE=FRENCH
If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
How can I get both date values to load correctly?
Thanks!
SylvainThis is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(
-
How to load date and time from text file to oracle table through sqlloader
hi friends
i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
this is my data in this path (c:\external\my_data.txt)
7369,SMITH,17-NOV-81,09:14:04,CLERK,20
7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
7566,JONES,02-APR-81,09:24:10,MANAGER,20
7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
create table emp2 (empno number,
ename varchar2(20),
hiredate date,
etime date,
ejob varchar2(20),
deptno number);the control file code in this path (c:\external\ctrl.ctl)
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>any help i greatly appreciated
thanks
Edited by: user10947262 on May 31, 2010 9:47 AMload data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)Try
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>
That's not an error, you can see errors within log and bad files. -
SQL Loader-How to insert -ve & date values from flat text file into coloumn
Question: How to insert -ve & date values from flat text file into coloumns in a table.
Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
How to load such values in columns of database using SQL Loader?
Please guide.Question: How to insert -ve & date values from flat text file into coloumns in a table.
Explanation: In the text file, the negative values are like -10201.30 or 15317.10- and the date values are as DDMMYYYY (like 10052001 for 10th May, 2002).
How to load such values in columns of database using SQL Loader?
Please guide. Try something like
someDate DATE 'DDMMYYYY'
someNumber1 "TO_NUMBER ('s99999999.00')"
someNumber2 "TO_NUMBER ('99999999.00s')"Good luck,
Eric Kamradt -
Convert created idoc to an output text file
Hi,
How can i convert an idoc to an output text file? is there a standard program in SAP that does this?
Thanks,
TotsHi,
We can do it.
The steps are
1. Create a xml file port (we21)
2. Create a partner profile point to the file port.
3. Make sure the idocs are genereated.
4 . Run the staandard program (RSEOUT001) with the port and required details in teh selection screen.
The idocs will be generated to a xml file .
Regards -
Mail Adapter: How to send data as a simple text file attachment?
Hi All
I have a proxy to file scenario, where i write data to a text file.
Now, i need to have a second receiver. I have to send an email, with the above file as an attachment, to this receiver.
How can i do this?
How can i send the data as a text file attachment to the receiver?
Many Thanks
ChandraHi,
To send the message to the second receiver you need to have:
1) Necessary mail message format (can download from service marketplace)
2) Receiver mail communication channel.
3) Create the necessary Configuration Objects .... Receiver Determination, Interface Determination, Receiver Agreement.
3) You can do a XSLT mapping (if required)....if no complex logic is needed then you can do a simple Message mapping.
4) In the receiver CC make sure that you check the Adapter Specific Message Attribute checkbox.
For more info you can refer my answer in this thread:
Re: xml in mail
Also refer the blog:
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
Regards,
Abhishek. -
Transfer Data from excel to text file or SAP R/3
Hi,
Can anyone please let me know if there is any function module to transfer data from excel to a .txt file.
I am using a CRM 5.0 system and some standard SAP function modules are missing.
I want to fetch data from excel to SAP R/3.
Wish you great time.
Best Regards
SidHi Sid,
extracting data from an excel sheet to SAP u can use the function module GUI_UPLOAD.
I am providing u its parameters also as it might be useful to u.
The mandatory fields here are FILENAME n in TABLES (in which u will be saving ur data).
and also if u need to download from sap to any file u can use GUI_DOWNLOAD in which u can save data in both excel or txt file.
U can also use SAP_CONVERT_TO_TEX_FORMAT function module to convert into text file.
Rewards would be highly appreciated. Thanks.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB =
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. -
Regarding Date Format Conversion
Hi,
In my project i am picking the date from the date picker which is a javascript program . Then i am displaying it on a jsp page .It is coming in mm/dd/yyyy format .I have to change it to dd/mm/yyyy format .
I have the code for date formatting conversion .
What my doubt is whether the code should be written inside the jsp page or in the javascript .
Thanks .Hi
<%@page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<%SimpleDateFormat sdf= new SimpleDateFormat(dd/mm/yyyy );%>
<% java.util.Date temp_date = sdf.parse(PassYourDateHere); %>
use this with your jsp
Regards
Abhijith YS -
Date format (YYMMDD ) for the file
HI All,
I need to place a file with file name that should include the date in the format YYMMDD. Currently the format is DDMMYY.
How can i do that?
Thanks In advance!!Perhaps by changing the date format in the personal settings of the user that creates the file.
Check transaction su01 - username - defaults
Kind regards,
Mark -
How to export data in to a Text File
Hi,
Can anyone provide any guidance of exporting data in an Advanced Table or data of a VO in to a Text File instead of CSV file.
ThanksExporting 5 mil records is going to require lot of memory and even if you implement, the users are not going to like it.
May be, you can implement a 'submit' button and when the user clicks submit a concurrent program. This concurrent program will generate the output file.
You can do other fancy things like displaying the status and to download the file in OAF itself.
HTH
Srini -
Hi,
I have 2 text file that should be statically outputted with specific parameters ,
what is the best way to do that?
RegardsTo get all the files present in a specific directory on the application server
REPORT ZSRK_045 .
TABLES EPSF.
PARAMETERS DIR LIKE EPSF-EPSDIRNAM DEFAULT 'D:\usr\sap\ERP\DVEBMGS00\work'.
"Give the app server directory name where u have stored the files
" go to AL11 tcode to check the directory name
DATA : FILECOUNTER LIKE EPSF-EPSFILSIZ,
ERRORCOUNTER LIKE EPSF-EPSFILSIZ,
DIRLIST TYPE TABLE OF EPSFILI WITH HEADER LINE.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
DIR_NAME = DIR
FILE_MASK = ' '
IMPORTING
DIR_NAME = DIR
FILE_COUNTER = FILECOUNTER
ERROR_COUNTER = ERRORCOUNTER
TABLES
DIR_LIST = DIRLIST
EXCEPTIONS
INVALID_EPS_SUBDIR = 1
SAPGPARAM_FAILED = 2
BUILD_DIRECTORY_FAILED = 3
NO_AUTHORIZATION = 4
READ_DIRECTORY_FAILED = 5
TOO_MANY_READ_ERRORS = 6
EMPTY_DIRECTORY_LIST = 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.
LOOP AT DIRLIST.
WRITE : / DIRLIST-NAME, DIRLIST-SIZE.
ENDLOOP. -
How to save report data as a plain text file
running APEX 4.0. I have to extract some query data to send via a text file. I see that my report options are RTF, CSV or XML - is there a way to get it out as TXT?
The Data Unload does have this option but the data is not from a single table (though I can dump it all into a temp table if this is the only way to export as TXT) but is it possible to have the end user run the Data Unload from an application or is this just a developers option?
The goal is to have a user be able to run the report and save it as TXT without having to "do" anything other than click a button.I put it as a before header process on a blank page - when the page is called from a button, this htp.prn runs, you save the file, and with the
htmldb_application.g_unrecoverable_error := true; at the end, the rest of that page doesn't run.
Maybe you are looking for
-
How to get DBMS_LOB standard package
Where can I get DBMS_LOB standard package? and how to use it in my FORM application?
-
TS1702 The movie has no longer a fast link to my movies purchases
From my ipad in itunes in the movie tab there is no longer a fast link to my movie purchases what do i do?
-
How to run RFID on Standard xMAM3.0
Hi All, We are doing enhancements to the standard xMAM3.0 Application. We have to do enhancements to standard RFID functionality. I have downloaded the standard xMAM3.0 from service market place and uploaded to webconsole and then assigned MI Client.
-
Hello all, I have an issue regarding the travel expense print form. The problem is not related to the printer, it is related to the PDF-File which is created. In the PDF-File, the left margin is wrong. Thus, it can not be printed correctly due to the
-
Please help?