I have several different scripts running on import and would like a way to automatically export the import screen in FDM to excel. This should give me an excel file that is the result of the import scripts but has not been translated through the maps. From what i have found i need to place this in the AftFileImport event script so that it is run every time. I realize there is a button on the import screen that performs this function however I would prefer not to have to manually press this every time a file is submitted. I assume there is some way to do this and have looked through the API guide, however, I wasn't about to find exactly what i was looking for. Can someone please provide the function i would use to do this?
Alright, i was able to get this to work. It creates a text file with the tdatamap contents for the current month on import. All i am lacking now is the correct data table, i would like this file to include the results of the import step in FDM. If anyone knows what data table i should use please let me know.
Sub AftFileImport(strLoc, strCat, strPer, strFile, lngRecs)
'Perform script on SAP-TB location only
If RES.PlngLocKey = "750" Then
Dim dtePerKey 'Placeholder for Period key
Dim strCatKey 'Placeholder for Category key
Dim strLocKey 'Placeholder for Location Key
Dim strSegKey 'Placeholder for Segment Key
'File system variables
Dim objFileSystem 'File System
Dim strFileName 'File name
Dim strSQL ' Placehold for SQL Query
Dim rssql 'Placeholder for result set for sql query execution
What you need to do is query the tPOVPartition table to retrieve the dataseg table associated with the location you are loading the data for. Field is called PartSegmentKey. This will be a number, just append this number to tDataSeg and voila you have a reference to the correct data table