|
There are a number of useful things that you can do with files in an InputScript:
This method works well for any number of records in the file. For performance reasons it might be preferable to choose other approaches (batch input, ABAP programs) for a very large amount of data. We suggest you measure the runtime first if several thousand records or more have to be entered. |
Overview We use the following InputAssistant features (see the keyword documentation for further details):
|
Example 1
Let’s assume that we have a text file with material numbers. We want to produce a second file containing the material number together with the division, material group and authorization group for each material. First we need a place where we can start the script, for example the basic R/3 menu: MENUS00.E0040.txt: The InputScript CreateMaterialFile.txt looks like this: // Create material file (Example for R/3 Rel. 4.5) label Read_File if not V[mat_matnr] Set F[Material] “&V[mat_matnr]“ AppendFile “&[mat_file2]” mat_matnr mat_division mat_matgroup mat_autgroup
Enter “/NMM03″
The runtime for 100 material numbers was 67 seconds in our test system (central system on a PC with 266 MHz Pentium and 256 MB RAM) .
Example 2 Let’s assume that we have a text file with data representing GL documents. We want to post these documents in R/3 using transaction FB01. If an error message occurs during one of these R/3 transactions, we put the error message into a log file, together with some data . MENUS00.E0040.txt: The InputScript FB01_GL.txt appears as follows: // File names Set V[FB01_errors] 0 Screen SAPMF05A.0100
label start
ReadFile “-StripQuotationMarks” “&[FB01FILE]” s_date s_text s_pstky1 s_account1 s_amount1 s_pstky2 s_accoun Set F[Document date] &[s_date] Set F[Pstky] &[s_bschl1] Enter OnError=”/NFB01″
else
if V[FB01_errors=0] Return “Processing done: &[FB01_errors] errors, &[FB01_records] documents in total” Screen SAPMF05A.0300 Enter OnError=”/NFB01″
Screen SAPMF05A.0300 Screen SAPMF05A.0100 The input file FB01_data.txt could appear as follows: 01122000;”GL text1″;40;113100;100;50;113101;100 |