pkatanic
20th October 2015, 11:10
Hello friends,

I have a task to create Exchange-scheme. The task is to import data from xlsx file to table tfgld102. I never done that before. What should I do? I read manual and I know about daxch0531m000 session, but it is not enough clear for me. Please give me instructions or ideas

mark_h
20th October 2015, 15:00
You can search exchange and get all kinds of threads to read to assist.

Here is my recommendation is to start with maintain exchange schemes - on 4c4 that is tuxch0101m000. Pick something small table to practice on. Then in maintain exchange schemes you can read help, create the exchange scheme - then use special to maintain the ascii file, maintain the batch. So in 4c4 you can do just about everything from starting with that session. Then you can run the import or export session. The main thing is to pick a small table to practice with until you understand what happens.

Now how I would handle this is not thru an exchange scheme - I would write a program to read in the records that would go into tfgld102 - perform validations, show the users errors, etc. Exchange schemes are nice for simple little imports and not much validation needed - don't get me wrong you can do a whole lot with exchange schemes, validations, etc., but in the end you end up with another flat file with not always are very good errors. In the past what I do is create a table and a session to allow the users to load the tables with records. Usually the users create me a .csv file - the session then loads it into this table. Then I allow the users to process the records into some other table. Then if there are errors I can show them what they are in the intermediate table - they can fix them and re-process them. Works nicer than me sending them back an exchange scheme error file - which can be confusing itself.

Side note - not sure about you users, but ours love to change the format of the excel files no matter how many times we tell them not to. At least they catch some of it on the load to my intermediate table. With exchange it could be every record errors or something gets loaded where it shouldn't be by chance.

Those are my thoughts for the day. Good luck on what ever you chose.

mark_h
20th October 2015, 15:08
OOPs - ps: As I process the records I write them to a history table. This has saved me several times when the users question where something came from. I can tell them who and on what date they processed the records. I don't always give them access to the history tables - if I do it is ready only.

benito
20th October 2015, 15:31
if you are in LN try to use DAL in exchange schemes, saves you from having to worry about related tables to be populated.

pkatanic
21st October 2015, 16:53
thank you guys!