Urgent : Doubt on Output in UNIX FIle
HI Friends,
I have downloaded the output from my program into a text file.
In which i have 1matnr,1tab,1price.
it coming perfectly. I am using constant
constant: c_a type x value '09'.
this is giving a tab in text file.When i checked the output in Unix file, In the place of Tab a
Hash(#) is replaced there.
Can anybody help me to get only a material numer one tab and then a Date.
or Is it like a Hash is the denotion for a Tab in unix.
Hi gokul
I think you need to change File type in FM: WS_DOWNLOAD as 'DAT' or 'ASC' .
Regards
wiboon
Similar Messages
-
Redirect SM50 output on unix file
Hello,
how can we execute daily SM50 daily and redirect html output on unix file?
I Tried SE38, execute SM50 succefully, but no way to redirect output of this transaction on a unix file ?
Thanks in advance.Hi majda,
Hope you are doing good.
Maybe check /nSM49 and create a OS command using ">>" operator Divyanshu mentioned:
Restrict Authorizations for Executing External Commands - SAP NetWeaver Application Server ABAP Security Guide - SAP Lib…
Thank you!
Kind Regards,
Hemanth
SAP AGS -
Direct RMAN output to UNIX file
How i could direct RMAN output to a file
How, indeed? Hmm.....
Wouldn't it be great if Oracle compiled information about their various software products and published it? Even better, what if they published it online, and made it available for free??
Wouldn't that be great?
Oh, wait, what's this?
http://tahiti.oracle.com/
http://www.oracle.com/pls/db102/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fbackup.102%2Fb14191%2Frcmarchi002.htm%23sthref48
http://www.oracle.com/pls/db102/to_URL?remark=ranked&urlname=http:%2F%2Fdownload.oracle.com%2Fdocs%2Fcd%2FB19306_01%2Fbackup.102%2Fb14191%2Frcmcnctg006.htm%23sthref462
-Mark -
Output device - printing in unix file - where do I define the UNIX path?
Hi,
We use an special Output Device to print spool requests directly in Unix. These Output Devices are defined as Local Unix File. When those spool requests are printed, a file is created in certain path in UNIX.
The question is where this link is defined?, I dont see where in the Output Device (trn SPAD) is defined the path in UNIX.
Thanks!
AaronHi,
Might be the unix path would have been defined in the SPAD only under the Access method of the output device, in the field Destination host.
Regards,
Aditya -
URGENT : Writing to UNIX file problem !
Hi friends,
I am stuck at a crucial point while uploading a UNIX file from ABAP program.
I am using open dataset & then transfer to...the file path.
But when I go and check the UNIX file it is split into 2 lines (it is supposed to be a
record with 1 line with 1500 characters) ! It shows a maximum of 255 chars in one line.Moreover,while I download to a text file via Txn CG3Y,some data are missing or truncated etc.
Please suggest how can I create a record with 1500 characters in UNIX and download it successfully with full data or how can I ensure proper data has been transferred as the record display is truncated.I checked the program its fine,only after transferring I get the problem.
Thanks,
Sandip.The files would not get truncated. The file actually exists in App. server but you will be able to see only uptil 255 characters. You can check the same by downloading it onto Pres. server by specifying file type as BIN when you are downloading through CG3Y
-
Unix file system & Oracle datafiles--urgent plz
How i can chech my oracle db files on which unix file system? In HP/UX exvirnment??
select * from dba_data_files
AUTOEXTENSIBLE column gives you whether autoextend is on or not.
Join with dba_free_space to get free space for each file.
You can check the following link
http://www.oracle.com/technology/oramag/code/tips2003/083103.html -
Unable to Open unix file in UNICODE system which created NON-UNICODE system
Unable to Open unix file in UNICODE system which created in NON-UNICODE system
We have two SAP systems both are ECC6.0 but System 1 is NON-Unicode and System2 is Unicode system.
There is a common unix directory/folder for both system.
Our requirement is to create one file on unix common folder and write the data to file from system1 .
In system2 open the same file for appending mode to write the data .
The file in system 1 created with below sentence.
OPEN DATASET g_unix_file FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
Now I have to append the data from system 2 to same file.
I have tried to used below statement in system 2 to open the file but sy-subrc value comes as '8'.
1> OPEN DATASET g_unix_file FOR APPENDING IN TEXT MODE ENCODING UTF-8.
2>OPEN DATASET g_unix_file FOR APPENDING IN legacy TEXT MODE CODE PAGE
cdp IGNORING CONVERSION ERRORS .
3>OPEN DATASET g_unix_file FOR APPENDING IN TEXT MODE ENCODING Default.
4>OPEN DATASET g_unix_file FOR APPENDING IN TEXT MODE ENCODING NON-UNICODE.
Tried out all the possibilities as per F1 help given for open dataset , but still there is problem with opn file in appending as well output mode.However the file successfully open in Input mode(Read).
Please advice suggestion to resolve this issue.
Thanks.Messgae captured as 'Permission Denied". The program gets triggered with system user Id PPID.
How to check the security access of the User ID. -
How to upload pdf file format in unix file directory?
how to upload pdf file format in unix file directory?
Hi Karthikeyan,
If you have PDF internal table with you, You can follow the below method to upload into Unix directory.
DATA:file_path TYPE char100 VALUE '/usr/sap/tmp/rep_out.PDF'.
OPEN DATASET file_path FOR OUTPUT IN BINARY MODE.
IF sy-subrc EQ 0.
LOOP AT it_pdf.
TRANSFER it_pdf TO file_path.
ENDLOOP.
ENDIF.
CLOSE DATASET file_path.
Thanks
Venkat.O -
Allowing user to submit unix file on selection screen.
how to allow the user to submit the unix file on selection screen.
based on that file data ,the selection screen shd be populated automatically.Refer Sample Code:
constants: c_split TYPE c
VALUE cl_abap_char_utilities=>horizontal_tab,
c_path TYPE char100
VALUE '/local/data/interface/A28/DM/OUT'.
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : rb_pc RADIOBUTTON GROUP r1 DEFAULT 'X'
USER-COMMAND ucomm, "For Presentation
p_f1 LIKE rlgrap-filename
MODIF ID rb1, "Input File
rb_srv RADIOBUTTON GROUP r1, "For Application
p_f2 LIKE rlgrap-filename
MODIF ID rb2, "Input File
p_direct TYPE char128 MODIF ID abc DEFAULT c_path.
"File directory
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f1.
*-- Browse Presentation Server
PERFORM f1000_browse_presentation_file.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f2.
*-- Browse Application Server
<b>PERFORM f1001_browse_appl_file.</b>
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rb_pc = 'X' AND screen-group1 = 'RB2'.
screen-input = '0'.
MODIFY SCREEN.
ELSEIF rb_srv = 'X' AND screen-group1 = 'RB1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'ABC'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*& Form f1000_browse_presentation_file
Pick up the filepath for the file in the presentation server
FORM f1000_browse_presentation_file .
CONSTANTS: lcl_path TYPE char20 VALUE 'C:'.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = lcl_path
mask = c_mask "',.,..'
mode = c_mode
title = text-006
IMPORTING
filename = p_f1
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.
flg_pre = c_x.
ENDIF.
ENDFORM. " f1000_browse_presentation_file
*& 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 e000(zmm) WITH text-039.
flg_app = 'X'.
ENDIF.
ENDFORM. " f1001_browse_appl_file
*& Form f1003_pre_file
Upload the file from the presentation server
FORM f1003_pre_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_f1.
IF p_f1 IS NOT INITIAL.
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.
IF sy-subrc <> 0.
MESSAGE s000 WITH text-031.
EXIT.
ENDIF.
ELSE.
PERFORM populate_error_log USING space
text-023.
ENDIF.
ENDFORM. " f1003_pre_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 EQ 0.
*-- Split The CSV record into Work Area
PERFORM f0025_record_split.
*-- Populate internal table.
APPEND wa_input TO i_input.
CLEAR wa_input.
IF sy-subrc <> 0.
MESSAGE s000 WITH text-030.
EXIT.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
ENDFORM. " f1004_app_file
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-bu_partner
wa_input-anlage.
ENDFORM. " f0025_record_split
Thanks
Seshu -
Hi Gurus,
I am converting data in an internal table (consisting of 5000 records) into XML string using CALL TRANSFORMATION. All data is stored in XML format in a variable of type STRING.
I am trying to write this data in a Unix file using TRANSFER statement.
The problem is all data is not copied into the file!
Can anyone suggest a suitable solution so that complete data in the string variable will be reflected in the file?
Regards,
JackHi,
If you are opening the file in text mode, your itab fields have to be character type fields. So define another itab with fields of character type with lengths defined as per your output requirements.
You have understand that if you have floating, decimal fields, currency or quantity fields in your itab, they are know to SAP only, once you try to download such records, converting them into character form needs to happen.
Did you try the binary mode with your 'open dataset' statement?
Srinivas -
Unix file to be converted to proper excel format
Hi Ima writing data to unix file but when i want to download from there in excel format i data is not not aligned in excel format
please let me know the seperator to be used to upload to unix which can be converted to excel with good alignment.
i tried seperator '09' but didn't work and my version is 4.6 c so i can not use the encoding command or the classes.
pls guide
OPEN DATASET p_unix FOR OUTPUT IN TEXT MODE MESSAGE v_message .
IF NOT sy-subrc IS INITIAL.
MESSAGE e398(00) WITH text-008 p_unix v_message space.
ENDIF.
** Write header to unix file
LOOP AT gt_fieldcat1 INTO st_fieldcat1.
CONCATENATE st_rec st_fieldcat1-seltext_l
INTO st_rec
SEPARATED BY ','.
ENDLOOP.
CONDENSE st_rec.
TRANSFER st_rec TO p_unix.
** Write data to unix file
LOOP AT <fs_table> ASSIGNING <fs_struc>.
CLEAR: st_rec.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_struc> TO
<field>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
v_field = <field>.
IF v_field IS INITIAL.
CONCATENATE st_rec v_field ','
INTO st_rec .
ELSE.
CONCATENATE st_rec v_field ','
INTO st_rec.
ENDIF.
ENDDO.
TRANSFER st_rec TO p_unix.
ENDLOOP.
Close unix file
CLOSE DATASET p_unix.Although I dislike MPEG-1 because of the large file size those .mpg files are commonly used on the Web. They can be played by nearly any computer and are not "Player" dependent like WMP or QuickTime so each user can decide how to view them.
As a bonus they are a "playback" format which makes editing and repurposing them a bit more difficult so your media is a bit more "secure".
I'll stick to QuickTime formats (avoiding H.264 video codec) and force QuickTime down their WiMPy throats. Millions of PC's have QuickTime installed (because of iTunes) and others can easily download the free Player and browser plug-in. By avoiding H.264 my files can be viewed on Mac's and PC's that can't install QuickTime 7. -
About download file into unix file
Hi expert,
i use the openset to write file into unix file server.
but why there are some space at the end of every line.
by the way, i works very well in windows server
DATA: DATA_TRANSFER(70).
Data: DATA_TRANSFER type string.
data: fine_riga1(1) TYPE X VALUE '0D0A'.
DATA: gt_data TYPE STANDARD TABLE OF ty_data.
Constants: ascii_tab type x value ','.
field-symbols: <f> type any, <delim> type any.
"Assign delimiter field such as tab or comma.
assign ASCII_tab to <delim>.
CLEAR VN_CNT.
concatenate DSNU 'employee' PN-BEGDA SY-UZEIT into P_UNIX.
OPEN DATASET P_UNIX in legacy text MODE FOR OUTPUT. " IN TEXT MODE encoding UTF-8.
IF SY-SUBRC <> 0.
WRITE: / 'Error on file open:', P_UNIX.
ELSE.
LOOP AT TI_DATA .
CLEAR DATA_TRANSFER.
concatenate TI_DATA-TYPE
TI_DATA-PERNR
TI_DATA-ZAUSW
TI_DATA-ENAME
TI_DATA-TERID
INTO DATA_TRANSFER separated by cl_abap_char_utilities=>HORIZONTAL_TAB.
CONDENSE DATA_TRANSFER NO-GAPS.
TRANSFER DATA_TRANSFER TO P_UNIX.
ADD 1 TO VN_CNT.
CLEAR DATA_TRANSFER.
ENDLOOP.
CLOSE DATASET P_UNIX.
ENDIF.
WRITE: / P_UNIX,
/ 'Transfered', VN_CNT, 'records'.
Best Regards,
KevinHi,
Try this way...
TRANSFER dobj TO dset [LENGTH len]
[NO END OF LINE].
Addition 1
... LENGTH len
Effect
This addition determines how many characters or how many bytes of data object dobj are written to the file. len is expected to be a data object of type i that contains the number of characters or bytes. In text files, the content of len specifies the number of characters that are written from the storage. For binary files, legacy text file, and legacy binary files, len specifies the number of bytes that are written to the file. The first len characters or bytes are transferred and alignment gaps are included in the structures. If the addition LENGTH is not specified, all characters or bytes are transferred.
If the value of len is less than or equal to 0, no characters or bytes are transferred. If the file is opened as a (legacy) text file, however, a line end marker is inserted into the file by default. If the value of len is greater than the number of characters or bytes in dobj, hexadecimal 0 or blank characters are transferred to the file instead of the missing bytes or characters, depending on whether the file was opened as a (legacy) text file or a (legacy) binary file. -
REPORT output to possible files formats
Hi Folks
How can we tranasfer a REPORT output to any file like( .XLS, .XML, or to anyother possible file). Can u give all the possible file procedures.
Thanks in advance.
I wont forget to reward points.
Regards,
RamHi Ram,
Use can very well use the function module 'GUI_DOWNLOAD'.
The below code clarifies your doubt as how to mention the path in the selection screen.
tables: mara.
data: itab type standard table of mara.
select-options: s_matnr for mara-matnr.
parameters: filename like rlgrap-filename default 'C:\materail_details.xls'. " download filename
start-of-selection.
select *
from mara
into table itab
where matnr in s_matnr.
perform file_download.
*& Form file_download
text
--> p1 text
<-- p2 text
form file_download .
data: filename1 type string.
filename1 = filename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = filename1
FILETYPE = 'DAT'
tables
data_tab = itab
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
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. " file_download
Here C:\material_details.xls is the path to save your file. In the same way you can save a text file also.
Hope this clarifies your doubt.
Regards
Sayee -
Downloading output as pdf file
hello all,
i have one doubt...how to download one report's output as PDF file.hi,
chk this.
FM is CONVERT_OTF.
CALL FUNCTION "CONVERT_OTF"
EXPORTING FORMAT = "PDF"
IMPORTING BIN_FILESIZE = FILE_LEN
TABLES OTF = OTFDATA
LINES = PDFDATA
EXCEPTIONS ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
also check sample programs
RSTXPDF4/5.
rgds
anver
pls amrk hlpful asnwers -
Converting Excel Output to Text File (Text(MS-DOS)) in oracle 6i
I have been able to save Excel Output to Text File (.txt) using OLE. However, I need to save it as TEXT(MS-DOS) specifically due to certain formatting issues.
Kindly suggest some solution.
I need it very urgently.
Thanks!Hello Sandy,
does this mean that you created an Excel file using OLE and named it *.txt?
And what do you mean by saving as TEXT(MS-DOS)? A csv file?
Regards
Marcus
Maybe you are looking for
-
How to getcapabilities of user who logged into IDM?
Hi All, I am having the same problem. I have posted this question earlier also. But some one said forms will always have the refrence of the configurator. But in the documentation its is said that <ref>:display.session</ref>, will be a valid Identity
-
Wireless Anchor SSID for CWA ISE 1.3
Hello Team, Trying to follow this guide: http://www.cisco.com/c/en/us/support/docs/security/identity-services-engine/115732-central-web-auth-00.html#anc11 We are trying to enable for a guest access with an anchored WLC. However when we create the SSI
-
Get the number of elements in Array
Hi everyone, Could anyone give me idea on how to get the number of elements in an Array (not number of rows) ? I tried to find that in both property node and array functions but nothing. Thanks, -Kun
-
Php with xsl on Sun Java Web Server 7.0
Hi anyone, i installed php as nsapi via phppack. Now i need xsl support in php. I've tryed to compile php with the following line (php 5.2.6): ./configure with-nsapi=/export/netscape_71 enable-force-cgi-redirect with-gettext with-zlib --with-xsl=/usr
-
Where is WPS button on PIMA5650
How to wireless link PIXMA 5650 to laptop. Cannot find WPS button. Can tyou help Solved! Go to Solution.