cancel
Showing results for 
Search instead for 
Did you mean: 

FCC parameter in IDoc to File scenario

Former Member
0 Kudos

Hi,

We have configured FCC parameter to get the comma separated flat file. File is getting created but I want header line in the file which is not getting created. Can any please suggest on the same?

Target DT structure is as below:

Inside root node FileName_Values is used for variable substitution in target File Name and these fields should not be present in file content.

Second node inside root node is having actual structure of file.

FCC configuration is as below:

Thanks,

Vertika

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

BTW, in case it doesn't work then duplicate ***File node using duplicate subtree option in ur mapping and map constant values (i.e ur req field names) to each field in the first occ of **File node and then do ur normal mapping in the duplicated node + remove add header line from FCC - try this if above suggested solution doesn't work

Just to add, it seems u are using multimapping?

Thanks

Amit Srivastava

Former Member
0 Kudos

Yes Amit I am doing multi mapping based on IDoc attribute different file formats(.csv and .txt) are getting created.

I tried what you suggested first that by moving FileName_Values below main structure but still it is not working.

I am doing variable substitution because Filename consists of four variable parameters 2 of them are defined in FileName_Values and other two (Byername and InvoiceNumber) are suppose to be taken from main structure first value.

All other things are working fine but header is not getting populated. I don't want to disturb the mapping much because its complex graphical mapping.

Please suggest the possible option to solve this issue.

Thanks,

Vertika

Harish
Active Contributor
0 Kudos

Hi Vertika,

you can use document offset=1 in receiver adapter.

refer the below wiki and discussion

Basic File Adapter Content Conversion - Process Integration - SCN Wiki

Former Member
0 Kudos

Hello,

I re-checekd SAP help and realized that u cannot define header in case u have multiple structures in FCC.

From SAP help:

This specification is only permitted if exactly one structure is defined.

So the easy option is to use duplicate sutree if u still want to add header line.

BTW, there are other options also like using AM but not sure how much u are acquainted with java and do u really want to implement it.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

Can you explain what exactly you are trying to say when you say duplicate subtree?

I tried below two things but its not giving result as expected:

  1. I have removed the 1st subnode parameters from FCC config and tested the scenario. The header line is getting populated and line item is getting populated but two values of two field that are define in 1st node are also getting populated at the end of file.

2. I removed the first node and added both parameters Sysdate and SAPCustNo into Main structure at the end. But in FCC configuration I had given only those field names that are required in final file. But in this case also those two fields are getting populated.

Is there any way that even if you define 10 fields in target data type, you can configure FCC with only 8 fields based on selection.

Thanks,

Vertika

Former Member
0 Kudos

Hello,

1) I have removed the 1st subnode parameters from FCC config and tested the scenario. The header line is getting populated and line item is getting populated but two values of two field that are define in 1st node are also getting populated at the end of file.

>>In this case u are getting header line becoz u have only one structure i.e. oildex_File

2) I removed the first node and added both parameters Sysdate and SAPCustNo into Main structure at the end. But in FCC configuration I had given only those field names that are required in final file. But in this case also those two fields are getting populated.

Is there any way that even if you define 10 fields in target data type, you can configure FCC with only 8 fields based on selection.

>>AFAIK,answer is NO

>>Can you explain what exactly you are trying to say when you say duplicate subtree?

Open ur actual message mapping (the one with both the nodes) then right click on oildex_File node and use duplicate subtree-> doing this will create 2 nodes -> so in the first oildex_Node remove all ur mapping and map constant value in each elements for instance map constant(Buyer Name) to "BuyerName" field. In the similar fashion do mapping for rest of the fields

and eventually in the second oildex node -> do ur normal mapping (which was there earlier)

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

Thanks for reply Amit.

I created duplicate subtree and mapped the constant value same as field name in one of the node.

The only problem is when I created duplicate subtree the node got created below the main node where actual mapping exists.

So in the file the constant value that is name of the header is coming below to actual line item data.

If this can be resolved my issue will be resolved.

I don't know whether we can push the duplicate tree data to be populated before actual line item.

Thanks,

Vertika

Former Member
0 Kudos

Hello,

That's the reason i proposed u to map constant values in the first occ of ur file node and not the second one.

Anyway, u can try this approach -  create one more 1 to 1 mapping only between ur target structure (change the occ of MTs in this mapping also so multimapping tags gets added automatically) and then u can use duplicate subtree option on target side "oildex_File" node.

So while doing this mapping just repeat the same process which i have explained u above for first occ of oildex_File node (i mean mapping constant values) and for the second occ of **File node just do 1 to 1 mapping (map second occ in target side to the source "oildex_File" node)

Let me say it again, ur second mapping will be between MT_***_Invoice  TO  MT_**_Invoice

once done, add ur second mapping under OM and then check if u are getting constant values before the actual values or not?

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

The reason why I did not do actual mapping in second that is duplicate now because I am not sure whether it will be 1..unbounded or not. Please see the screen shot it doesn't any thing about occurrence.

If I am mapping constant value in first node which is the original node and actual line items in second node I am not sure what will happen in case of more that 1 line item.

More over the tags in duplicate tree are not getting populated as per the actual mapping. Should I do the remapping for all the fields in duplicate subtree to get the actual values in second node

Can you please use full word instead of using acronyms? I am confused what exactly you said in your last post.

Thanks,

Vertika

Former Member
0 Kudos

Hello,

>>Please see the screen shot it doesn't any thing about occurrence.

Duplicate Subtree option will make sure that whatever is the cardinality of Main node (i.e Oildex_File node) will be passed on to the duplicated node as well.

So don't have to worry about that.

>>If I am mapping constant value in first node which is the original node and actual line items in second node I am not sure what will happen in case of more that 1 line item.

Answered above.

If there are more then 1 source line items and if u have mapped source line item to that duplicated target node, then as many occurrences of target node will be created as present in the source item - so treat duplicate node as any other node having multiple cardinality.

>>Can you please use full word instead of using acronyms? I am confused what exactly you said in your last post.

I thought i have written a straight forward reply and used so called acronyms only for simple PI words like Operation mapping, meessage type, occ, ur Message type name...

Anyway, in my previous reply i was proposing u another approach where i was suggesting to create one more mapping between ur target structure only i.e. MT_Oildex_Invoice.

So with the second approach, you don't have to change anything in your existing mapping.

Create one more 1 to 1 mapping between your target structure only (and while doing mapping change the occurrence of message type so that multimapping tags gets added automatically) and then u can use duplicate subtree option on "oildex_File" node on the target side.

So while doing mapping just repeat the same process which i have explained you above for first occurrence of oildex_File node (i mean just map constant values in the first occ of oildex node) and for the second occurrence of "oildex_File" node just do 1 to 1 mapping (map second occurrence of oildex_file node in target side to the source "oildex_File" node)

Let me say it again, ur second mapping will be between MT_oildex_Invoice  TO  MT_oildex_Invoice

once done, add ur second mapping under Operation Mapping and then check if you are getting constant values before the actual values or not?

Thanks

Amit Srivastava

Former Member
0 Kudos

BTW, if u don't want to use two mappings and instead of that want to do everything in one then u have to change ur existing mapping.

Whatever logic you have implemented currently has to be swapped.

First occurrence of Oildex_Node -> will only have constant values inside it

Second (duplicated) occurrence of oildex_node -> will have ur actual business mapping

One more clarification-

U -> You

Ur -> Your

Thanks

Amit Srivastava

Former Member
0 Kudos

Thanks Amit for solution...

Since I am new to PI, probably I am not aware of many acronyms ..!!

Your solution is working , I swaped the mapping first node is now having constant mapping and second has actual mapping. I have tested this for one lineitem only. I will testing this for multiple line items.

Currently I have below config in FCC:

But with this config a blank line is getting appended on top of the file as below:

When I added end separator 0 and 1 simultaneously in FCC parameter FileName_Values.endSeparator --> 0

The below file is getting generated which has 0 , 1 appendend.

This clearly shows its because of end Separator. But how can we get rid of this?

Thanks,

Vertika

Former Member
0 Kudos

Hello,

I think, you have to alter ur structure little bit. Go to your data type and change the order of "FileName_Values" node, so create it just after oildex_File node and then test ur file output?

BTW, if i am not wrong at least twice i have told u that don't merge multiple questions in a single thread. So, in case you have other questions then please raise a new thread.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

Thanks for all ur inputs. I believe the entire discussion was on single area and single point that's where I did not create a new thread.

Regards,

Vertika

Former Member
0 Kudos

Hello,

No, i think u got it wrong.

Thread should address specific doubt/question, and not multiple questions on the same topic.

Ur original query (which i believe) was already answered above and for any other questions u should  raise a new thread - To get acquainted with the rules read rules of engagement.

Thanks

Amit Srivastava

Answers (2)

Answers (2)

former_member184720
Active Contributor
0 Kudos

Hi Vertika - If you are just using the header to populate the file name.. why don't you use dynamic configuration?

Former Member
0 Kudos

Hello,

I think u have to adjust ur structure, add FileName_Values tag after ur main tag in structure and then check ur output??

Thanks

Amit Srivastava