cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion

Former Member
0 Kudos

Hi All,

The scenario is File to IDoc and i am using Sender FCC. The data is

H0010100120070802200708021001001 9001 001146

D001010012050000000706 0181820099000 0000099000

H0029100120070805200708051001004 9001 1 001146

D002910010123456789 0000000100000 0000100000

D002910010123456788 0200000050000 0000050000

H - Header

D - Data

Header includes Header data

Data also includes information

I have given in Recordset structure as Header,,Data,

But the xml structure after conversion is

<Header> </Header>

<Data> </Data>

<Data> </Data>

<Header> </Header>

<Data> </Data>

<Data> </Data>

But i need the structure to be as

<Header>

<Data> </Data>

</Header>

<Header>

<Data> </Data>

</Header>

Even Header also includes data.

So how can i specify in FCC. Is it possible in FCC, if so let me how can i go about it ??

Regards

Ramesh P

Accepted Solutions (0)

Answers (2)

Answers (2)

prabhu_s2
Active Contributor
0 Kudos

analyzing ur input file:

D002910010123456789 0000000100000 0000100000 and

D002910010123456788 0200000050000 0000050000 should be under

H0029100120070805200708051001004 9001 1 001146

and the same with

H0010100120070802200708021001001 9001 001146 and

D001010012050000000706 0181820099000 0000099000

if this is the case u get strucutre after convertion as

<Header> </Header>

<Data> </Data>

<Header> </Header>

<Data> </Data>

<Data> </Data>

are u getting this one? if not whats the issue?

Former Member
0 Kudos

hi prabu,

you have determined exactly correct. I am receiving the content how you have specified.

But can i get the structure as

<Header>

<Data></Data>

<Data></Data>

</Header>

Because with structure which i am getting now i have problem in generating IDoc.

The IDoc generated only has

Segment1 - for header

Segment2 - for data >>>>>>>>>>>>>> other data are missing

Segment1 - for header

Segment2 - for data

how shall i go about to get it right in IDoc

Please give suggestion

regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

with ur FCC inplace, D00101 is associated to the header H00101. In this case u will get only

<header>

<Data></Data>

</header>

and not

<header>

<Data></Data>

<Data></Data>

<header>

but for D0029 u will get as below as there are 2 line items associated with header H0029

<header>

<Data></Data>

<Data></Data>

<header>

Message was edited by:

Prabhu S

Former Member
0 Kudos

Hi,

Yes prabhu

I need the structure as you specified. But how to achieve using FCC.

Regards

Ramesh P

Former Member
0 Kudos

hi

I have given Recordset as Header,1,Data,*

but i am getting as

<header></header>

<Data></Data>

<header></header>

<Data></Data>

<Data></Data>

regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

considering this data:

H0010100120070802200708021001001 9001 001146

D001010012050000000706 0181820099000 0000099000

H0029100120070805200708051001004 9001 1 001146

D002910010123456789 0000000100000 0000100000

D002910010123456788 0200000050000 0000050000

post the expected xml strucutre with the dataset and also the FCC parameters u had maintained.

Former Member
0 Kudos

Hi Prabu,

Thanks for your replies.

for the above data the xml structure i require is

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

<ns:StoreOrderDetails xmlns:ns="http://namespace.com">

<Header>

<RecordType>H</RecordType>

<TransactionNumber>0010</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<OrderDate>20070802</OrderDate>

<ExpectedDelivery>20070802</ExpectedDelivery>

<PurchaseOrderNumber>1001001</PurchaseOrderNumber>

<VendorSupplierNumber>9001</VendorSupplierNumber>

<OrderType>0</OrderType>

<EnteredBy>01146</EnteredBy>

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0010</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>2050000000706</PLUSKU>

<Quantity1></Quantity1>

<PositiveFlag></PositiveFlag>

<Price>018182</Price>

<Quantity2>0099000</Quantity2>

<VendorSKU></VendorSKU>

<OrderingNumber></OrderingNumber>

<Quantity3>000009900</Quantity3>

</Body>

</Header>

<Header>

<RecordType>H</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<OrderDate>20070805</OrderDate>

<ExpectedDelivery>20070805</ExpectedDelivery>

<PurchaseOrderNumber>1001004</PurchaseOrderNumber>

<VendorSupplierNumber>9001</VendorSupplierNumber>

<OrderType>1</OrderType>

<EnteredBy>001146</EnteredBy>

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456789</PLUSKU>

<Quantity1></Quantity1>

<PositiveFlag></PositiveFlag>

<Price>000000</Price>

<Quantity2>0100000</Quantity2>

<VendorSKU></VendorSKU>

<OrderingNumber></OrderingNumber>

<Quantity3>000010000</Quantity3>

</Body>

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456788</PLUSKU>

<Quantity1></Quantity1>

<PositiveFlag></PositiveFlag>

<Price>020000</Price>

<Quantity2>0050000</Quantity2>

<VendorSKU></VendorSKU>

<OrderingNumber></OrderingNumber>

<Quantity3>000005000</Quantity3>

</Body>

</Header>

</ns:StoreOrderDetails>

<b>FCC parameters</b>

Document Name - StoreOrderDetails

Document NameSpace - http://namespace.com

Recordset Structure - Header,,Body,

Recordset Sequence - Ascending

Key Field Name - Record Type

and i have given the conversion parameters

<b>and i am getting payload as</b>

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

<ns:StoreOrderDetails xmlns:ns="http://namespace.com">

<Header>

<RecordType>H</RecordType>

<TransactionNumber>0010</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<OrderDate>20070802</OrderDate>

<ExpectedDelivery>20070802</ExpectedDelivery>

<PurchaseOrderNumber>1001001</PurchaseOrderNumber>

<VendorSupplierNumber>9001</VendorSupplierNumber>

<OrderType>0</OrderType>

<EnteredBy>01146</EnteredBy>

</Header>

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0010</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>2050000000706</PLUSKU>

<Quantity1></Quantity1>

<PositiveFlag></PositiveFlag>

<Price>018182</Price>

<Quantity2>0099000</Quantity2>

<VendorSKU></VendorSKU>

<OrderingNumber></OrderingNumber>

<Quantity3>000009900</Quantity3>

</Body>

<Header>

<RecordType>H</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<OrderDate>20070805</OrderDate>

<ExpectedDelivery>20070805</ExpectedDelivery>

<PurchaseOrderNumber>1001004</PurchaseOrderNumber>

<VendorSupplierNumber>9001</VendorSupplierNumber>

<OrderType>1</OrderType>

<EnteredBy>001146</EnteredBy>

</Header>

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456789</PLUSKU>

<Quantity1></Quantity1>

<PositiveFlag></PositiveFlag>

<Price>000000</Price>

<Quantity2>0100000</Quantity2>

<VendorSKU></VendorSKU>

<OrderingNumber></OrderingNumber>

<Quantity3>000010000</Quantity3>

</Body>

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456788</PLUSKU>

<Quantity1></Quantity1>

<PositiveFlag></PositiveFlag>

<Price>020000</Price>

<Quantity2>0050000</Quantity2>

<VendorSKU></VendorSKU>

<OrderingNumber></OrderingNumber>

<Quantity3>000005000</Quantity3>

</Body>

</ns:StoreOrderDetails>

Hope you got the clear picture. Suggest me how to go about

Regard

Ramesh P

Message was edited by:

Ramesh Parashivamurthy

Former Member
0 Kudos

Hi Ramesh,

I dont think the way you want the xml structure is possible without module development.

I think the problem comes in mapping.

You can easily acheive the same using node functions and UDF.

Regards,

Sumit

Former Member
0 Kudos

hi sumit,

Thanks for your reply.

How can i go about using node funcitons or UDF

prabhu_s2
Active Contributor
0 Kudos

check with ur DT

is ur current DT as follows:

Header
|
|
Body

check with

Header
 |
 |__Body

Former Member
0 Kudos

Hi Prabhu,

I dont think itz related with Data Type def. No matter in which way you define the DT it all(xml) depends on the FCC parameters mentioned in the adapter.

Regards,

Sumit

Former Member
0 Kudos

hi

my DT given is

Header

|

|

Body

why i have given like this is because my xml payload after FCC is coming as

Header

|

Body

I just need help in converting the payload after FCC as

Header

|

Data

Then my target will be achieved.

I read many blogs, i didnt come across such situation. I think this is not possible thru FCC. Do i have make some other appraoch ??

Thanks and Regards,

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

i doubt this bcoz the data the is pulled up after FCC is structured as per the data type defintion. hence we may need to have this handleed by changing the DT and FCC acordingly. Still there exists another option via maaping where u need to define another structre as per requirement and use it as a target MT and do the mapping

Former Member
0 Kudos

Hi Prabhu,

How does it matter .. as in FCC and data type def..

>>>FCC is structured as per the data type defintion

True but if you change the data type defination with out changing the FCC . It doesnt matter. The xml would be the same as before.

What i mean to say is that--

While FCC the structure of the data type / message type is not taken into consideration..

Regards,

Sumit Khetawat

Message was edited by:

Sumit Khetawat

prabhu_s2
Active Contributor
0 Kudos

u missed 'after' keyword. The xml strucutre that is framed after the FCC and aligns with the DT. considering this we need change in the DT

Message was edited by:

Prabhu S

Former Member
0 Kudos

Hi,

Can i frame a xml structure like

<header>

|<Data/>

|<Data/>

</header>

<header>

|<Data/>

|<Data/>

</header>

using FCC.

I think this is not possible right, so i have to take care during mapping only ??

Am i correct.If so how to go about in shifting the nodes

Regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

ramesh

as per ur post the req structure is

Header

|

|__Body

and as of now ur are getting the structure

Header

|

|

Body

confirm what is required?

Former Member
0 Kudos

prabhu,

i <b>require </b>the following structure after FCC

Header

|_ <data>

|_ <data>

</Header>

Header

|_ <data>

|_ <data>

</Header>

Header

|_ <data>

|_ <data>

</Header>

But now i am getting it as

Header </Header>

<data>

<data>

Header </Header>

<data>

<data>

Header </Header>

<data>

<data>

Hope you are clear

Thanks and regards

Ramesh P

Message was edited by:

Ramesh Parashivamurthy

prabhu_s2
Active Contributor
0 Kudos

just do a simple test by changing the DT strucutre like:

Header

|_ <data>

what is the existing strucutre of ur DT?

Former Member
0 Kudos

hi

The exact problem is in my IDoc generation

my idoc is

Segment1

|__ Segment2

My current data type is

Header

Data

Hence i cannot map it correctly

i need my DT as

Header

|__Data

If i get my xml payload like this my problem will be solved and even the IDoc will be generated perfectly.

<i>just do a simple test by changing the DT strucutre like:</i>

I tried as you said, i ll get mapping error.

regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

is it a mapping error? what does the error says? is it in sxmb_moni?

Former Member
0 Kudos

yes the error runtime mapping exception

it can generate the target element is the error. - sxmb_moni

regards,

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

seems some issue with the mapping and not with FCC. can u check the payload and can u post the same???

Former Member
0 Kudos

Hi Prabhu,

Typically in a FCC..

AFAIK changing the structure of DT doesnt change the way XML is generated. It all depends on the FC conversion parameters mentioned in the file adapter.

Regards,

Sumit

Former Member
0 Kudos

hi sumit,

do i have to use splitbyvalue nodefunction to achieve this. Basically i need to remove the child node and place it in under another node

regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

i'm trying to understand the need of the option Record Structure in FCC? if FCC controls the way XML is generated then why do we need to specify the record strucutre name?

prabhu_s2
Active Contributor
0 Kudos

Ramesh

Splitbyvalue introduces contexts. can u post the payload to see how the xml is framed after the change in the DT?

thkx

Prabhu

Former Member
0 Kudos

Hi Prabhu,

Cause then it needs to know the structure of the xml document to create.

Btw ..you can try changing the data type to a different structure and let the FCC be as it is. XML being created will still be the same..

If you understood wht i am saying ..just give it a try in your XI system...

Anyway..Might be both of us are thinking in a different way.

Regards,

Sumit

Former Member
0 Kudos

prabhu

how can i get the payload after the change in DT

since my recordset structure - Header,,Data,

my payload will be generated as

Header

Data

Data

regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

if the error (mapping) is in sxmb_moni u can take that payload and mail me on that.

Message was edited by:

Prabhu S

prabhu_s2
Active Contributor
0 Kudos

yes, the record strucutre is required for the xi to understand how the xml doc is to be created. when we are chaging the DT i believe it could make a difference. maybe we might need to change the FCC also (?). our thoughts are not in sync and lets try it out

prabhu_s2
Active Contributor
0 Kudos

after the change in DT ensure the same changes are seen in MT. Else change the MT and activate

Former Member
0 Kudos

Hi Prabhu,

>>>we are chaging the DT i believe it could make a difference. maybe we might need to change the FCC also (?).

Unless and untill we change the FCC it wont make any difference .. simply by changing the DT/MT.

Incase you try it out do post your observation .

Regards,

Sumit

Former Member
0 Kudos

hi

I changed my DT

as

Header

|

|__ Body

I am receiving any error while mapping. Because there is data generated for Data node.

="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>

<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3

Because the target node cannot be generated.

Since we have specified as in FCC as Header,,Data, the DT should be

Header </Header>

Data </Data>

Data </Data>

but my requirement is

<Header>

Data </Data>

Data </Data>

</Header>

Thanks and Regards

Ramesh P

Former Member
0 Kudos

hi

if my <b>source </b>xml structure is like this

<Header> </Header>

<Data></Data>

<Data></Data>

Can we <b>change </b>this to

<Header>

<Data></Data>

<Data></Data>

</Header>

both Header and Data are 0... unbounded.

Can we change it? is it possible in FCC or we need to use some node functions as such

Regards

Ramesh P

prabhu_s2
Active Contributor
0 Kudos

error related with mapping. need to check with mappping now. can u mail me the payload after the change from moni?

Former Member
0 Kudos

Ramesh

I have tried a solution which you are discussing and it will give the required...You posted sample XML file you are getting right(which is not the required one)...take that as input file XML for mapping and create a target data type and message type as follow

StorOrderDetails_Target
      --Header (1..1)
           -RecordType
           -Transnum
           -.........
           -Body (0 to Unbounded)
               -RecordType
               -TransNum
               -........

and map your source XML to corresponding fields in target...just like one to one map..You will get the required mapping you want..

if you have any questions let me know....i guess it should work

Former Member
0 Kudos

Hi Guru

I tried this intermediate mapping. After the mapping the data generated is as follows

<ns0:StoreOrderDetailsIntermediate>

&#8722;

<Header>

<RecordType>H</RecordType>

<TransactionNumber>0010</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<OrderDate>20070802</OrderDate>

<ExpectedDelivery>20070802</ExpectedDelivery>

<PurchaseOrderNumber>1001001</PurchaseOrderNumber>

<VendorSupplierNumber>9001</VendorSupplierNumber>

<OrderType/>

<EnteredBy>001146</EnteredBy>

&#8722;

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0010</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>2050000000706</PLUSKU>

<Quantity1/>

<PositiveFlag/>

<Price>018182</Price>

<Quantity2>0099000</Quantity2>

<VendorSKU/>

<OrderingNumber/>

<Quantity3>000009900</Quantity3>

</Body>

&#8722;

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456789</PLUSKU>

<Quantity1/>

<PositiveFlag/>

<Price>000000</Price>

<Quantity2>0100000</Quantity2>

<VendorSKU/>

<OrderingNumber/>

<Quantity3>000010000</Quantity3>

</Body>

&#8722;

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0029</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456788</PLUSKU>

<Quantity1/>

<PositiveFlag/>

<Price>020000</Price>

<Quantity2>0050000</Quantity2>

<VendorSKU/>

<OrderingNumber/>

<Quantity3>000005000</Quantity3>

</Body>

&#8722;

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0030</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456789</PLUSKU>

<Quantity1/>

<PositiveFlag/>

<Price>000000</Price>

<Quantity2>1000000</Quantity2>

<VendorSKU/>

<OrderingNumber/>

<Quantity3>000100000</Quantity3>

</Body>

&#8722;

<Body>

<RecordType>D</RecordType>

<TransactionNumber>0030</TransactionNumber>

<StoreNumber>1001</StoreNumber>

<PLUSKU>0123456788</PLUSKU>

<Quantity1/>

<PositiveFlag/>

<Price>020000</Price>

<Quantity2>1000000</Quantity2>

<VendorSKU/>

<OrderingNumber/>

<Quantity3>000100000</Quantity3>

</Body>

</Header>

</ns0:StoreOrderDetailsIntermediate>

The structure all messed up Guru, Now the structure comes as

Header

Body

Body

Body

Header

Header

regards

Ramesh P

Former Member
0 Kudos

Ramesh

Could you post screen shot your intermediate mapping..

I will try to work it out

Former Member
0 Kudos

can i have your e-id

Former Member
0 Kudos

Just a question...the output XML you have got is as follows

<header>

<body></body>

<body></body>

<body></body>

</header>

This is the one you want right..(or is it different)...I was thinking of above format is what you want...any ways my email is

<a href="http://veluru.nk@gmail.com">this</a>

Former Member
0 Kudos

it is different

all the body of other headers was coming under one header only

regards

Ramesh P

Former Member
0 Kudos

Hi Ramesh,

>>>>>But i need the structure to be as--

As per the test data given by you..You mean like this way ?

<Header>

<Data> </Data>

</Header>

<Header>

<Data> </Data>

<Data> </Data>

</Header>

Check this blog.. /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem

Also this link from sap help..

http://help.sap.com/saphelp_nw04/helpdata/en/0d/00453c91f37151e10000000a11402f/frameset.htm

Regards,

Sumit