Split Last Word into New Line
Hello,
Any pointers to below :-
When entering data in column of size say 4000 the last word in the line should not be split if it cud not fit,
if the last word does not fit then it should appear in new line and cursor should be placed at last of the word (if its last word of sentence).
Note that multiline is set to yes and item is text item with form layout, although i have one solution but its not the best one.
Thoughts are appreciated if there is any built in property for this or some other way?
Forms version 10g
Database 9i
br
atul
Hello,
This could be the starting point of an algorythme:
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 LC$c VARCHAR2(1000);
3 v VARCHAR2(1000);
4 LN$MAX PLS_INTEGER := 20 ;
5 i PLS_INTEGER;
6 BEGIN
7 LC$c := 'Here is a text to test the split of a large sentence into multiple sub fields';
8 LOOP
9 v := SUBSTR(LC$c, 1, LN$MAX);
10 i := INSTR(v,' ',-1);
11 IF i > 0 AND i < LENGTH(v) THEN
12 v := SUBSTR(v,1,i);
13 LC$c := SUBSTR(LC$C,i+1,1000);
14 ELSE
15 LC$c := SUBSTR(LC$C,LN$MAX+1,1000);
16 END IF ;
17 DBMS_OUTPUT.PUT_LINE('[' || v || ']');
18 EXIT WHEN LENGTH(LC$C) = 0 OR LENGTH(LC$c) <= LN$MAX;
19 END LOOP;
20 IF LENGTH(LC$c) > 0 THEN
21 DBMS_OUTPUT.PUT_LINE('[' || LC$C || ']');
22 END IF ;
23 END;
24
25 /
[Here is a text to ]
[test the split of a ]
[large sentence into ]
[multiple sub fields]
Procédure PL/SQL terminée avec succès.Francois
Similar Messages
-
Ask split long text into two line into same cell for ALV
Dear All,
Is it possible split long text into two line into same cell for ALV display data?
Regards,
Luke
Moderator message: please search for information before asking.
Edited by: Thomas Zloch on Feb 24, 2011 10:12 AMKeep options: Select the paragraph, then CtrlAltK (Mac: CmdOptK, I
think).
If you want the paragraphs in pairs, create two paragraph styles. Style
A has keep options set to start on a new page, and also, its Next Style
is style B.
Style B has no keep options, but it's Next Style is Style A.
Select all the text.
From the flyout menu of the paragraph styles palette, apply Style A
"then next style."
Now all paragraphs will be alternating -- style A, style B, style A, etc.
Now do what I wrote initially, and you'll have pairs of paragraph in
separate text frames. -
Splitting a string on new lines...
If I want to split string on whitespaces, I do:
StringTokenizer st = new StringTokenizer(a, " ");If I want to split a string on new lines, (I think the ascii values are "13", "10") how can I do it?
Thanks a lot!does "\n" represents both chr(13) and chr(10) ?No, it does not.
KajI solved with "\r\n"Did you read the other replies? They are correct when they say that you shouldn't use StringTokenizer.
Kaj -
Splitting a TO into Multiple Line Items
Hi,
I have a requirement like this.
TR-100 pc and TO created automatically for 100 pc. Now I want to break the TO into 3 line items for 40, 30, 30 pc. Is there a way to achieve this?
Thanks
VenkatIf the TR is manual, then maintain the required lines within the TR. Alternatively as Joao has siad, you can look at the TO split functionality however, this will create a new TO for each, rather than adding a new line.
Cheers -
Spiting into new line after Comma(,)
Hi,
I am trying to split line in an IR Report based on ','(Comma)
The scenario is:
I am fetching TEXT from the Column of a table, I want to split it to new line once it encounters ','.
I tried doing this with 'CHR(10)' but unfortunately it not working.
I am using APEX 4.1.
DB Version: 11G.
Regards
Animeshjrimblas wrote:
Sorry to bud in, yes that works, but you also need to change your column Display Type from "Display as Text (escape special characters)" to "Standard Report Column" otherwise the newly added <BR> tag will be stripped.
Be aware that this could be a security problem if the column contains javascript entered by the user. This may or may not be an issue in your application, but be aware of it.
If it is and issue... maybe you can change the comma to CHR(10) and wrap your column in <pre> tags. Use this with the HTML Expression field for the column.
<pre>#COLUMN_NAME#</pre>
HTML Expressions for IRs were introduced in 4.2. In 4.1 you need to do this using a combination of SQL string replacement and CSS. Replace or suffix the commas with chr(10), and add the following style sheet to the page HTML Header:
.apexir_WORKSHEET_DATA td[headers*="COLUMN_ALIAS"] {
white-space: pre-line;
Replacing COLUMN_ALIAS with the alias of the column in the report.
However if the data is actually stored in this column in a comma-separated format (rather than being the result of a aggregation applied across multiple rows) then this indicates a flawed data model that is not properly normalized. If this is the case then reconsider the design of this table. -
Split table record into several lines - pdf forms
hello experts
im trying to split a table record into several lines in order to present the whole table record in the form.
for example:
table T has 4 fields F1 F2 F3 F4
if the tables has 2 records - R1 and R2 (every record contains 4 data fields) then i want to present my table in the following way:
R1-F1 R1-F2
R1-F3 R1-F4
R2-F1 R2-F2
R2-F3 R2-F4
please do not refer me to links - i really need a specific procedure
thanks ahead to all
Eyal
P.S i am using the adobe lifecycle - SFP tran.hey everyone
it has been solved
for the record:
subform table (flowed content) contains 2 positioned subforms
subforn header
subform lines contains 2 flowed subforms 1 for the first two fields and 1 for the ladt two fields
thank anyway
Eyal -
Split the Forum into new and Old
When Captivate 1 became Captivate 2, there was always the
question response from members "What Version are you running?"
This message board needs to be split into Older Posts and
Captivate 3. It would help everyone and the features of Captivate 3
could be dealt with in one place. Most of the web boards that I use
have several products listed and that includes versions that are
split so that users can focus on the version that they have.
There are many good posts and ideas here and we don't want to
lose the archives, but Captivate 3 will not have the same answers
as Captivate 2 and it is time to set this right, before the mess
continues. We've got a new version here and a chance to set this up
for that version.
Webmaster, the ball is in your court.
Joe C.Hi Joe
And now, for alternate viewpoints...
I am severely on the fence with this suggestion. Part of me
agrees that it
could be helpful while the other part(s) scream(s)
{Expletive deleted} #@!! NO! I'll outline the arguments
swimming in my mind for each possibility.
Pros
For new users, it
might be helpful so that they can figure out where to post.
But most folks seem to do a pretty fair job of sorting that on
their own.
For those of us that have been around a while, it
might be helpful to know up front what is being dealt with.
Cons
For new users, it
might
not be helpful, as they will have to decide going in,
which version they are using. As many new users tend to pay little
attention to such things as forum guidelines and just wander into
the first category they find anyway, I doubt this will help at all.
I would guess it would just add another level of complexity that
would be frequently overlooked. Thus defeating the purpose.
For those of us that have been around a while, it will
definitely add yet one more place to monitor.
I think that Adobe is in the process of revamping the forums
anyway. One thing I would see as being a helpful addition would be
something like a FAQ page or category that could be either self
maintaining or maintained by the community experts. If we had this
available, we could frequently steer folks to this page. Hopefully
it would be the first page that would open anyway. Maybe even such
a page could further break issues and solutions into a "by version"
category.
Just a few thoughts... Rick -
Issue with splitting string into multiple lines
Hi Experts,
I have a long string s. I want to split this string into several lines each having 72 characters. For this I have done following programming:
String s = "For the first time it includes a supplementary report attempting to determine if extreme weather
events can be linked to human-induced climate change. The research team, including members
of the UK Met Office, identified recent episodes of extreme weather then used a computer to
estimate the likelihood of the episode happening in a world without increased CO2." ;
s = s.replaceAll("[\r\n]+", " ");
char[] sAr = s.toCharArray();
AbstractList RecepitsList7 = new Bapitrtext.Bapitrtext_List();;
int start = 0; // start with
int i = 72 ;
// for (int i = 71; i < sAr.length; i++) {
while (i < sAr.length) {
// { if (sAr[i] == ' ')
Bapitrtext Recepits7 = new Bapitrtext();
Recepits7.setTextid("TEXT");
Recepits7.setTextline(s.substring(start, i).replaceAll("[\r\n]+", ""));
RecepitsList7.add(Recepits7);
start = i+1;
i += 72;
input.setText(RecepitsList7);
The output of program is as below:
For the first time it includes a supplementary report attempting to dete
mine if extreme weather events can be linked to human-induced climate
hange. The research team, including members of the UK Met Office, iden
ified recent episodes of extreme weather then used a computer to estim
te the likelihood of the episode happening in a world without increased
Here as we can see last characters are getting deleted by program. For example in first line
determine 'r' is missing in extreme right.
In 3rd line c is missing in extreme left (word change is needed. Program
prints hange.
Also in 3rd line extreme right 't' is missing
Also in 4th line extreme right 'a' is missing
Also the last line is not being printed. In last line "CO2." " should appear.
There are two issues:
1. Why last word of each sentence is not being printed?
2. Why last sentence is not being printed?
I am struggling since last 2 days. Please help. I made all changes like replacing 72 by 71 etc.
By making such changes, I am able to print first line correctly. However under all cases
last character of 2nd line onward is not getting displayed.
Also last line is not getting displayed. I did every thing like using while instead of for loop etc.
Kindly help.
Regards,
Gary
Edited by: 945655 on Jul 10, 2012 11:39 PMString s = wdContext.currentContextElement().getExpense_Text();
s = s.replaceAll("[\r\n]+", " ");
char[] sAr = s.toCharArray();
AbstractList RecepitsList7 = new Bapitrtext.Bapitrtext_List();;
int start = 0; // start with
int i = 72;
while (i < sAr.length) {
Bapitrtext Recepits7 = new Bapitrtext();
Recepits7.setTextid("TEXT");
System.out.println(s.substring(start, i));
RecepitsList7.add(Recepits7);
start = i+1;
i += 72;
input.setText(RecepitsList7);
Edited by: 945655 on Jul 11, 2012 2:25 AM -
I am having problems getting my strings into new lines with jlabels. I know i can do it with <html>...<br>...</html> but the string in the label changes. What is the best way of getting the strings on to mulitaple lines without spliting up words.
You can do whatever you want to the text area to make it look like a label:
setBackground(...);
setForeground(...);
setBorder(...);
setEditable(...);
Its all there in the API. -
Start report column on new line
Hey guys,
Is there anyway to split a report into two lines?? Its just i have a large report that goes accross the page im wondering whether it is possible to split this so that it doesnt continue over the page. So start a column of the report on a new line..
T.I.A
Stefando you want to split the rows or the columns?
eg:
A B C A B C
row row
row row
end ...
or
A B
row
row
c
row
row
regards,
jR -
New Line in application server file
Hi
I am facing rather a unique problem. I have a report that generates a file and posts it on the application server. When i open the file at the application server it shows me line split ( I mean a new line is introduced in the middle of a row).
On further investigation I observed that the field after which it split contains a # symbol. Now many files posted on the server contains # but this problem is not observed in any of those files.
I tried replicating this on quality and dev by adding # at run time in debug mode but the file posted is perfectly fine. I figure it must be some other symbol entirely that we can view as #.
Please share your thoughts on this.
Preethi
Edited by: Preethi B on Feb 8, 2010 2:02 PMHi,
Am facing similar issue in production environment.
But in quality am not getting this issue.In debug mode I copied the same line as in the production and its printing as expected (data getting displayed on a single line).
Can anyone please help me with this??
Thanks in advance!
Regards,
Shaheen. -
How to split 'Firstname Lastname' into 2 columns 'First' and 'Last'?
I import a .csv file from PayPal that throws the customer's First name, MI and Last Name all in one column. I have no problem going through and deleting the middle initial to make just two words separated with a space.
How can I split the First and Last names that are separated by a space into two separate columns? It's a piece of cake in Excel, but for some stupid reason, I can't use Excel 08 for Mac to do it. Keeps saying that there is data in column #XX without a heading (there is no data there) when I try to import to PayPal Multi-order shipping.
Please help! I'm desperate. Taking me for ever to cut and past each last name into the new column.
Thanks for any help with this!
MarcusHere is a script which does the trick.
--[SCRIPT splitfirst_lastname]
Enregistrer le script en tant que Script ou Application : splitfirst_lastname.xxx
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Sélectionner la colonne de chaînes à découper (et éventuellement davantage pour définir la colonne recevant les noms propres).
Aller au menu Scripts , choisir Numbers puis choisir splitfirst_lastname
Le script découpe les chaînes sources au premier espace.
Le prénom remplace la chaîne initiale.
Le reste est déposé dans la cellule adjacente à droite ou dans la cellule de la denière colonne sélectionnée.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
Sous 10.6.x,
aller dans le panneau "Général" du dialogue Préférences de l'Éditeur Applescript
puis cocher la case "Afficher le menu des scripts dans la barre des menus".
--=====
Save the script as a Script or an Application : splitfirst_lastname.xxx
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Select a column of strings to split (and maybe more columns to define the column receiving lastNames).
Go to the Scripts Menu, choose Numbers, then choose "splitfirst_lastname"
The script split the source strings on the first embedded space.
The FirstName replace the original string.
The reminder is stored in the cell adjacent on the right (or in the last column of the selected range.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editor’s Preferences dialog box
and check the “Show Script menu in menu bar” option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/02/23
--=====
on run
run script doyourduty
end run
--=====
script doyourduty
set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
if colNum2 = colNum1 then set colNum2 to colNum1 + 1
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
repeat with r from rowNum1 to rowNum2
tell row r
set first_last to value of cell colNum1
if (first_last is not 0.0) and first_last contains space then
set in_pieces to my decoupe(first_last, space)
set value of cell colNum1 to item 1 of in_pieces
set value of cell colNum2 to my recolle(items 2 thru -1 of in_pieces, space)
end if
end tell -- row
end repeat
end tell -- Numbers
end script
--=====
set {rowNum1, colNum1, rowNum2, colNum2} to my getCellsAddresses(dname,s_name,t_name,arange)
on getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
local two_Names, row_Num1, col_Num1, row_Num2, col_Num2
tell application "Numbers"
set d_Name to name of document d_Name (* useful if we passed a number *)
tell document d_Name
set s_Name to name of sheet s_Name (* useful if we passed a number *)
tell sheet s_Name
set t_Name to name of table t_Name (* useful if we passed a number *)
end tell -- sheet
end tell -- document
end tell -- Numbers
if r_Name contains ":" then
set two_Names to my decoupe(r_Name, ":")
set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, item 1 of two_Names)
if item 2 of two_Names = item 1 of two_Names then
set {row_Num2, col_Num2} to {row_Num1, col_Num1}
else
set {row_Num2, col_Num2} to my decipher(d_Name, s_Name, t_Name, item 2 of two_Names)
end if
else
set {row_Num1, col_Num1} to my decipher(d_Name, s_Name, t_Name, r_Name)
set {row_Num2, col_Num2} to {row_Num1, col_Num1}
end if -- r_Name contains…
return {row_Num1, col_Num1, row_Num2, col_Num2}
end getCellsAddresses
--=====
set { dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
on getSelParams()
local r_Name, t_Name, s_Name, d_Name
set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
if r_Name is missing value then
if my parleAnglais() then
error "No selected cells"
else
error "Il n'y a pas de cellule sélectionnée !"
end if
end if
return {d_Name, s_Name, t_Name, r_Name} & my getCellsAddresses(d_Name, s_Name, t_Name, r_Name)
end getSelParams
--=====
set {rowNumber, columnNumber} to my decipher(docName,sheetName,tableName,cellRef)
apply to named row or named column !
on decipher(d, s, t, n)
tell application "Numbers" to tell document d to tell sheet s to tell table t to ¬
return {address of row of cell n, address of column of cell n}
end decipher
--=====
set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
on getSelection()
local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
tell application "Numbers" to tell document 1
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of tables
if x > 0 then
repeat with y from 1 to x
try
(selection range of table y) as text
on error errMsg number errNum
set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
return {theDoc, theSheet, theTable, theRange}
end try
end repeat -- y
end if -- x>0
end tell -- sheet
end repeat -- i
end tell -- document
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
on decoupe(t, d)
local oTIDs, l
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to oTIDs
return l
end decoupe
--=====
on recolle(l, d)
local oTIDs, t
set oTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to d
set t to l as text
set AppleScript's text item delimiters to oTIDs
return t
end recolle
--=====
--[/SCRIPT]
Yvan KOENIG (VALLAURIS, France) mercredi 23 février 2011 10:18:36 -
How to display the data in PDF format : problem is splitting into 2 lines
Hi ,
I developed one report which downloads the data into PDF format and saved in C drive but my problem is
in my program : Line size of the report is 255 in PDF it is splitting into 2 lines. it has to show in a single line. how to do it. how to reduce the width of the output? i am sending my code below. anybody can suggest me how to do it. if possible please send me the code.
my code:
report zmaheedhar.
maheedhar-start
TABLES : vbak.
parameters : p_vbeln type vbak-vbeln.
data : begin of itab occurs 0,
vbeln type vbak-vbeln,
ERDAT type vbak-erdat,
ERZET type vbak-erzet,
ERNAM type vbak-ernam,
ANGDT type vbak-angdt,
BNDDT type vbak-bnddt,
AUDAT type vbak-audat,
VBTYP type vbak-vbtyp,
TRVOG type vbak-trvog,
AUART type vbak-auart,
AUGRU type vbak-augru,
GWLDT type vbak-gwldt,
SUBMI type vbak-submi,
LIFSK type vbak-lifsk,
FAKSK type vbak-faksk,
NETWR type vbak-netwr,
WAERK type vbak-waerk,
VKORG type vbak-vkorg,
end of itab.
maheedhar-end
DATA: pripar TYPE pri_params,
arcpar TYPE arc_params,
lay TYPE pri_params-paart,
lines TYPE pri_params-linct,
rows TYPE pri_params-linsz.
DATA: val(1), val1(1).
*---> Local Printer Name defined in SAP, Change NHREMOTE to your local printer
DATA: dest TYPE pri_params-pdest VALUE 'ZNUL'.
DATA: name TYPE pri_params-plist VALUE 'Testing'.
DATA: i_pdf TYPE STANDARD TABLE OF tline.
DATA: spono TYPE tsp01-rqident.
maheedhar-start
top-of-page.
write: 'Sales Document' , 'C Date', 'Entry time', 'Created By','Quotation date',
'Date','Document Date','SD document category','Transaction group','Sales Document Type',
'Order reason'.
start-OF-SELECTION.
select vbeln ERDAT ERZET ERNAM ANGDT BNDDT AUDAT
VBTYP TRVOG AUART AUGRU GWLDT SUBMI LIFSK
FAKSK NETWR WAERK VKORG from vbak
into table itab
where vbeln = p_vbeln.
maheedhar-end
--- Retreive local printer details
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = dest
no_dialog = 'X'
immediately = ' '
IMPORTING
out_archive_parameters = arcpar
out_parameters = pripar
valid = val
valid_for_spool_creation = val1
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*-- Set Spool printer details w.r.t local printer
pripar-prdsn = 'DSN'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = arcpar
in_parameters = pripar
no_dialog = 'X'
list_name = name
IMPORTING
out_archive_parameters = arcpar
out_parameters = pripar
valid = val
valid_for_spool_creation = val1
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc EQ 0.
---> Triggers the spool creation in the sense all the write statements from hereon will be written to spool instead of screen
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS pripar
ARCHIVE PARAMETERS arcpar
NO DIALOG.
ELSE.
WRITE:/ 'Unable to create spool'.
ENDIF.
*--- Output statements
*WRITE:/ 'First Line', 'mahee','lklk','kikik','lokiuj','fffff','kijuyh','fgfgfgfg','gtgtgtgtgtgtgtgtggggggggggggggggggggggggggggggg'.
*WRITE:/ 'Second Line'.
LOOP at itab.
write: itab-vbeln,
itab-ERDAT,
itab-ERZET,
itab-ERNAM,
itab-ANGDT,
itab-BNDDT,
itab-AUDAT,
itab-VBTYP.
ENDLOOP.
"---> Close spool
NEW-PAGE PRINT OFF.
spono = sy-spono.
Convert ABAP Spool to PDF
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spono
no_dialog = 'X'
TABLES
pdf = i_pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
Download PDF contents to presentation server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'c:\test.pdf'
filetype = 'BIN'
TABLES
data_tab = i_pdf
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.
thanks,
maheedharhi tripat,
actual problem is what u said it is decreased the wiidht of the output.
now the output is:
Sales Document C Date Entry time Created By Quotation date Date Document Date
SD document category Transaction group Sales Document Type Order reason
62741 07/29/1996 11:54:38 DARLENE 00/00/0000 00/00/0000 07/29/1996 C
actual output is:
output should come in a single line. it is splitting into 2 lines.
thanks,
maheedhar -
How to write ABAP code to split a sentence into Word by Word and store them
Hi all,
I have to split a sentence into word by word and store them into separate columns. This sentence is nothing but a text description (TXTMD) from table TXXXX. The description will have 3 or more than 3 words and LAST word will be <b>always with %</b>'. The following is the sample input data:
KEY(ORD43) Description(TXTMD)
'AAAA' '1234 ABCD COMPANY USA 80%'
'BBBB' '4745 XYZ INC CANADA ABCD 70%'
For the first record:
'1234' should stored in to <b>Field 1</b>, 'ABCD COMPANY USA' into <b>Field 2</b> and
'80%' into <b>Filed 3</b>.
For the second record:
'4745' should stored in to <b>Field 1</b>, 'XYZ INC CANADA ABCD' into <b>Field 2</b> and 70%' into <b>Field 3</b>.
The first word into Field 1, the last word with % into Field 3 and all middle words into Field 2. The number of words in the sentence could be 3 or more than 3.
Could you please help in writing the ABAP for this requirement ????
Thanks in advance.
Regards,
Venkat.Easy way if you know the length of the field.
In my example I assumed my field has 12 places.
DATA: obs TYPE string,
bkp TYPE char12.
obs = '12345678901234567890123456789012345678901234567890'.
DO.
MOVE obs TO bkp.
SHIFT obs BY 12 PLACES LEFT.
write: / bkp. "Do what you want with bkp variable
IF obs IS INITIAL.
EXIT.
ENDIF.
ENDDO. -
How to write ABAP code to split a sentence into Word by Word ???
Hi all,
I have to split a sentence into word by word and store them into separate columns. This sentence is nothing but a text description (TXTMD) from table TXXXX. The description will have 3 or more than 3 words and LAST word will be always with %'.
This description is available on R/3 table and in InfoObject on BW side and this split is required in reporting. Should I split it in R/3 itself or BW side, PLEASE ?
The following is the sample input data:
KEY(ORD43) Description(TXTMD)
'AAAA' '1234 ABCD COMPANY USA 80%'
'BBBB' '4745 XYZ INC CANADA ABCD 70%'
For the first record:
'1234' should stored in to Field 1, 'ABCD COMPANY USA' into Field 2 and
'80%' into Filed 3.
For the second record:
'4745' should stored in to Field 1, 'XYZ INC CANADA ABCD' into Field 2 and 70%' into Field 3.
The first word into Field 1, the last word with % into Field 3 and all middle words into Field 2.
Could you please help in writing the ABAP for this requirement ????
Thanks in advance.
Regards,
Venkat.Hi,
in case your text is built in that way for every record you can do the following in routines of the update rules to the 3 fields:
routine for field 1:
result = comm_structure-<name of your textfield>(4).
routine for field 2:
data: l_length type i.
l_length = strlen( comm_structure-<name of your textfield> ).
l_length = l_length - 9. "the 5 characters at the beginning + 4 at the end.
result = comm_structure-<name of your textfield>+4(l_length).
routine for field 3:
data: l_length type i.
l_length = strlen( comm_structure-<name of your textfield> ).
l_length = l_length - 3.
result = comm_structure-<name of your textfield>+l_length(3).
hope this helps!
kind regards
Siggi
Maybe you are looking for
-
I bought an IR receiver and an Apple Remote, and I can't get it to work. What am I doing wrong? The receiver is a Lenovo eHome OVU430006/01 USB IR Receiver.
-
FATAL ERROR occurred during installation
Trying to install a HP Officejet 4500 G510g-m onto a HP Desktop PC with Windows Vista. Error message reads: Fatal error message during installation An error occurred during installation of assembly 'Microsoft.vc90.MFC,version="9.0.21022.8",publickeyt
-
Hi , I need to transport all entries of z table from Dev to Quality. I have tried creating a new transport request in SE10 and assigning the table data.But i dont want this. When i am trying to transport from SM30 , I am getting message as 'Transport
-
IP: How to create new records in an empty (but planable) Cube
Hi specialists, I'm looking for a way to add new records to a (so far) empty but planning-enabled cube. As soon as I inserted some records via the data-loading-process (from a datasource), I can change the planable key-figures and I can add new lines
-
Hello everyone, Anyone knows if it's possible to add/configure new fonts, to be available IC Webclient (HTML e-mail editor)? Thanks and regards