cancel
Showing results for 
Search instead for 
Did you mean: 

FCC help

Former Member
0 Kudos

Hi evryone,

I have small problem with FCC,

I have done a Idoc(Invoice) to file (CSV )scenario. I want the target CSV file like shown below.

243455750,08/9/2012,ITEM,90,7

 

The first column is InvoiceNumber, and second column InvoiceDate,

The third colum is Linetype, fourth column is LineAmount and fifth column is POlineNumber.

The first two columns have header details and the remaining three columns have line Item details. I know it is simple to create such file using FCC.

The above file basically shows what to include for one line item. If an invoice has more than one line item, then each line item is represented by a line or record in the CSV file.

Like shown below

243455750,08/9/2012,ITEM,90,7

243455750,08/9/2012,FREIGHT,45,10

243455750,08/9/2012,FUEL,21,11

you can observe in the above file a new record with same header details is created for each line ITEM.

To accomplish the above i have gone with the below approach.

I have created below data type.

- <ns0:MT_INVOICETOCSV>

- <Record>0 to unbounded   

  <InvoiceNumber>0 to 1

  <InvoiceDate>0 to 1

  <LineType>1 to unbounded 

  <LineAmount>1 to unbounded

  <POLineNumber>1 to unbounded

  </Record>

  </ns0:MT_INVOICETOCSV>

To achive the requirement I want the target file to be like shown below for example if i have three line items coming from source Idoc

- <Record>

  <InvoiceNumber>243455750</InvoiceNumber> 

  <InvoiceDate>08/9/2012</InvoiceDate>

  <LineType>ITEM</LineType>

  <LineAmount>90</LineAmount>

  <POLineNumber>7</POLineNumber>

- <Record>

  <InvoiceNumber>243455750</InvoiceNumber> 

  <InvoiceDate>08/9/2012</InvoiceDate> 

  <LineType>FREIGHT</LineType>

  <LineAmount>45</LineAmount>

  <POLineNumber>10</POLineNumber>

- <Record>

  <InvoiceNumber>243455750</InvoiceNumber> 

  <InvoiceDate>08/9/2012</InvoiceDate> 

  <LineType>FUEL</LineType>

  <LineAmount>21</LineAmount>

  <POLineNumber>11</POLineNumber>

Hope my question is clear.

Please can any one help me with the mapping I mean to accomplish the above. Also please suggest me if there is any better approach. This is really a urgent required Please can some one get me out of this.

Regards

Devansh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think in your source file there can be a segment which indicates no of line items for a particular invoice/header..

if that is available all you need is to generate the header data (invoice ,date ) as many no of times as line items

using one as many node function will solve your query..

HTH

Rajesh

Answers (3)

Answers (3)

former_member190624
Active Contributor
0 Kudos

Hi Devansh,

I think you are having problem in mapping. May be Shabarish blog will help you .http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/01/14/file-conversion-using-nodeception

Regards

Hari.

former_member189387
Active Contributor
0 Kudos

Hi ,

Do you have issue in mapping or FCC ?

If mapping ,

                     Then please use Use one as many node function as suggested in Graphical mapping .

For more clarity paste the source structure as well.

If FCC,

         Once you got the recordset as you have explained earlier , then use the following in your FCC

Document Name :    message type name

Doc Namespace    your namespace

RecordSet Name      Record

RecordSet Structure   Record,*

Name                                  Value

Record.fieldSeparator                  ,

Record.fieldNames                 InvoiceNumber,InvoiceDate,LineType,LineAmount,POLineNumber

ignoreRecordSetName            true

Former Member
0 Kudos

Hi Rajan,

Thanks for your help, can you please give me your mail ID, so that i can send you my source file.

In the above i have just mentioned small part of my target to make it understandable. but the requiremnet is similar.

Since it is very big and goth other requirements to fulfil with mapping ( I need to send you my mapping spec as well). It would be really easy if i can mail you once my requirements.

Thanks for all your help. Please help me get this............this is really a urgent requirement.

Thanks 

Former Member
0 Kudos

yes that is correct what was poste by earlier poster, you can use Node function "useOneAsMany" in mapping level because header values need to repeat on target side and

no need 1 to unbounded for LineType,LineAmount,POLineNumber just u can use 1 to 1 insted of 1 to unbounded

http://www.saptechnical.com/Tutorials/XI/NodeFunctions/Page5.htm

and comming to FCC: just u can use below format mightbe it's helpful....

Record.fieldNames: InvoiceNumber,......,POLineNumber

Record.fieldSpeparator:  ,

Record.endSeparator: nl

refer below blog for more info:

http://www.riyaz.net/sap/xipi-file-content-conversion-for-simple-structure/75/

Former Member
0 Kudos

Hi Sankar,

Thanks for your help.

I will try the approach and get back to you if i have any doubts.

Regards

Dev