Gui_download - last line
Hi,
The function module gui_download always create a blank line at the end of file created.
But I need a file without this last line.
How can I do that ?
Thanks !
I solved this problem with BIN mode.
See this code example
DATA: FILESIZE TYPE I.
CALL FUNCTION 'SCMS_TEXT_TO_BINARY'
IMPORTING
OUTPUT_LENGTH = filesize
TABLES
TEXT_TAB = i_record
BINARY_TAB = i_Record
filesize = filesize - 1. "TRUNCATED LAST LINE!!!
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = filesize
filename = l_file
filetype = 'BIN'
TRUNC_TRAILING_BLANKS = 'X'
TRUNC_TRAILING_BLANKS_EOL = 'X'
WRITE_LF_AFTER_LAST_LINE = ' '
TABLES
data_tab = i_record
Hope this can help you.
Similar Messages
-
Brand new Mac Book Pro
Purchased in Mexico's Department store Liverpool on June 20th 2012
Purchased Memory upgade to 8Gb, on june 27th, at Apple Store Memorial City, Houston
Upgraded memory from 4Gb to 8Gb on June 28th.
Tried to write on my external HD (previously written on a windows based PC) with no success.
Upon reccomendation from a Mac assistant, copied all my external HD contents into my Mac Hard drive.
Then formatted my external HD and copied back all my information to it.
deleted all the information from my MacBook Pro HD.
Attempted to repeat the same operation with another external HD, but got a message saying there was not enough epace on the computer HD (even though I have a 750Gb Hard Drive.
Looked in the trash bin and there it was, all the information previously deleted..
Could not empty the trash bin, although I got a message asking me to safely delete all the information from the trash bin,
Could not get enough space released, after several attpempts the trash bin was finally emptied.
All happy getting acquainted with my new MacBook Pro. Two days later, got a gray screen and not able to start the computer.
Looking in to Mac support I found article http://support.apple.com/kb/TS2570 and followed instructions to perform a safe boot:
"Perform a Safe Boot
Simply performing the Safe Boot may resolve this issue.
Shut down your Mac. If necessary, hold your Mac's power button for several seconds to force it to power down.
Start your Mac, then immediately hold the Shift key. This performs a Safe Boot. Advanced tip: If you want to
see the status of a Safe Boot as it progresses, you can hold Shift-Command-V during start up (instead of just Shift).
Note: A Safe Boot takes longer than a typical start up because it includes a disk check and other operations.
The following is the script that appears on the screen upon safe boot. and halt after the last line.
AppleACPICPU:Processor Id=6 LocalAplicId=255 Disabled
AppleACPICPU:Processor Id=7 LocalAplicId=255 Disabled
AppleACPICPU:Processor Id=8 LocalAplicId=255 Disabled
calling mpo_policy_init for TMSafetyNet
Security policy loaded: Safety net for Time Machine (TMSafetyNet)
calling mpo_policy_init for Sandbox
Security policy loaded: Seatbelt sandbox policy (Sandbox)
calling mpo_policy_init for Quarantine
Security policy loaded: Quarantine Policy (Quarantine)
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All Rights Reserved.
MAC Framework Succesfully initializad
using 16384 buffer headers and 10240 cluster IO buffer headers
IOAPIC: Version 0x20 Vextors 64:87
ACPI: System State [SO S3 S4 S5] (S3)
PFM64 (36cpu) 0xf10000000, 0xf0000000
Aplconsole relocated to 0xf1000000
PCI configuration changed (bridge=16 device=4 cardbus=0)
[ PCI configuration end, bridges 12 devices 16 ]
Firewire (OHCI) Lucent ID 5901 built-in now active, GUID 3c0754fffe9b2aa2; max speed s800.
Pthread support ABORTS when sync kernel primitives misused
com.apple.AppleFSCompressionTypeZlib kmod start
com.apple.AppleFSCompressionTypeDataless kmod start
com.apple.AppleFSCompressionTypeZlib load succeeded
com.apple.AppleFSCompressionTypeDateless load succeeded
AppleIntelCPUPowerManagementClient: ready
BTCOEXIST off
wl0: Broadcom BCM4331 802.11 Wireless controller
5.100.98.75
AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitializad
rooting via boot-uuid from /chosen: 6E918706-FC0D-37460-A3A0-6268A51DF93B
Waiting on <dict ID="0"><key><string ID="1">IOResources</string><key>IOResourceMatch</key><string ID="2">boot-uuid-media</string></dict>
Got boot device = IOService:/AppleACPIPlatformExpert/PCI0@0/AppleAPIPCI/SATA@1F,2/AppleIntelPchSe riesAHCI/PRT0@0/AOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlock
storageevice /IoBlockStorageDriver/TOSHIBA MK7559GSXF Media/IOGUIDPartit
BSD root: disk0s2, major 14, minor 2
Kernel is LP64
com.apple.launchd 1 com.apple.launchd 1 *** launchd[1] has started up. ***
com.apple.launchd 1 com.apple.launchd 1 *** Verbose boot, will log to /dev/console. ***
Running fsck on the boot volume...
** /dev/rdisk0s2 (NO WRITE)
** Root file system
Executing FSCK_HFS (version diskdev_cmds-540.1~25).
BootCacheControl: UNable to open /Var/db/BootCache.playlist:2 No such file or directory
launchctl:Dubious permissions on file (skipping): /Library/LaunchDaemons
launchctl:Dubious permissions on file (skipping): /System/Library/LaunchDaemons
Any help or suggestions on what to do next would be welcomed.
I am in the middle of the Atlantick, stuck with a brand new, non working Apple MacBook Pro.
Best regards
Sergio RamosReinstalling MacOS does NOT fix the problem for me. I'm still searching a solution !
Bernard -
Hi,
I fixed error in last post and rewrote the code using ProcessBuilder instead.
Output from my unix tool is:
Command is a shell application' /home/myid/test/myshell/bin/run' that starts a ascii gui that looks like ( see below). It waits for input from user.
* My shell Application *
HELP: h
COMMAND: c
QUIT:q
135.19.45.18>
And still the last line is not showing when I read the text.
I have tried with readLine() and I get the same error.
Note: When I debug, after characters in line:
OUIT:q
have been read I can see that debugger hangs on
br.read()
And now the code looks like:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
public class RunShellCmd {
private BufferedReader processInputStream;
private BufferedWriter processWriter;
public static void main(String args[]) throws Exception {
RunShellCmd cmd = new RunShellCmd();
cmd.runCmd();
public void runCmd() throws Exception {
Process process = null;
List<String> cmd = new ArrayList<String>();
cmd.add("/bin/bash");
cmd.add("/home/myid/test/myshell/bin/run");
ProcessBuilder processBuilder = new ProcessBuilder(cmd);
processBuilder.redirectErrorStream(true);
try {
System.out.println("start process ....");
process = processBuilder.start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
StringBuilder sb = new StringBuilder();
int intch;
while ((intch = br.read()) != -1) {
char ch = (char) intch;
sb.append(ch);
System.out.println(sb.toString());
} catch (IOException e) {
System.out
.println("An error occourd: "
+ e.toString());
} finally {
processInputStream.close();
process.destroy();
System.out.println("exit value: " + process.exitValue());
processWriter.close();DUPLICATE THREAD!
Please don't create duplicate threads. You already have a thread for this same issue.
I fixed error in last post and rewrote the code using ProcessBuilder instead.
Good - then post your progress in the original thread and keep using it until the problem is resolved. That way the people that tried to help you before can see the entire context of what you are trying.
https://forums.oracle.com/thread/2611844 -
How we can Print a field Value in last line of the layout
Hello:
I am doing Check printing report ... Accroding to that I am facing a problem to print a Field value in last line of the layout....Anyone Can help to this please.....Hello,
Take a look to the example provided in the note :
Note.253881.1 How to Create a Report With a Frame Only on the Last Page at a Fixed Position
Regards -
I am writing papers for school which have strict page limits so I can't afford to be losing lines at the bottom of a page because Pages thinks it looks better to have a new paragraph start on the next page. It does this automatically and I have to go back and manually format to get the first line of the paragraph to start on the last line of the previous page. This then creates problems down the line when I am editing so I would really like to be able to turn the feature off.
e.g. with Pages auto-formatting
-----page 1-----
Paragraph #1 blah blah
blah blah blah
Paragraph #2 blah blah
blah blah blah
-----page 2-----
Paragraph #3 blah blah
blah blah
e.g. after manual formatting
-----page 1-----
Paragraph #1 blah blah
blah blah blah
Paragraph #2 blah blah
blah blah blah
Paragraph #3 blah blah
-----page 2-----
blah blahChange the keep with next rules in:
Inspector > Text > More > Pagination & Break
Peter -
Best way to remove last line-feed in text file
What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
(as echo -n will remove all trailing newline characters)What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
(as echo -n will remove all trailing newline characters)
According to my experiments, you have removed all line terminators from the file, and replaced those between lines with a space.
That is to say, you have turned a multi-line file into one long line with no line terminator.
If that is what you want, and your files are not very big, then your echo statement might be all you need.
If you need to deal with larger files, you could try using the 'tr' command, and something like
tr '
' ' ' <file.txt >newfile.txt
The only problem with this is, it will most likely give you a trailing space, as the last newline is going to be converted to a space. If that is not acceptable, then something else will have to be arranged.
However, if you really want to maintain a multi-line file, but remove just the very last line terminator, that gets a bit more complicated. This might work for you:
perl -ne '
chomp;
print "
" if $n++ != 0;
print;
' file.txt >newfile.txt
You can use cat -e to see which lines have newlines, and you should see that the last line does not have a newline, but all the others still do.
I guess if you really did mean to remove all newline characters and replace them with a space, except for the last line, then a modification of the above perl script would do that:
perl -ne '
chomp;
print " " if $n++ != 0;
print;
' file.txt >newfile.txt
Am I even close to understanding what you are asking for? -
How to select LAST line from a SAP table?
Hi developers,
I need to select the last line from a SAP table, NOT from an internal table.
Something like
SELECT SINGLE LAST FROM pa00169..
any help is more than welcome.Javier,
Based on this statement from you:
"i created a Z table, its a config table that stores some bussines rules, and an id counter, so in order to update that counter i need the last line of the ztable."
I have one additional solution which is the "text box" approach IF the 'id counter' mentioned above is a numeric data type.
If so, use an SQL function to get the highest value of ID_COUNTER.
Then simply add one to it to produce a new, unique, higher-order primary key.
See below:
data: l_id_counter like ztable-id_counter.
data: new_id_counter like ztable-id_counter.
select max( ID_COUNTER ) from ztable into l_id_counter.
new_id_counter = l_i_counter + 1.
Now new_id_counter will be the unique, primary key IF this is the only field in ZTABLE's primary key.
This will also GUARANTEE that your new record is built correctly. -
How to find out the Last line of a page in Smart forms
Hi Experts,
I need to find out the <b>last line of a page in smartforms</b>.
I have <b>Heading in a text element</b> and its <b>text in another text element</b>.
If the heading falls in the last line, its contents will be displayed in the next page. I want to print the heading in the next page.
Please advise on this issue.
Thanks in advance,
VivenYou can put both the heading and contents in a Folder node and check the page protection checkbox of the Folder node. This way both will be displayed on the same page always.
-
How to upload CSV file w/o ,, for the last line
Hi Experts,
As part of one interface uploading the csv file (4coulmns) manually using the TCODE: CSCA_FILE_COPY.
After uploading when i see in the AL11 as it is csv file it is filling the , in each space.
But my issue while running the interface (because of logic in it) checking for the hash total in the last line where (record count, hash total) only 2 items should come but because of manual upload adding the (record count, hash total, , ,) another two spaces.
Where program not moving further becasue the it is alway comparing the amounts (1000.00 not matching with 1000.00, , ) it is not processing. In production files directly load in to unix server so no issues and i can't ask to change the program code...because iam not following the process. As part of testing i've to do manually only.
Please suggest the workaround for this.
Is it possible to change the contents directly in AL11 directly....then HOW ?
or
How to create a csv file w/o , , in the last line (may be it is not possible) ?
Thanks for your replies in advance.
Regards
VVRI don't think you can edit from AL11, nor creating a CSV without those commas at the end because are created to state fields with empty value.
You have 6 columns filled with values but for the last line you only fill the first four. It is expected to appear , , for the last 2 columns on the last line.
I can only suggest keep doing it manually before uploading the CSV file... or... you are saying you can't change the program.
How about upload all CSV files... then writing another program to get those files from AL11 and delete the spare commas at the end line?
Cheers,
Andres. -
GUI_DOWNLOAD blank lines in the middle
Hi All,
I am using 'GUI_DOWNLOAD' FM to create excel file of my internal table data; Internal table is having 220 fields and expects to create 220 columns in excel file;
In the middle of the excel file I get several blank lines on and off with only very few column values are filled;
I checked the ITAB in debug before calling the FM it has no issues and has the correct data;
My code is as below;
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_filename
filetype = 'ASC'
write_field_separator = 'X'
TABLES
data_tab = i_compare
fieldnames = i_excel_head
EXCEPTIONS
file_write_error = 1
Appreciate your expert ideas please;
Thank you
IverHi,
GUI_DOWNLOAD blank lines in the middle
In your GUI_DOWNLOAD code, There is no mistake.
I think, In your program, have you written any SET BLANK LINES ON.
It is one case.
Follow this link,
http://wiki.sdn.sap.com/wiki/display/ABAP/DownloadinginternaltablestoExcel
It may helps to you.
Regards,
Sekhar -
Why first & last lines in each page in pdf is exported to WORD as a Header/footer?
Similarly, when exporting a pdf file to Excel, the first and last lines in each page of the PDF do not get exported to EXCEL?
Hi Michael,
Installation of PDF Action is done based on this link-
https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1109054
MII Version - 12.0.7 Build(20)
version 1.4.5. of
the third-party iText.jar and iTextAsian.jar, from
http://www.lowagie.com/iText/download.html
Thanks,
Soumen -
Sender File Adapter Ignore Last Line
Hi All,
Like in Sender File Adapter configuration like we have Document Offset to specify the number of starting lines to be ignored,
Like the same way can we ignore the last line of a text file .
Regards,
RahulRahul,
><i>I somehow wait for your answer,</i>
Is that a compliment
I guess there is no standard way to ignore the last line . Like you pointed out, read the line and ignore it in the mapping!
><i>btw ..
suppose in a flat file..
i just want to read the 4th line??
is there any way i can do this?</i>
Again no straight forward way to do this. You can use KeyFields etc , but there is no direct way to do this and every solution would depend on the exact requirements!
Regards
Bhavesh
PS Are the alerts issues resolved? -
Final total cannot appear when the last line item reached the page end
Hi All,
My report included 2 pages. Problem is the final total cannot appear when the last line item reached the page end. (page 2)
final total will appear on the middle of last page (page 3) when i comment (type = 'BOTTOM').
Below is the program.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
device = 'PRINTER'
dialog = 'X'
form = 'ZBOTM_VOUCHER'
language = sy-langu.
sort itab by vblnr.
LOOP AT itab INTO wa_itab.
move wa_itab-vblnr to reguh-vblnr.
move wa_itab-lifnr to reguh-lifnr.
move wa_itab-rbetr to reguh-rbetr.
reguh-rbetr = reguh-rbetr * -1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'MAIN'
element = 'DETAIL'.
t_rbetr = reguh-rbetr + t_rbetr.
AT LAST.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
window = 'LINE'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TOTAL'.
type = 'BOTTOM'
WINDOW = 'MAIN'.
ENDAT.
Thanks.Hi,
Where should I include the code for bottom?
How to open text editor?
Thanks.
Edited by: Alice8 on Feb 7, 2011 9:09 AM -
Last Line Item in Report Repeating on Next Page
The last line of data of every page is also the first line on the next page. I have not encountered this before and I cannot see how it is happening or how to correct it.
The report has three groups and the 3rd group has 3 details lines. It is the 2nd detail line that repeats. The repeating line has not encountered a group change, nor has the 3rd detail line been triggered. It is a simple report that lists a line of data and prints it onto the report.
The SQL is grouped by the same grouping of the report. Yes, data does repeat in the SQL, which would be expected for the grouping. However, the data does not repeat in a group of the data returned by the SQL statement, so there is no reason for this data repetition.
It is not restricted to any one piece of data in the report. The line that repeats is the last line on a page. Clicking on the next page of the report shows the last line of the previous page is the first line of the new page. This is true whether the report is viewed or printed.
Does anybody have any suggestions?
Thank you.I was able to resolve this. The detail section did not have the Keep Together checked. Once this was checked, the repeating line issue was resolved.
-
Only the last line item is shown in main window...
Hello Experts,
I created a custom form for the standard checque program RFFOUS_C. Now, in my MAIN window, I
called a subroutine in a custom program which loops through the line items but the problem is
only the last line item is being shown. I tried using CONTROL_FORM to create a new line
but it does not work. Note that I did not customize RFFOUS_C since it is being used by
multiple companies. Below is my code:
SAPSCRIPT:
510-C
Begin of insertion DEVK940799 11/10/2008 DEL_HIDALGO
DEFINE <YC_XBLNR& = ''
DEFINE <YC_BLDAT& = ''
DEFINE <YC_SGTXT& = ''
DEFINE <YC_DMBTR& = ''
PERFORM WRITE_LINE_ITEMS IN PROGRAM Z9999RFI_Z2574FFI_RA
USING ®UH-LAUFD&
USING ®UH-LAUFI&
USING ®UH-XVORL&
USING ®UH-ZBUKR&
USING ®UH-LIFNR&
USING ®UH-VBLNR&
CHANGING <YC_XBLNR&
CHANGING <YC_BLDAT&
CHANGING <YC_SGTXT&
CHANGING <YC_DMBTR&
ENDPERFORM
PROTECT
<YC_XBLNR& <YC_BLDAT& <YC_SGTXT& <YC_DMBTR&
ENDPROTECT
End of insertion DEVK940799 11/10/2008 DEL_HIDALGO
PROGRAM:
IF gt_regup[] IS NOT INITIAL.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
* DEVICE = 'PRINTER'
* DIALOG = 'X'
form = lcc_z2574ffi_ra
* LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
codepage = 11
OTHERS = 12.
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 gt_regup INTO lw_regup.
m_line_items 'LTYC_XBLNR' lw_regup-xblnr.
m_line_items 'LTYC_BLDAT' lw_regup-bldat.
m_line_items 'LTYC_SGTXT' lw_regup-sgtxt.
m_line_items 'LTYC_DMBTR' lw_regup-dmbtr.
DELETE ex_output WHERE value IS INITIAL.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '510-C'
function = 'APPEND'
* TYPE = 'BODY'
window = 'MAIN'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
codepage = 9
OTHERS = 10.
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 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 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.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.Hi,
Write the at last event in the program and check if it works
At last.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
command = 'NEW-LINE'
EXCEPTIONS
unopened = 1
unstarted = 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.
Regards,
Sravanthi
Maybe you are looking for
-
When I start firefox, it automatically tries to install an update. This fails and it repeats, getting stuck in a loop which I can not get out of. Consequently, I am unable to open firefox and use the internet on this program. I have clicked ok, close
-
My airport extreme is working but will not connect to my mac pro
my airport extreme is working and all other devices connect except my mac pro computer, How do I resolve this problem?
-
How to list Forms (*.fmb) in File -- Open dialog box by default?
I am Using Forms 6i. Whenever in Forms Builder, I click File--> Open, it lists 'All Files (*.*)'. How can I configure form Builder so that it lists 'Forms (*.fmb)' by default whenever I click File--> Open. Pl. guide. M. Tariq
-
Totalizing a flow rate but not calculating if a negative number
I know how to take a flow rate and produce a totalizer using an integration. What I would like to do is not calculate the integration if the incoming rate should be a negative value. Thanks in advance for your help.
-
How to add special characters to field?
As per topic... Virtual Office | Servcorp http://www.servcorp.com.au/ http://www.servcorp.net/