Convert structure into single field in string in unicode system .
Hi all
i need to convert whole structure in single fields which is string format
plese refer this code .....this is structure which i want to use in concatenate statement
statement is
CONCATENATE EXPORTSTRING HFTP_ZSD_RKFR CR_LF INTO EXPORTSTRING.
where data are ...
EXPORTSTRING type xstring
CR_LF type x
structure HFTP_ZSD_RKFR having follwing fields
MANDT MANDT CLNT 3 0
VBELN_VL VBELN_VL CHAR 10 0
LFDNUM LFDNUM NUMC 3 0
VKORG VKORG CHAR 4 0
VSTEL VSTEL CHAR 4 0
VSBED VSBED CHAR 2 0
KUNAG KUNAG CHAR 10 0
KUNWE KUNWE CHAR 10 0
SPDNR SPDNR CHAR 10 0
LFDAT LFDAT DATS 8 0
LFUHR LFUHR TIMS 6 0
WADAT WADAT DATS 8 0
TRAID TRAID CHAR 20 0
ROUTE ROUTE CHAR 6 0
WERKS WERKS_D CHAR 4 0
MATNR MATNR CHAR 18 0
LFIMG LFIMG QUAN 13 3
MEINS MEINS UNIT 3 0
ANZPK ANZPK NUMC 5 0
ANZPK ANZPK NUMC 5
KBETR KBETR CURR 11
KPEIN KPEIN DEC 5
KMEIN KMEIN UNIT 3
KWAER KWAER CUKY 5
KWERT KWERT CURR 13
BELNR BELNR_FI CHAR 10
GJAHR GJAHR NUMC 4
MWSKZ MWSKZ CHAR 2
SAKNR SAKNR CHAR 10
BUKRS BUKRS CHAR 4
BUDAT BUDAT DATS 8
KOSTL KOSTL CHAR 10
AUFNR AUFNR CHAR 12
PRCTR PRCTR CHAR 10
BRGEW BRGEW QUAN 13
GEWEI GEWEI UNIT 3
XBILL ZSD_XBILL CHAR 1
XPARK ZSD_XPARK CHAR 1
XPARK ZSD_XPARK CHAR 1
XBLNR XBLNR CHAR 16
KHERK ZSD_KHERK CHAR 1
LIFEX LIFEX CHAR 35
SDABW SDABW CHAR 4
KBETR_MAUT KBETR CURR 11
KPEIN_MAUT KPEIN DEC 5
KMEIN_MAUT KMEIN UNIT 3
KWERT_MAUT KWERT CURR 13
KBETR_OEL KBETR CURR 11
KPEIN_OEL KPEIN DEC 5
KMEIN_OEL KMEIN UNIT 3
KWERT_OEL KWERT CURR 13
KBETR_PAL KBETR CURR 11
KPEIN_PAL KPEIN DEC 5
KMEIN_PAL KMEIN UNIT 3
KWERT_PAL KWERT CURR 13
KBETR_VAT KBETR CURR 11
KPEIN_VAT KPEIN DEC 5
KPEIN_VAT KPEIN DEC 5
KMEIN_VAT KMEIN UNIT 3
KWERT_VAT KWERT CURR 13
BLDAT BLDAT DATS 8
MWS_BETRG WRBTR CURR 13
KURSF KURSF DEC 9
UVK06 CHAR 1
I have used this FM
SAP_CONVERT_TO_TXT_FORMAT
There's also a method in cl_abap_char_utilities to convert a structure to a C container, look for it, I only have 4.6C here and that class is only in ECC
Similar Messages
-
Total XML structure into single table field
Hello All,
I want to send total XML structure(including Tags and Data) into single field in a Table.
Ex: <MaterialDetails>
<MaterialNumber>00111</MaterialNumber>
<MaterialQuantity>200</MaterialQuantity>
</MaterialDetails>
Plz Can anyone tell me How to do this indetail?
Thanks
SanGenerate this entire string in a UDF and assign it to the respective element.
VJ -
Assignment Between Structure and Single Field - CL_ABAP_CONTAINER_UTILITIES
Hi, Need some help on this as I'm not familiar with Java programming.
Basically in ABAP, we can assign a structure (with complex data type) into a field (please refer to link below).
Now we need to do similar thing in PI, since PI only support Java then we need to perform similar logic as in CL_ABAP_CONTAINER_UTILITIES =>FILL_CONTAINER_C, but in Java. Understand that there's no concept of structure in Java, in this case PI will receive multiple fields (with different data type) and need to combine them into one field.
I tried few Java command/method but it doesnt give me the same result as in the ABAP class. Appreciate your help if you know anything about this or some sample program that i can test. thanks!
SAP Help Reference for ABAP
[ABAP - Assignment Between Structure and Single Field|http://help.sap.com/saphelp_nw04/helpdata/en/79/c554d3b3dc11d5993800508b6b8b11/frameset.htm]Hello Rika,
In java we have collection framework instead...
As per your requirement I understood :
1. You will get a list of different type of objects as input.
2. You want to club it in one unit....right...
3. Once done.....I dont know what you will do with that.....I guess pass it somewhere.....
Now, You can use ArrayList in java to club all your objects in one unit....and send it to any function you want....
Arraylist list= new ArrayList();
list.add(new MachineGun());
list.add(new Gun());
But there be carefull when you extract data from List....as you need to type cast them accordingly....
Start trying it...and revert back if you face any problems.....
While extracting you will have to use something like :
if(list.get(0).getClass().getSimpleName().equals("MachineGun")){
//here you can safely cast in the right class
MachineGun mgun= (MachineGun )list.get(0); -
To populate values into single field in an internal table
Hi Friends,
How we need to populate values into single field in an internal table.
E.g itab consits of single field ( name)
i need to assign values to this field name .like
peter,
john,
abrahm,
daneyal
Pls tell me i how i need to code for this
Thanks ,
ParnithHi,
Please look at the below code :
DATA : BEGIN OF itab OCCURS 0 ,
name(20) TYPE c,
END OF itab.
START-OF-SELECTION.
itab-name = 'Peter'.
APPEND itab.
CLEAR itab.
itab-name = 'John'.
APPEND itab.
CLEAR itab.
itab-name = 'Abrahm'.
APPEND itab.
CLEAR itab.
itab-name = 'Daneyal'.
APPEND itab.
CLEAR itab.
LOOP AT itab.
WRITE : / itab.
ENDLOOP.
Thanks,
Sriram Ponna. -
HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE
HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE
lets declare a structure --
data: begin of str,
name(10),
age(3),
city(10),
end of str.
lets now convert this to an internal table itab --
data itab like table of str.
I hope this helps
regards,
-pankaj singh -
How to convert select-options table into single field internal table
Hi,
My requirement is to convert select-options table into single internal table which has one field.
e.g. select-options: s_matnr for mara-matnr.
select-options table can have options 'BT',"EQ", "NE", "GE", "GT", "LE", "LT", "CP" etc. select-options table
have Sign:I ,Option:BT, Low: 1, High.10.The new internal table records should be 1,2,3,4,5,6,7,8,9,10.
Please suggest any function module available for this scenario in SAP.
Thanks,
Somi.
Edited by: somi reddy satti on Sep 15, 2009 3:18 PMHi Sowmya,
Here is the answer if I understand well of your question.
Data: begin of gt_mon OCCURS 0,
mon(2) TYPE n,
end of gt_mon.
Data: begin of gt_year OCCURS 0,
year(4) TYPE n,
end of gt_year.
Select-options: s_period FOR ptdw_pws_db-kmonth NO-EXTENSION
DEFAULT sy-datum(6)
TO sy-datum(6).
For example according to above statement period is 201110 is 201201.
Period field does n't exists in SAP for selection. If your selection is on date based on period which is given on the selection-screen then you need to convert the period to date by concatenating ( or using FM to convert )01 at the end of each period . You need to declare one range table for date to select the data from table.
loop at s_period.
gr_date-sign = s_period-sign.
gr_date-option = s_period-option.
COncatenate s_period-low
'01'
into gr_date-high.
COncatenate s_period-high
'01'
into gr_date-low
append gr_date.
ENDloop.
Thanks,
Satheesh -
Mapping an XML structure into one field
Make use of XSLT mapping (available on SDN...just search with CDATA...i think there is a new feature in PI7.1 (Copy XMl to subtree....something like that).
Regards,
Abhishek.Hi,
Chk this:
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
Re: Conversion of source XML structure to single string using PI 7.1
Thanks
Amit -
Mapping complete input XML structure into one field on target
Hi,
I have a scenario where I need to map the complete input XML structure as it is, into one field on target side. so can we achieve this in Graphical Mapping? If yes, please share your valuable info.
Regards,
Shiva.Hello,
this is the java map code.just compile it and made a .zip file import it and use it Interface Mapping.
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.AbstractTrace;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import java.util.Map;
import java.io.*;
public class PayloadToXMLField1 implements StreamTransformation {
String strXML = new String();
//Declare the XML tag for your XML message
String StartXMLTag = "<DocumentBody>";
String EndXMLTag = "</DocumentBody>";
//String StartXMLTag1 = "<Code>";
//String EndXMLTag1 = "</Code>";
AbstractTrace trace;
private Map param = null;
public void setParameter(Map param) {
this.param = param;
public void execute(InputStream in, OutputStream out) {
trace =
(AbstractTrace) param.get(
StreamTransformationConstants.MAPPING_TRACE);
trace.addInfo("Process Started");
try {
StringBuffer strbuffer = new StringBuffer();
byte[] b = new byte[4096];
for (int n;(n = in.read(b)) != -1;) {
strbuffer.append(new String(b, 0, n));
strXML = strbuffer.toString();
} catch (Exception e) {
System.out.println("Exception Occurred");
String outputPayload =
StartXMLTag
+ "<![CDATA["
+ strXML
+ "]]>"
+ EndXMLTag;
try {
out.write(outputPayload.getBytes());
trace.addInfo("Process Completed");;
} catch (Exception e) {
trace.addInfo("Process Terminated: Error in writing out payload");; -
How to save contents of a structure into a field (of type LRAW) of a table?
Hi,
I've got a structure, with a few fields, some being char fields and some of type decimals and would like to save the contents into a field of a table, which is of type LRAW.
I know that I've got to also update the table with the correct length of the value stored in LRAW, and have done that, but it seems to have lost the end bits of the LRAW field.
Also, can I also find out how I can then retrieve the LRAW value after it's being saved? This needs to be done as later on, we would have to move the values from LRAW into the initial structure it came from.
Thanks for your help!
Regards,
Adeline.Use MOVE command to move the contents of the stucture fields to the Wok area of the Internal table and then APPEND it to the Internal table
-
How do you batch convert pdfs into single page tiffs?
How to you batch convert pdfs to single page tiffs?
If you mean that you want a separate TIFF file for each page in the PDF, try using the saveAs JavaScript method in a batch process (Action): http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.524.html
-
How to convert rows into single columns in Oracle?
I have table with data like shown below in Oracle database.
P_COLUMN
COLUMN_1
COLUMN_2
COLUMN_3
COLUMN_ 4
COLUMN_5
COLUMN_6
COLUMN_7
COLUMN_8
COLUMN_9
COLUMN_10
1
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
1
B1
B2
B3
B4
B5
B6
B7
B8
B9
B10
1
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
2
AA1
AA2
AA3
AA4
AA5
AA6
AA7
AA8
AA9
AA10
2
BB1
BB2
BB3
BB4
BB5
BB6
BB7
BB8
BB9
BB10
I need a query to get one row based on P_COLUMN's value i.e. for P_COLUMN =1, below should be output :-
C_1
C_2
C_3
C_4
C_5
C_6
C_7
C_8
C_9
C_10
C_11
C_12
C_13
C_14
C_15
C_16
C_17
C_18
C_19
C_20
C_21
C_22
C_23
C_24
C_25
C_26
C_27
C_ 28
C_29
C_30
C_31
1
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
B1
B2
B3
B4
B5
B6
B7
B8
B9
B10
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
2
AA1
AA2
AA3
AA4
AA5
AA6
AA7
AA8
AA9
AA10
BB1
BB2
BB3
BB4
BB5
BB6
BB7
BB8
BB9
BB10
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
i searched google and found PIVOT, CROSS JOIN etc but could not use those keyword properly.
Thanks in advance.
Note - My DB client version is 11g.Since you have 11G, here's an alternative with the PIVOT clause.
First, set up test data with up to 10 rows:
CREATE TABLE T(P1,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10) AS SELECT
1,1,2,3,4,5,6,7,8,9,10 FROM DUAL;
INSERT INTO T
WITH DATA AS (SELECT LEVEL*10 N FROM DUAL CONNECT BY LEVEL <= 9)
SELECT P1, C1+N, C2+N, C3+N, C4+N, C5+N, C6+N, C7+N, C8+N, C9+N, C10+N
FROM T, DATA;
INSERT INTO T
SELECT P1+1,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10
FROM T
WHERE C1 <= 11;
select * from t order by p1,c1;
P1
C1
C2
C3
C4
C5
C6
C7
C8
C9
C10
1
1
2
3
4
5
6
7
8
9
10
1
11
12
13
14
15
16
17
18
19
20
1
21
22
23
24
25
26
27
28
29
30
1
31
32
33
34
35
36
37
38
39
40
1
41
42
43
44
45
46
47
48
49
50
1
51
52
53
54
55
56
57
58
59
60
1
61
62
63
64
65
66
67
68
69
70
1
71
72
73
74
75
76
77
78
79
80
1
81
82
83
84
85
86
87
88
89
90
1
91
92
93
94
95
96
97
98
99
100
2
1
2
3
4
5
6
7
8
9
10
2
11
12
13
14
15
16
17
18
19
20
Now the SELECT statement using PIVOT:
SELECT * FROM (
SELECT T.*,
ROW_NUMBER() OVER (
PARTITION BY P1
ORDER BY C1,C2,C3,C4,C5,C6,C7,C8,C9,C10
) RN
FROM T
PIVOT(
MAX(C1) C1, MAX(C2) C2, MAX(C3) C3, MAX(C4) C4, MAX(C5) C5,
MAX(C6) C6, MAX(C7) C7, MAX(C8) C8, MAX(C9) C9, MAX(C10) C10
FOR RN IN (1 R1,2 R2,3 R3,4 R4,5 R5,6 R6,7 R7,8 R8,9 R9,10 R10)
P1
R1_C1
R1_C2
R1_C3
R1_C4
R1_C5
R1_C6
R1_C7
R1_C8
R1_C9
R1_C10
R2_C1
R2_C2
R2_C3
R2_C4
R2_C5
R2_C6
R2_C7
R2_C8
R2_C9
R2_C10
R3_C1
R3_C2
R3_C3
R3_C4
R3_C5
R3_C6
R3_C7
R3_C8
R3_C9
R3_C10
R4_C1
R4_C2
R4_C3
R4_C4
R4_C5
R4_C6
R4_C7
R4_C8
R4_C9
R4_C10
R5_C1
R5_C2
R5_C3
R5_C4
R5_C5
R5_C6
R5_C7
R5_C8
R5_C9
R5_C10
R6_C1
R6_C2
R6_C3
R6_C4
R6_C5
R6_C6
R6_C7
R6_C8
R6_C9
R6_C10
R7_C1
R7_C2
R7_C3
R7_C4
R7_C5
R7_C6
R7_C7
R7_C8
R7_C9
R7_C10
R8_C1
R8_C2
R8_C3
R8_C4
R8_C5
R8_C6
R8_C7
R8_C8
R8_C9
R8_C10
R9_C1
R9_C2
R9_C3
R9_C4
R9_C5
R9_C6
R9_C7
R9_C8
R9_C9
R9_C10
R10_C1
R10_C2
R10_C3
R10_C4
R10_C5
R10_C6
R10_C7
R10_C8
R10_C9
R10_C10
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 -
Convert Rows into single column
Hi,
My employee details table has data like below,
employee_id position department
100 technician 50
100 IT 80
101 Accountant 60
101 Accounting Manager 70
Now i want to covert the rows into column. So my output should be like this.
output:
employee_id position department position1 department1
100 technician 50 IT 80
101 Accountant 60 Accounting Manager 70
Help me on this
Edited by: Vi on Mar 22, 2012 5:36 AM
Edited by: Vi on Mar 22, 2012 5:36 AMIgor.M wrote:
http:// website link removed /t_converting_rows_columns.htm
Please don't post links to commercial websites that are only trying to sell their products and services. It breaches the terms of use of the forums.
There are usually more suitable websites giving much more valuable information without all the self promotion (google adwords etc. are acceptable), or in the case of this particular question there is a FAQ post that relates to it...
{message:id=9360005} -
Convert different rows into single column
DB : 11.1.0.7
OS : Solaris Sparc 5.10
I have one query which is joining few tables and giving me output like below.
personnum orgnm
======= =======
6 Keyholder
9 Sales
3 Mgmt
I would like to convert that into single column like below.
col1
========
6,Keyholder,9,Sales,3,Mgmt
I have tried with pivot and decode, but not getting resule which I am exepcting. Any suggesstions ?yashwanth437 wrote:
listagg() function could work.LISTAGG is not available in 11.1. It was introduced in 11.2.
Anyway, XML solution:
with sample_table as (
select 6 personnum,'Keyholder' orgnm from dual union all
select 9,'Sales' from dual union all
select 3,'Mgmt' from dual
select rtrim(xmlagg(xmlelement(e,personnum || ',' || orgnm,',').extract('//text()')),',') col1
from sample_table
COL1
6,Keyholder,9,Sales,3,Mgmt
SQL> SY. -
Need to assign a multi datatype struct to a single field in Unicode system
Hi all,
I had posted an earlier question related to this to understand what the issue is. Few responses helped. Then now I have gone thru the conversion rules in Unicode systems related to assigning a structure (with different data types) to a single field and looking for a solution for my case. The current code written in 4.6 says
l_bapiparex-valuepart1 = l_bape_vbap
where
l_bape_vbap is a structure of type bape_vbap and
l_bapiparex of type bapiparex.
So according to the rules, when I do this kind of an assignment in ECC , the first field's length (i.e. VBELN) must be min 240 characters long. Only then this assignment will be error free, am I right ?
Or Is this an inadmissable assignment situation ?
If not then is there any other way how I can achieve the same result by fixing this issue ? I am not able to think of any !! Has any one come across this kind of an issue during upgrade? Please do suggest.
Just for your reference I have pasted the rule details from SAP help..
Conversion in Unicode Programs
The following rules apply in Unicode programs when converting a flat structure to a single field and vice versa:
If a structure is purely character-like, it is processed during conversion like a data object of the type c (Casting). The single field can have any elementary data type.
If the structure is not purely character-like, the single field must have the type c and the structure must begin with a character-like fragment that is at least as long as the single field. The assignment takes place only between this fragment and the single field. The character-like fragment of the structure is treated like a data object of the type c (Casting) in the assignment. If the structure is the target field, the remaining character-like fragments are filled with blanks and all other components with the initial value that corresponds to their type.
No conversion rule is defined for any other cases, so that assignment is not possible.
Note
If a syntax error occurs due to an inadmissible assignment between flat structures and single fields, you can display the fragment view of the corresponding structure when displaying the syntax error in the ABAP Editor by choosing the pushbutton with the information icon.
thanksTry this way
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = l_bape_vbap
importing
ex_container = l_bapiparex-valuepart1
exceptions
illegal_parameter_type = 1
others = 2.
a® -
how we can treat full file (Full payload ) as in single field.
While file picking from sender end and keep the full content as a payload in single field at source side?Hi,
A bit confused with your question, but here are the two things which might help
1) sending whole source payload into single field in target structure, you can do this by mapping the headersegment to the target field and select RETURN AS XML on right click. there is one blog on this with screen shots if you want to take a look.
2) Taking whole payload from a single source field, You can do this by writing an UDF to extract the XML payload file and placing it before the MM in OP.
Thanks...
Karna....
Maybe you are looking for
-
How to change screen combo box value from a method?
Hi, I have a screen that has a combo box and an ALV. the combo box has the line numbers of the data in the ALV. you can select the line item and then the ALV changes... I fill the combo with function VRM_SET_VALUE. all is good once the user changes t
-
SODA - Service Oriented Integration of Medical Devices in Hospitals
In this thread I will write about my dissertation project. It addresses the problem of the integration of medical devices with their proprietary interfaces and data models into the existing hospitals´ IT infrastructure. Interoperability is an almost
-
Supported Disc Not Available error
I have anew mac book pro that is about a month old now. I've never used the DVD player until today trying to watch a movie. I got an error message that states after I pop the DVD in : Supported Disc not Available I've tried several DVD's and I have t
-
QTime Player Crashes with Buffer overun or causes poor playback
I'm having quicktime issues, these have been ongoing for a long time. But I just updated to the latest version and I have the most current drivers loaded on my system. I get a microsoft visual C++ error "buffer overflow detected" and the program term
-
RV180W and 802.1x with Windows NPS
I am attempting to configure a Cisco RV180W with 802.1x authentication using peap-mschap-v2 with a server 2008 nps box in a domain environment and I keep getting the following error in the event logs: "The RADIUS request did not match any configured