Subject : To differentiate different flat files or populate file source in datatargets.

Hi,
I need to load 2 similar flat files to a single ODS. Only change is that, during the load, in the first file, File1, I want to set a field, File Type, as File1; and during the load of the second file, File2, I want to set File Type, as File2.One update rule which loads File1, already exists. I wanted to create the second update rule(for File2), but I encountered problems because I kept receiving a message that the update rule already exists for the ODS.I went to the InfoSource tree and under the infoSource for File1, I could see the transfer rule; at this point, I was able to create a second transfer rule where I was able to set the second constant while loading File2, as File Type as File2.What is the effect of creating 2 transfer rules for the InfoSource, as against creating 2 update rules for the ODS, which was I originally wanted to do?

Thanks
Amanda Baah

Solutions:

Hi Amanda,

If both file formats are same, it better to populate File1 or File2 dynamically then a constant. Every time not supposed to create new transfer rules and data soruce for new flat file. Instead of constant, write a routine for File Type. Based on file name sinply pass File1 or File2 in routine. OrUse function module "BAPI_IPAK_GETDETAIL" to get infopackage details including file name. from flat file name also File type can be derived. In this way no need to maintain multiple transfer rules or update rules. Existing flow is enough.

Hope it Helps
Srini

Ref : https://www.sdn.sap.com/irj/sdn/thread?threadID=598675&messageID=4283351#4283351