cancel
Showing results for 
Search instead for 
Did you mean: 

How send Sender file to xi Receiver adapter in 1 STRING

brian_briones
Participant
0 Kudos

Hello,

I have a question...

how I can send a archive XML through pi but I need send all xml in a STRING, whitout generate structure on data type, a STRING only.

example:

xml:

<?xml version="1.0" encoding="utf-8"?>

  <nr1:SENDER_MT xmlns:nr1="urn:integra:sap:legacy:comercionet:ZSDIN85">

    <Name>Juan</Name>

      <Last_Name>Perez</Last_Name>

</nr1:SENDER_MT>

RECEIVER PROXY XI:

<String>

     <?xml version="1.0" encoding="utf-8"?>

            <nr1:SENDER_MT xmlns:nr1="urn:integra:sap:legacy:comercionet:ZSDIN85">

                   <Name>Juan</Name>

                   <Last_Name>Perez</Last_Name>

           </nr1:SENDER_MT>

</String>

the XML in a String when get  PROXY.

I dont know how create the DATA TYPE and configure content conversion if is necesary.

help!

Accepted Solutions (1)

Accepted Solutions (1)

brian_briones
Participant
0 Kudos

how use this option? need I know the source structure?

Former Member
0 Kudos

Basically i was assuming since you have no knowledge of your input structure, let Data be your temporary structure with which the message reaches XI. Once it reaches in a mapping, we can handle it how ever we want.

Answers (6)

Answers (6)

manigram
Active Participant
0 Kudos

HI,

You can try this option.

sugata_bagchi2
Active Contributor
0 Kudos

you can use Return as XML feature in PI7.1 onwards.

brian_briones
Participant
0 Kudos

Yes, I understand the Return as XML, but it is used when knows the structure the source.

I dont know the source structure, I know its a XML structure only.

I need configure the FILE ADAPTER for what get all structure in a STRING SENDER, and mapping this FIELD whit other FIELD string.

I hope you understand me and help me!

thank Sugata

Former Member
0 Kudos

hi Brian,

If you donot know what your source structure is, create a <Data> field in your source data type with 0-unb occurence. In the sender channel read the file line by line into the <Data> field. If this works, then your source would have several <data> fields depending on the filesize. You can then write a mapping to map it further.

Regards,

Ninu

brian_briones
Participant
0 Kudos

Hi Ninu, I made this choice, but how you say, then I source would have several <data>...

may leave all the file in a <data>?

ABHISHEK_MISHRA
Explorer
0 Kudos

Its would be File To file Scenario

You can create single field at receiver structure and same at source end  map the source structure to receiver. At source channel With help of  FCC or module you can convert the full source file into single string and with mapping you can pass it to receiver structure and then post at receiver location.

Former Member
0 Kudos

can you also try "returnAsXML" function in SAP PI versions > 7.0?

Regards,

ninu

former_member201264
Active Contributor
0 Kudos

Hi ,

You can concat all fileds in Message Mapping thats it.

Regards,

Sreeni.

brian_briones
Participant
0 Kudos

But the problem is I dont know how is the source STRUCTURE, I know is a XML very big, and i need send how string to PROXY(XI CC). Then, how configure the c. channel FILE and how mapping and create the data types.

I hope you understand me becouse Im from Chile.

Regards

brian_briones
Participant
0 Kudos

Yes, I understand the concatenate, but it is used when knows the structure the source.

I dont know the source structure, I know its a XML structure only.

I need configure the FILE ADAPTER for what get all structure in a STRING SENDER, and mapping this FIELD whit other FIELD string.

I hope you understand me and help me!

rajasekhar_reddy14
Active Contributor
0 Kudos

First you have to know the straucture of  source data,then only you can decide which technique to use.

Shabarish_Nair
Active Contributor
0 Kudos

depending on your version of PI, there are multiple solutions

http://wiki.sdn.sap.com/wiki/display/XI/Whole+Payload+to+a+XML+field

brian_briones
Participant
0 Kudos

hi Shabarish,

if communication channel file, placed in the message protocol "FILE" in the DATA TYPE for only XML tags should I put the same names of the XML tags?

example:

  if the XML is:

<name> brian <\ brian>

in the DATA TYPE should I put:

DT_SENDER

name string 0 ... 1

???

This works if you do not declare the structure with the file content conversion?

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Your question requires some clarity.  Even if you do file content conversion (flat/txt) file on the sender side, you have to construct the data type as xml in the sender.   Using file content configuration you basically tranform the flat file data to the xml structure.  In the mapping step you can use the link specified by Nabendu to map it to your single target field in the proxy data type.  Search scn for the file content conversion for the sender and receiver proxy. This is feasible requirement.

brian_briones
Participant
0 Kudos

Hi Baskar ,

you are the best in this one.

the problem is I dont know how is the source STRUCTURE, I know is a XML very big, and i need send how string to PROXY(XI CC). Then, how configure the c. channel FILE and how mapping and create the data types.

I hope you understand me becouse Im from Chile.

Regards

nabendu_sen
Active Contributor
0 Kudos
brian_briones
Participant
0 Kudos

hi Nabendu,

if communication channel file, placed in the message protocol "FILE" in the DATA TYPE for only XML tags should I put the same names of the XML tags?

example:

  if the XML is:

<name> brian <\ brian>

in the DATA TYPE should I put:

DT_SENDER

name string 0 ... 1

???

This works if you do not declare the structure with the file content conversion?

nabendu_sen
Active Contributor
0 Kudos

Hi Brian,

For proxy communication, Data Structure needs to be defined within PI. So you will create Data Type and Message Type, SAP System will activate Proxy at their side and use that structure.

Create a Data Type and its corresponding Message Type as:

MT_Receiver

     ---- NAME (String .....0:1)

Now you have to perform Message Mapping where Source will be your File Structure (SENDER_MT) and Receiver will be MT_Receiver:

then at the NAME field use "returnAsXML" just like the document I provided. At the Adapter level, it will be a normal Receiver XI Communication Channel. Thats All!!!

brian_briones
Participant
0 Kudos

Thank Nabendu,

But the problem is I dont know how is the source STRUCTURE, I know is a XML very big, and i need send how string to PROXY(XI CC). Then, how configure the c. channel FILE and how mapping and create the data types.

I hope you understand me becouse Im from Chile.

Regards

nabendu_sen
Active Contributor
0 Kudos

Hi Brian,

I totally understand you. To get the Source Structure, you have 2 options. Either you ask Sender System team to share their XSD (if they are sending XMLs, they must be using some XSD). Otherwise use open market tools. You can copy paste your xml and generate XSD with the below link:

http://www.freeformatter.com/xsd-generator.html

I hope sender is sending XML file, so you don't need any Content Conversion in File channel.

For target, may be you passing the whole xml as a string, but you have to define a Schema (Data Type) which should have a Field to hold the string.

Now Receiver team will activate Proxy from SPROXY transaction and they need to parse this XML (including String) at their ABAP Program.

brian_briones
Participant
0 Kudos

I understand you,

but my problem is the XML, because it's variable in structure.

then, I want to send this one for PI but on a string,

pj:

xml:

<STARXML>

<data1> brian </data1>

<data2> briones </data2>

<dataN> bbriones89@gmail.com </dataN>

<ENDXML>

the XML structure can change and can send me much <DATA> .

and I want to create a DATA TYPE:

data type structure SENDER                                   data type structure RECEIVER

XMLSTRING........./xsd:string....../0...1   <---->          XML........./xsd:string....../0...1 

then, on XMLSTRING MUST HAVE:

<XMLSTRING>

<STARXML>

<data1> brian </data1>

<data2> briones </data2>

<dataN> bbriones89@gmail.com </dataN>

<ENDXML>

</XMLSTRING>

this one i dont know how do.

in communication channel FILE SENDER, what must do?

must selection file or file content conversion??

if is file content conversion, how must configure the variable for get the XML on a STRING?

Understand my questions?

regars and thank nabendu