Concatenate fields
Hi
i have a requirement to upload output to .TXT file for a SAP standard report.
So, for that I have made Zcopy of this program and concatenating all fields wherever Write: statement in the program.
but facing the problem while concatenating for the following statements.
WRITE:/'|'
WRITE: Uline.
and WRITE: for system variables like sy-title, sy-repid, s and output postion specification in write statement ex: WRITE: 'Country code'(315)
how to handle this situation? i want to get exact output in my text file, which is same SAP standard output
please help me .............
Do like this,
when you concatanating the fields must be in character mode.
concatnate '!' '_' text-315 into output.
Copy sy -title and sy-repid's to varibles and concatnate to output.
regards,
Rajasekhar Reddy.
Similar Messages
-
Concatenate fields of record type
Hi
Is there some way to concatenate fields of the record type ?, example
declare
TYPE customer_sales_rectype IS RECORD
(campo1 char(3),
campo2 char(3),
campo3 char(3));
TYPE ZZZ IS RECORD (kkk customer_sales_rectype);
x customer_sales_rectype;
begin
x.campo1:='000';
x.campo2:='aaa';
x.campo3:='BBB';
end;I have a table
ID_REPORT NUMBER
ID_LINE NUMBER
DT_FILE DATE Y
DS_LINE VARCHAR2(2048) Y My quey have more than 50 columns and must to concatenate columns, example:
select column001 ,
';' PV1,
COL2,
COL3
COL4,
';' PV2,....ETC
FROM MY TABLESI think moving result of query into variable of record type I would can insert into table in column DS_LINE doing some transformatcion.
Is there some way without to use COL1||PV1||COL2||COL3||COL4||PV2... etc
thank you in advance
using 9.2.02It's easy enough to write a function to do this. Here is a "coffee time" implementation:
create or replace function multi_concat
(p_args sys.dbms_debug_vc2coll)
return clob
as
rv clob;
begin
dbms_lob.createtemporary(rv, TRUE);
for i in p_args.first .. p_args.last
loop
dbms_lob.writeappend(rv, length(p_args(i)), p_args(i));
end loop;
return rv;
end multi_concat;
/And the proof of the coffee is in the dunking of the doughnut:
SQL> select multi_concat ( sys.dbms_debug_vc2coll ( ('Red Fish', 'Blue Fish', 1, 'Fish',2,'Fish'))
2* from dual
MULTI_CONCAT(SYS.DBMS_DEBUG_VC2COLL('REDFISH','BLUEFISH',1,'FISH',2,'FISH'))
Red FishBlue Fish1Fish2Fish
SQL> I would add a TO_STRING member function to your type and use something like the above to implement it.
Alternatively, use the data dictionary to generate a string which joins all your type's attributes with the concatenation operator.
Cheers, APC -
Concatenate fields using commas
How do I concatenate fields using proper English separators? I'm using Acrobat Pro X.
I have fields named Field1, Field2, Field3, Field4 and Result.
Example 1
In Field1, I enter Apples. In Field2, Oranges. The other two fields are empty (Null).
In the Result field it returns "Apples and Oranges."
Example 2
I add Grapes in Field3.
The Result field returns, "Apples, Oranges, and Grapes."
Example 3
I add Pears to Field4,
The Result should be, "Apples, Oranges, Grapes, and Pears."
Any help is appreciated.The script for this will be scaled up to ten total fields once complete and will only contain consecutively filled fields. This is what I have currently. It uses a separate field for the conjunction and obviously leaves the remaining commas and the end of the returned result.
var a=getField(“Field1”).valueAsString
var b=getField(“Field2”).valueAsString
var c=getField(“Field3”).valueAsString
var d=getField(“Field4”).valueAsString
var e=getField(“Field5”).valueAsString
var f=getField(“Field6”).valueAsString
var g=getField(“Field7”).valueAsString
var h=getField(“Field8”).valueAsString
var i=getField(“Field9”).valueAsString
var j=getField(“Field10”).valueAsString
var sep=getField(“separator”).valueAsString;
if(sep.length>=1)
{event.value=a+sep+ b+sep+ c+sep+ d+sep+ e+sep+ f+sep+ g+sep+ h+sep+ i+sep+ j+sep}
Else event.value +””; -
Concatenate fields in hr payroll attendance report
Hi all,
I need to concatenate three fields PERNR, BEGDA and ATTIND into a string.after concatenating I need to count no. of records present for this combination into internal table and compare this count with other oracle database records count.if both counts are not same then need to display these three fields mismatched records in the output.can anyone provide some help to achieve this.
Thanks in advance,
Regards,
HarshadaHi,
Create an internal table with 2 columns; first being the concatenated string field, the other being an integern (name it COUNT or something meaningful).
Build up your internal table by doing the concatenation - move the concatenated value into the first field. Set the second field to 1 then COLLECT the entries into the internal table. After processing, there will be only one entry for each combination and the COUNT column will indicate the number of times that combination was found.
Regards, Andy -
How to concatenate fields in Search help exit
Hi,
My requirement is i have to create a search help for a field in cj20n transaction.
when i press f4 on that field i should get a popup of 4 fields from custom table,when user selects any 1 row,
first 3 field values should be concatenated and appear in screen field . in search hlp i added 1 more field so that i can concatenate
all 3 field values and place in it.I can use search help exit so i can concatenate but there are steps like selone,presel etc i am not able to understand .
I saw some examples in wiki, but not able to understand what to do for my requirement.
regards.
Edited by: vnamamala on May 27, 2010 12:22 PMYou would use the step 'SELECT' to control the data selection into an internal table. You would use the step 'DISP' to map the records in the internal table to the search help record table. In your case, I would already have a field in the internal table with the values concatenated together prior to the hit list display (do this in SELECT step) which is not displayed in the hit list but is flagged as the EXPORT field in the search help definition; otherwise just put the field at the end of the hit list.
Map your results in DISP as follows:
* Map the internal table to RECORD_TAB
CALL FUNCTION 'F4UT_RESULTS_MAP'
TABLES
SHLP_TAB = SHLP_TAB
RECORD_TAB = RECORD_TAB
SOURCE_TAB = GT_DOCUMENT
CHANGING
SHLP = SHLP
CALLCONTROL = CALLCONTROL
EXCEPTIONS
ILLEGAL_STRUCTURE = 1
OTHERS = 2.
CALL FUNCTION 'F4UT_OPTIMIZE_COLWIDTH'
TABLES
SHLP_TAB = SHLP_TAB
RECORD_TAB = RECORD_TAB
CHANGING
SHLP = SHLP
CALLCONTROL = CALLCONTROL. -
Concatenate fields with doc number
HI
In cv01n tcode in second tab ADDITIONAL data we have 3 inputs -category,sub category and sub type . now i need to concatenate these three when document no is created .
doc number generation i created but how to concatenate these 3 filds and displayed when clicked saved button. Those 3 fields of type char.
please help me out . automatic doc no is generating i wrote tht in stndard program zmcdokznr ..help me in writing the code to concatenate these 3 fields .
THANKS in advanceHi,
DATA:LV_FLD1 TYPE STRING,
LV_FLD2 TYPE STRING,
LV_FLD3 TYPE STRING.
DATA:LV_FINAL TYPE STRING.
LV_FLD1 = category, "CATAGORY INPUT VALUE.
LV_FLD2 = sub category "SUB CATEGORY VALUE.
LV_FLD3 = sub type "SUB TYPE VALUE.
IF DOUCMENT NUMBER IS CREATED.
CONCATENATE LV_FLD1 LV_FLD2 LV_FLD3 INTO LV_FINAL.
ENDIF.
regards,
muralii. -
Concatenate fields when UPDATING mysql with php
I have managed to concatenate 2 form inputs (firstName +
lastName = fullName) when Inserting a record by altering the
Dreamweaver code thus:
$insertSQL = sprintf("INSERT INTO personnel (id, firstName,
lastName, fullName) VALUES (%s, %s, %s, ('$_POST[firstName]
$_POST[lastName]'))".......
Not sure how correct this is but it works.
So I tried doing the same thing with an UPDATE page and it
doesn't work
$updateSQL = sprintf("UPDATE personnel SET firstName=%s,
lastName=%s, fullName=('$_POST[firstName]
$_POST[lastName]'))".......,
Does anyone have a clue why this will not work or a better
way of Concatenating these form fields.
thanks.oO(MickWarnes)
>I have managed to concatenate 2 form inputs (firstName +
lastName = fullName)
>when Inserting a record by altering the Dreamweaver code
thus:
>
> $insertSQL = sprintf("INSERT INTO personnel (id,
firstName, lastName,
>fullName) VALUES (%s, %s, %s, ('$_POST[firstName]
$_POST[lastName]'))".......
Why do you store redundant data? If you already have the
firstName and
lastName, there's no real need to also store the
concatenation of both.
If you need the fullName in your application like I do for
example, then
"create" it on the fly when you query the DB:
SELECT
firstName,
lastName,
CONCAT_WS(' ', firstName, lastName) AS fullName
FROM
With the same method I even include an optional birth name if
available:
SELECT
IF(birthname IS NULL OR birthname = '',
lastname,
CONCAT(lastname, ' (', birthname, ')')
) AS fullLastname,
Another thing: Never(!) use $_GET or $_POST data directly in
a DB query
without validation and escaping. Read about SQL injection and
how to
prevent it, for example with calling
mysql_real_escape_string() before
the data goes into the DB. DW inserts its own function to
solve this,
but your addition in the code above doesn't make use of it,
hence your
code is vulnerable.
Micha -
Concatenate fields in BEx Desginer
Hello Master,
I am struggling on creating a formula to concatenate two fields into one. Like example, USA - New york.
I need to concatenate Infoobject Country and City with dash in between. Anyone can help on this??
Thanks a million!!
Regards,
ONGYou can use the 0Region Infoobject for this purpose. Since it it copounded with 0Country you will get the output as USA/NY
-
Concatenate fields using vb script
Hi,
we have three text fields tex1,text2 and text3. How to concatenate text2 and text3 to text1 using vb script. we have text1,text2 and text3 in workbook.
Any inputs will be appreciated.Hi Prasad,
Below is VBA code. If you really want to do this with VBScript, you will need to use createObject to get a reference to Excel. I think you probably meant VBA. Let me know if I am wrong and I will post the VBScript code instead.
- Pete
Sub mergeText()
Dim rng As Range
Dim col1 As Long, col2 As Long
Set rng = Range("SAPBEXqueries!SAPBEXq0001")
'make sure that the BW query sheet is the active sheet
rng.Parent.Activate
'determine first and last rows and columns
firstRow = rng.Rows(1).Row
lastRow = firstRow + rng.Rows.Count - 1
firstCol = rng.Columns(1).Column
lastCol = firstCol + rng.Columns.Count - 1
'locate the columns we want to concatenate
'are the column headers in the first row???
For j = firstCol To lastCol
If Cells(firstRow, j) Like "Sales Person*" Then col1 = j
If Cells(firstRow, j) Like "Sales Manager*" Then col2 = j
Next j
If col1 = 0 Or col2 = 0 Then
MsgBox "Did not find required columns"
Exit Sub
End If
'if we got here, we found the required columns
'concatenate
Cells(firstRow, lastCol + 1) = "Concatenated text"
For i = firstRow + 1 To lastRow
Cells(i, lastCol + 1) = Cells(i, col1) & "\" & Cells(i, col2)
Next i
'reset result range so that BW will clean up during next query refresh
Set rng = Range(Cells(firstRow, firstCol), Cells(lastRow, lastCol + 1))
rng.Name = "SAPBEXqueries!SAPBEXq0001"
End Sub -
I have a form that contains 4 fields.
FIRSTNAME
LASTNAME
EMAILADDRESS
FULLNAME
I want to use the full name in a LOV so I need to concatenate the FirstName with the Last Name to get FIRSTNAME LASTNAME.
I am pretty sure we could do this with an onChange javascript but perhaps I am looking at this wrong. The FULLNAME only needs to be created in the DB on submit so it could be a page process that does it on submit.
I am not sure which way to go. I realize that my weakness is not being able to write PL/SQL as I am sure that it can do what I want. If you have any suggestions on good books or online tutorials on PL/SQL in this type of application that would also be great.Or you could just concatenate the first and last name when insetring the values:
firstname||' '||lastname
So if I read this correct, if I put the above in the DEFAULT VALUE of my Concatenated Field then the concatenation will be inserted if the field is NULL.
I did get the first suggestion to work and a colleague helped me to to do a join to get firstname and last name together in another report.
As a convert or (conscript) from FileMaker Pro it has taken a while to get the hang of the relational model and normalization in general. There seems to be no good reason to create a concatenated field when you can do the concatenation on the fly in SQL statement. Is there a slow-down on page loads if you do it on the fly rather than creating a new field and concatenating on creation? -
Concatenate fields of field symbols
Dear all,
How to concatenate 2 fields belonging to the same fieldsymbol?
what is the syntax?Hello Rahul
Use an approach similar to the one shown below:
DATA:
ld_string TYPE STRING,
ls_e070 TYPE e070.
FIELD-SYMBOLS:
<ls_struc> TYPE any,
<ld_fld> TYPE any.
SELECT SINGLE * FROM e070 INTO ls_e070
WHERE trkorr = '...'.
ASSIGN <ls_struc> TO ls_e070.
CLEAR: ls_string.
DO.
ASSIGN COMPONENT syst-index OF STRUCTURE <ls_struc> TO <ld_fld>.
IF ( syst-subrc NE 0 ).
EXIT.
ENDIF.
IF ( syst-index = 1 ).
ls_string = <ld_fld>.
ELSE.
CONCATENATE ls_string <ld_fld> INTO ls_string
SEPARATED BY cl_abap_char_utilities=>horizontal_tab. " TAB separator
ENDIF.
ENDDO.
Regards,
Uwe -
Concatenate field and use in smartform
Hello,
I have generated a form .In a program ,i have used a CONCATENATE IT_OUT1-BSCHL UMSKZ INTO temp1.
and IT_OUT1-BSCHL = temp1.
temp1 is a variable type c.when i called it in smartform i.e.WA_IT_OUT-BSCHL.it does not shows both field data in print preview.
Please give me the solution.
Its an urgent.........
Awaitng reply.
Thanks
Suchitahi
in global Definition u can define variable , then in ur driver prg.
add that fields name and assign value to it of that fields of internal table.
like this :
netpr = itab_ekpo-netpr
TOTAL_VALUE = ITAB_TOTAL-TOTAL_VALUE
importing
Note : netpe is variable u define in SF and itab_ekpo-netpe value ur passing to it. add before importing
OR
add a new field in ur intarnal table and assign value to it and call it in SF.
rewaed if helpful. -
Concatenate field values in a result message
Hi All,
I have to insert two fields in a success message as follows:
Note num ( note number from the context node ) created succesfully for euipment (equipment number from the context node ). Please tell me how to do this.
Thanks & Regards,
Srilakshmi BIts done!!
-
Hi Friends
How to write a expression to achieve the following task in SSRS:
Col_1
Col_2
Col_3
Col_4
A B NULL
D
A
B C
NULL
To
A, B, C
A, B, C
I wrote a expression like this: =Fields!Col_1.value & "," & Fields!Col_2.value & "," & Fields!Col_3.value
& "," & Fields!Col_4.value
and I'm getting result like this: A, B, , D (as
Col_3 is NULL)
A, B, C, (getting
comma after C as Col_4 is NULL).
Royal Thomasyou can make expression like this
=Fields!Col_1.value & IIF(Len(Fields!Col_2.value) = 0 ,"","," & Fields!Col_2.value) & IIF(Len(Fields!Col_3.value) = 0 ,"","," & Fields!Col_3.value) & IIF(Len(Fields!Col_4.value) = 0 ,"","," & Fields!Col_4.value)
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Concatenate fields on multiple child rows into one single string
Hi -
I'm pretty much new to BI Publisher, and I looked through the forums for what I was trying to do below, but couldn't find much on this.
Here's my data source:
<BUSINESSES>
<BUSINESS>
<NAME>Microsoft</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Apple</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Google</NAME>
</BUSINESS>
<BUSINESS>
<NAME>Yahoo</NAME>
</BUSINESS>
</BUSINESSES>
What I was trying to do is create a single string from the XML data source in the form
Microsoft,Apple,Google,Yahoo,............
Here was my plan to do this:
1. Create a global variable - <?variable:AllNames;''?>
2. Loop - For each BUSINESS
2a. Capture NAME - <?variable@incontext:BusName;'NAME'?>
2b. Concatenate it to the global variable AllNames - <?variable:AllNames;concat($AllNames,',',$BusName)?>
3. End Loop
4. Display global variable - <?$AllNames?>
I get a blank RTF when I run this.
Can someone please advice me on this? I thought it would be pretty simple to do, but here i am at the end of the day, and ...
Thank you.There are multiple ways to do it..
one option of using variable, which i would not certainly do is this :)
<?xdoxslt:set_variable($_XDOCTX,'TESTTEST’,’’)?>
<?for-each:/BUSINESSES/BUSINESS?>
<?position()?>: <?NAME?> <?xdoxslt:set_variable($_XDOCTX,'TESTTEST’, concat(xdoxslt:get_variable($_XDOCTX,'TESTTEST’),’,’ ,NAME) )?>
<?end for-each?>
<?xdoxslt:get_variable($_XDOCTX,'TESTTEST’)?>
Maybe you are looking for
-
To find total number of pages in XML publisher
1. Is there any method to find the total number of pages in BI or XML publisher. 2. Is there any method to to repeat the column(Not rows) on every page.For eg you have table with two columns say "A" and "B" .I want to repeat this B in every page . An
-
Updated to Itunes 10 and lost all of my playlists
Can someone tell me how to get my playlists back? I updated a few days ago to Itunes 10 and have lost all of my playlists etc. Is it possible to dump my IPOD library into Itunes?
-
What's the Meaning of Dimension in SAP B1?
Sir, What's the Meaning of Dimension in SAP B1? And how it is used in Profit Centre ? plz tell me ......!
-
HFM shared services and workspace configuration
Hello, I am new to Hyperion environment and learning the products. Downloaded the products for 11.11.3, installed and configured them, but having problems. 1. Shared services is up and able tol log in, but not verified anything else there 2. Not able
-
My iPad 2 won't update apps or down load any suggestions
My iPad 2 won't update apps or down load any suggestions