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.
The
InputScript CreateMaterialFile.txt looks like this:
GuiXT
// Create material file
Parameter mat_file1 "C:\GuiXT\Input.txt"
Parameter mat_file2 "C:\GuiXT\Output.txt"
// Start
Screen SAPLMGMM.0060
OpenFile "&U[mat_file1]"
OpenFile "&U[mat_file2]" -Output
label Read_File
ReadFile "&U[mat_file1]" mat_matnr
if not Q[ok]
CloseFile "&U[mat_file1]"
CloseFile "&U[mat_file2]"
Return "Material file generated" "&U[mat_file2]"
endif
Set F[Material] "&V[mat_matnr]"
Enter
// Select view
Screen SAPLMGMM.0070
Set C[Basic Data 1] "X"
Enter
// Basic data 1
Screen SAPLMGMM.4000
Set V[mat_division] "&F[Division]"
Set V[mat_matgroup] "&F[Material group]"
Set V[mat_autgroup] "&F[Authorization group]"
AppendFile "&U[mat_file2]" mat_matnr mat_division mat_matgroup mat_autgroup
Enter "/NMM03"
// MM03 Start again, goto beginning of script
Screen SAPLMGMM.0060
goto Read_File
Example 2
Let's assume that we have a
text file with data representing GL documents. We want to post
these documents in SAP using transaction FB01. If an error message
occurs during one of these SAP transactions, we put the error message
into a log file, together with some data .