cancel
Showing results for 
Search instead for 
Did you mean: 

FIle Content Conversion Problem in IDOC-XI-File Scenario

Former Member
0 Kudos

Dear All,

I am doing IDOC-XI-FILE scenario.

I am facing one problem related to File Content Coversion.My requirement was to generate a dynamic file like <b>%store_code%_%current_date%_sitemaster.xml</b> , I have completed the dynamic generation successfully .

Now there is slight change in the requirement ,<b>we have to suppress the current_date node of the xml content</b> . i have tried to suppress the current_date using these <b>DATE.fieldFixedLengths 0 , Date.fixedLengthTooShortHandling Cut</b> , But I am unable to suppress it Can some body provide me the details on this .

The output xml version generated by Reciever file adapter is as below :

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

- <ns0:MT_SITE_MASTER xmlns:ns0="http://sample-xitest.com/sitemaster">

- <SITE_DATA>

<STORE_CODE>N002</STORE_CODE>

<TITLE_MEDI>Company</TITLE_MEDI>

<STORE_NAME>Mount Road</STORE_NAME>

<STREET>Chennai</STREET>

<COUNTRY>IN</COUNTRY>

<SALES_TAX_NO>12345678910</SALES_TAX_NO>

</SITE_DATA>

</ns0:MT_SITE_MASTER>

Plz provide me the code I have to write in the file content conversion .

Thanks in advance

Regards

Prabhat

Accepted Solutions (0)

Answers (4)

Answers (4)

STALANKI
Active Contributor
0 Kudos

But then we should not configure the interface with field content conversion.I will soon come back to you on that.There should be a way out.

STALANKI
Active Contributor
0 Kudos

Can you please let me know wether you need an xml file or text file?It is bit confusing.

Former Member
0 Kudos

Dear Sravya ,

I need xml file with field suppression.

plz help me .

Thanks in advance

Regards

Prabhat

STALANKI
Active Contributor
0 Kudos

Please refer to https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2161. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

moorthy
Active Contributor
0 Kudos

HI,

In your output XML I am unable to see the Date Node. So first of all populate the same thru Mapping. Without this how you are populating the same in the Dynamic File Name. Because Variable substituion will work on Payload or Message ID .

If you have made separate node for the Date, then Suppress Concept i.e "Cut" will work. This will not work for the fields inside the Node.

For eg. if the Message is like this:

<Msg>

<Node1>

<field1> </field1>

</Node1>

<Node2>

<field2> </field2>

</Node2>

</Msg>

Now if you give like this it will work.

Node2.fieldFixedLengths 0

Node2.fixedLengthTooShortHanling Cut

Hope this helps you,

-Moorthy

Former Member
0 Kudos

Dear Krishna ,

Sorry for the inconvienience , actually Current_Date node is there in my xml .

Below is the output file .

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

- <ns0:MT_SITE_MASTER xmlns:ns0="http://sample-xitest.com/sitemaster">

- <SITE_DATA>

<STORE_CODE>N002</STORE_CODE>

<CURRENT_DATE>20051105</CURRENT_DATE>

<TITLE_MEDI>Company</TITLE_MEDI>

<STORE_NAME>Mount Road</STORE_NAME>

<STREET>Chennai</STREET>

<COUNTRY>IN</COUNTRY>

<SALES_TAX_NO>12345678910</SALES_TAX_NO>

</SITE_DATA>

</ns0:MT_SITE_MASTER>

Plz tell me how to write the code in the File content conversion . Plz need your help urgently .

Thanks in adavance

Regards

Prabhat

moorthy
Active Contributor
0 Kudos

If u see my earlier reply, I mentioned that u can not suppress the field from the one node.i.e Form SITE_DATA data type u can not suppress the field called CURRENT_DATE.

My suggestion is that , modify the Data type in such a way that you will be having two nodes as I have mentioned earlier. Then use the Suppress Logic for the Current Date.

So it will look like this-

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

- <ns0:MT_SITE_MASTER xmlns:ns0="http://sample-xitest.com/sitemaster">

- <SITE_DATA>

<STORE_CODE>N002</STORE_CODE>

<TITLE_MEDI>Company</TITLE_MEDI>

<STORE_NAME>Mount Road</STORE_NAME>

<STREET>Chennai</STREET>

<COUNTRY>IN</COUNTRY>

<SALES_TAX_NO>12345678910</SALES_TAX_NO>

</SITE_DATA>

<CURR_DATE>

<CURRENT_DATE>20051105</CURRENT_DATE>

</CURR_DATE>

</ns0:MT_SITE_MASTER>

So ur SITE_DATA is not having a field called CURRENT_DATE. This field is in separate node (segment ) called CURR_DATE. Now u can use the Suppress Logic for the same like this.

CURR_DATE.fieldFixedLengths - 0

CURR_DATE.fixedLengthTooShortHanling - Cut

And in your Variable Substitution you can use the date from the other segment called CURR_DATE.

Hope this solves ur problem.

Regards,

Moorthy

Former Member
0 Kudos

Dear Krishna ,

I am still not able to slove this problem .

********************************************************

<b>The error in the message monitor is coming like this :</b>

Error File adapter receiver channel FILE_ADAPTER_SITEMASTER is not initialized. Unable to proceed: null

2005-11-07 07:10:56 Error Exception caught by adapter framework: File Adapter configuration not initialized:

2005-11-07 07:10:56 Error Delivery of the message to the application using connection AFW failed, due to: File Adapter configuration not initialized:

*******************************************************

<b>I have done the followings configuration:</b>

1)File name scheme : %var1%_%var2%_sitemaster.xml

2)var1: payload:MT_SITE_MASTER,1,SITE_DATA,1,STORE_CODE,1

var2:payload:MT_SITE_MASTER,1,CURR_DATE,2,CURRENT_DATE,1

Content Conversion Parameters :

Recordset Structure : CURR_DATE,2

Name Value

CURR_DATE.fieldNames CURRENT_DATE

CURR_DATE.fieldFixedLengths 0

CURR_DATE.fixedLengthTooShortHandling Cut

This is what I have done . Could you plz help me to find out the solution .

Thanks in advance

Regards

Prabhat

Former Member
0 Kudos

Hi,

If you have considered Krishna's XML structue than your Content Conversion should be

Recordset Structure : SITE_DATA, CURR_DATE

To cut Curr_data structure.

CURR_DATE.fieldFixedLengths 0

CURR_DATE.fixedLengthTooShortHandling Cut

Hope it helps,

Satish

Former Member
0 Kudos

Dear Satish ,

I have done the configuration as per your sugesstion and now I am able to suppress the field but I am not getting the output in xml format .

<b>My requirement is to get the xml file as output , Can plz suggest what could be the configuration required for generating xml output with field suppression .</b>

I have done following configuration in File content conversion :

RECORDSET STRUCTURE : SITE_DATA,CURR_DATE

SITE_DATA.fieldNames STORE_CODE,TITLE_MEDI,STORE_NAME,STREET,POSTAL_CODE,COUNTRY,LANGUAGE_KEY,STORE_TYPE,SALES_TAX_NO,CENTRAL_TAX_NO

SITE_DATA.fieldSeparator 'nl'

SITE_DATA.processFieldNames fromConfiguration

CURR_DATE.fieldFixedLengths 0

CURR_DATE.fixedLengthTooShortHandling Cut

plz help me as to how to get the output in xml .

Thanks in advance

Regards

Prabhat

Former Member
0 Kudos

Hmmm, this is interesting...

You need XML output with some supressed node for which you want to do variable substitution.

I dont think this is possible through Field content conversion. It is used to Text output.

I was under impression that you desired a text file as output.

I doubt if it is possible till SP13 (I am on SP13).

Best regards,

Satish

Former Member
0 Kudos

Hi,

In the Communication channel We have an option in the File processing parametrs that is File construction mode Here i gave Append, every time the output is appended to the current file, but my requirement is i want to append the data on the date wise, means today(05/09/08) i want only one file, tomorrow(06/09/08) ill get only one file,...

So in the target side i created one field and at the mapping time i mapped this to current date, and use this field in the CC,

I followed this blog

Here i am getting the output, but the thing is i am getting the blank line for another date. means i got file with date, one blank line , i got file with date, But i don't want to get that blank line, how to do that ?