Smiffy
27th March 2002, 12:46
Is it possible to automate the use of an exchange scheme from within a script? I propose using STPAPI. Has anyone had any problems/experiences of doing this?

I wish to import data from a comma separated excel document to a table. I can do this via sequential reading and the use of a sub routine, which we have to separate out the individual fileds. However, I wonder if an exchange scheme would be more efficient.


thanks

MariaC
27th March 2002, 14:50
Hi,

If you go with the exchange scheme idea then API would probably be the best way.

Whether exchange is the best way to import data depends on the complexity of the import. Do you want to any data validation or conversion before loading into the table? Is it just that one table? Is there not a maintenance session already for this table which you can convert using api?

isimeon
27th March 2002, 17:14
Try this:

wait.and.activate("tuxch0223m000", arg1, ... ,arg9)

Arguments for regular import:
1. exchange scheme from
2. exchange scheme to (optional argument, default is equal to exchange
scheme from)
3. quit on stop condition: 0 = no, 1 = yes (optional argument, default is
no)
4. type of processing: 1 = new run, 2 = restart, 3 = continue (optional
argument, default is new run)
5. import/export company (optional argument for overruling the company
specified in the batch(es), if this argument is not given, the batch
company will not be overruled)

Arguments for regular export are the same, only argument 3 is missing.

Arguments for non-regular import:
1. exchange scheme from
2. exchange scheme to (optional argument, default is equal to exchange
scheme from)
3. batch from (optional argument, default is minimum value)
4. batch to (optional argument, default is equal to batch from)
5. batch sequence number from (optional argument, default is minimum value)
6. batch sequence number to (optional argument, default is equal to batch
sequence number from)
7. quit on stop condition: 0 = no, 1 = yes (optional argument, default is
no)
8. type of processing: 1 = new run, 2 = restart, 3 = continue (optional
argument, default is new run)
9. import/export company (optional argument for overruling the company
specified in the batch(es), if this argument is not given, the batch
company will not be overruled)

Arguments for non-regular export are the same, only argument 7 is missing.

Note:
- If an optional argument is specified, all previous optional arguments
should also be specified.
- 'Wait for <cr> with messages' will be set to no.


After export/import you can check xch tables.