Florentin Ganea · 23.10.2026 · 9 minute de citit
Răspunsul scurt: poți încărca în SAP comenzi de vânzare, de achiziție, transferuri și ieșiri de stoc direct din Excel, cu SAP GUI Scripting, componenta de înregistrare a acțiunilor inclusă în SAP GUI. Înregistrezi tranzacția o dată, legi câmpurile de rândurile din Excel și rulezi. O comandă care îți ia 1–10 minute de mână intră în 3–15 secunde.
Am lucrat peste 20 de ani în operațiuni și am văzut aceeași scenă în multe firme cu SAP: oameni buni, plătiți să gândească, care copiază toată ziua valori dintr-un Excel într-un ecran SAP. Primele scripturi le-am înregistrat pentru mine, ca să scap de aceeași muncă. Articolul îți arată cum funcționează, ce poate merge prost și când merită să plătești un add-on în loc să-ți construiești scripturile.
La un distribuitor, „introducere de mână” înseamnă de obicei patru fluxuri care se repetă zilnic:
O comandă simplă, cu câteva linii, se introduce într-un minut. Una cu zeci de linii, condiții speciale și verificări de disponibilitate ajunge la 10 minute. Calculul de mai jos e ilustrativ, făcut din aceste intervale, nu dintr-un client anume.
| 100 de comenzi pe zi | Calcul | Timp pe zi |
|---|---|---|
| De mână, comenzi simple | 100 × 1 minut | 1 h 40 min |
| De mână, comenzi complexe | 100 × 10 minute | aproape 17 ore |
| Cu script, comenzi simple | 100 × 3 secunde | 5 minute |
| Cu script, comenzi complexe | 100 × 15 secunde | 25 de minute |
Timpul e doar jumătate din cost. Cealaltă jumătate sunt greșelile de tastare: un cod de articol cu o cifră schimbată, o cantitate cu un zero în plus, un depozit greșit. Fiecare se descoperă mai târziu, la livrare, la factură sau la inventar, și costă mai mult de corectat decât a costat de introdus. Un script ia valorile exact cum sunt în fișier. Dacă fișierul e corect, documentul e corect.
Pe înțelesul oricui: SAP GUI, programul cu care oamenii tăi intră în SAP pe Windows, are încorporat un „reportofon”. Îl pornești, faci o dată tranzacția ca de obicei, îl oprești, iar el a scris într-un fișier tot ce ai făcut: ce câmp ai completat, cu ce valoare, ce buton ai apăsat. Fișierul se poate reda oricând, iar dacă în loc de valorile fixe îi dai rândurile dintr-un Excel, introduce câte documente are fișierul.
Nu e un program cumpărat de la terți și nu e un robot care „se uită” la ecran. E o interfață oficială a SAP, inclusă în SAP GUI for Windows, deci nu plătești licență în plus. E oprită implicit, iar firma decide dacă o pornește.
Pentru IT. Pe server, scripting-ul se activează cu parametrul de profil sapgui/user_scripting = TRUE
(dinamic din RZ11, permanent din profilul instanței). Parametrii înrudiți permit restricții: sapgui/user_scripting_per_user
îl limitează la utilizatorii cu autorizare dedicată, sapgui/user_scripting_set_readonly permite doar citire,
sapgui/user_scripting_disable_recording blochează înregistrarea. Pe client, se bifează „Enable scripting” în opțiunile SAP GUI,
la Accessibility & Scripting, unde poți cere și o notificare când un script se atașează la sesiune. Înregistrarea produce un fișier .vbs
care adresează fiecare element prin ID (de exemplu wnd[0]/usr/ctxtVBAK-AUART). Același obiect de scripting se poate apela din
VBA în Excel sau din Python, prin pywin32.
Exemplul e pe VA01, dar pașii sunt aceiași pentru orice tranzacție.
| Pas | Ce faci | Ce poate merge prost |
|---|---|---|
| Înregistrare | O comandă completă, de la capăt la salvare | Ai sărit un câmp sau un ecran care apare doar uneori, iar scriptul nu știe de el |
| Parametrizare | Valorile fixe devin coloane din Excel | Formatul din Excel nu e cel așteptat de SAP: zecimale, date, zerouri din fața codurilor |
| Linii multiple | Bucla pe liniile comenzii | Tabelul de linii are un număr fix de rânduri vizibile; după ele trebuie derulat |
| Validare | Verifici fișierul înainte de rulare | Un cod de client sau de articol inexistent oprește scriptul la jumătatea comenzii |
| Test | 10 rânduri, documentele verificate de om | Testezi numai pe cazuri simple și ratezi pe cele cu ferestre suplimentare |
| Rulare și jurnal | Numărul documentului sau eroarea, pe fiecare rând | Fără jurnal, la o oprire nu știi ce a intrat și reintroduci dubluri |
Jurnalul e partea pe care cei mai mulți o sar și pe care o regretă primii. Scrie-l în același Excel, într-o coloană nouă: dacă rularea se oprește la rândul 63, reiei de la 64, fără dubluri.
Acestea sunt cele patru pe care le-am automatizat. Timpii sunt cei măsurați: 1–10 minute de mână, 3–15 secunde cu script, după complexitatea documentului.
| Tranzacție | Document | De unde vin datele de obicei | De mână | Cu script | Capcane specifice |
|---|---|---|---|---|---|
| VA01 | Comandă de vânzare | Excel sau e-mail de la client, export din portalul clientului | 1–10 min | 3–15 s | Verificarea disponibilității deschide un ecran separat când nu ai stoc; prețul nedeterminat face documentul incomplet și SAP întreabă la salvare |
| ME21N | Comandă de achiziție | Calculul de reaprovizionare din Excel | 1–10 min | 3–15 s | Furnizorul și condițiile (preț, termen) trebuie să existe în înregistrarea info; ecranul are zone care se pot închide sau deschide și schimbă ID-urile |
| MB1B | Transfer de stoc | Lista de echilibrare între depozite | 1–10 min | 3–15 s | Tipul de mișcare corect (între depozite, între centre); depozitul sursă și cel de destinație inversate trec fără eroare |
| MB1A | Ieșire de marfă | Lista de consumuri, casări, mostre | 1–10 min | 3–15 s | Centrul de cost obligatoriu la anumite tipuri de mișcare; lotul, la articolele gestionate pe loturi |
Regula generală: scriptul nu greșește valorile, dar se poate bloca la ferestrele care apar doar uneori. De aceea testul pe 10 rânduri trebuie să includă și cazurile urâte: un articol fără stoc, un furnizor fără condiții, un articol pe loturi.
Nu e singura cale. Pe piață există add-on-uri făcute exact pentru asta, cum sunt Innowera Process Runner și Winshuttle, iar SAP are propriile unelte de încărcare. Fiecare are locul ei.
| SAP GUI Scripting | Add-on comercial (Innowera, Winshuttle) | LSMW sau BAPI | |
|---|---|---|---|
| Cost de licență | Inclus în SAP GUI | Licență pe utilizator, preț la cerere | Inclus în SAP |
| Cine îl construiește | Cineva care știe VBA sau Python și procesul | Utilizatorul-cheie, cu interfață fără cod | Consultant ABAP sau basis |
| Suport | Al tău sau al celui care l-a făcut | Al furnizorului | Echipa SAP internă sau partenerul |
| Robustețe la schimbări de ecran | Scăzută: se reînregistrează | Medie, depinde de modul de lucru | Mare: BAPI nu depinde de ecran |
| Când merită | Câteva tranzacții, volume de zeci-sute pe zi, cineva tehnic în casă | Multe tranzacții, mulți utilizatori, fără cineva tehnic | Volume foarte mari, integrare permanentă cu alt sistem |
Add-on-urile nu sunt o risipă. Dacă ai 20 de utilizatori care încarcă zeci de tipuri de documente și nimeni în firmă nu scrie cod, licența se plătește din timpul economisit, iar suportul furnizorului contează. Dacă ai patru tranzacții și un om care se descurcă în Excel cu macro-uri, scripturile proprii fac aceeași treabă fără cost recurent. Iar dacă documentele vin zilnic dintr-un alt sistem, nu dintr-un Excel completat de om, o integrare prin BAPI cu IT-ul e soluția corectă pe termen lung.
Ce automatizăm concret și cum lucrăm găsești pe pagina de automatizări.
Nu. Scripting-ul face parte din SAP GUI for Windows, pe care îl ai deja instalat, și se activează din setări, pe server și pe calculatorul utilizatorului. Scriptul lucrează prin utilizatorul SAP al omului conectat, cu licența lui. Costă doar timpul de construit și de întreținut scripturile.
Da. SAP GUI Scripting e o interfață livrată și documentată de SAP, nu un artificiu. Tocmai de aceea e oprită implicit: firma decide, prin parametrii de pe server, dacă o pornește, pentru cine și dacă utilizatorul e anunțat când un script preia sesiunea. Decizia e a IT-ului vostru, cu politica voastră de securitate.
Pe S/4HANA merge, atât timp cât lucrezi în SAP GUI for Windows, la fel ca pe ECC. Atenție doar că unele tranzacții vechi, cum sunt MB1A și MB1B, nu mai există în S/4HANA, iar mișcările de stoc se fac din MIGO, deci scriptul se înregistrează pe MIGO. Aplicațiile Fiori rulează în browser și nu au GUI Scripting; acolo e altă abordare, de obicei prin interfețele OData sau BAPI, cu IT-ul.
Da, și e bine să fie implicat din prima zi. Ei activează parametrul pe server, decid pentru ce utilizatori, verifică drepturile și îți dau acces la un client de test. Cele mai multe obiecții dispar când văd că scriptul nu ocolește nicio autorizare și că fiecare rulare lasă un jurnal cu numerele de document.
Pentru o singură tranzacție cu un fișier Excel stabil, câteva zile: înregistrarea, legarea de Excel, validările, testul pe 10 rânduri și jurnalul. Cel mai mult durează, de obicei, activarea scripting-ului și accesul la mediul de test, deci cere-le din prima zi. Fiecare tranzacție în plus merge mai repede, pentru că validarea și jurnalul se refolosesc.
Spune-ne ce tranzacții introduceți de mână și cam câte documente pe zi. În 24h îți răspundem dacă se pot automatiza și cât timp eliberezi.
Florentin Ganea · 23.10.2026 · 9 min read
The short answer: you can load sales orders, purchase orders, stock transfers and goods issues into SAP straight from Excel with SAP GUI Scripting, the action-recording component included in SAP GUI. You record the transaction once, link the fields to the rows in Excel and run it. An order that takes you 1 to 10 minutes by hand goes in within 3 to 15 seconds.
I've spent more than 20 years in operations, and I've seen the same scene at many companies running SAP: good people, paid to think, copying values from an Excel file into an SAP screen all day. I recorded the first scripts for myself, to get rid of that same work. This article shows you how it works, what can go wrong and when it's worth paying for an add-on instead of building your own scripts.
At a distributor, "manual entry" usually means four flows that repeat every day:
A simple order with a few lines takes a minute to enter. One with dozens of lines, special conditions and availability checks gets to 10 minutes. The calculation below is illustrative, built from these ranges, not from a specific client.
| 100 orders a day | Calculation | Time per day |
|---|---|---|
| By hand, simple orders | 100 × 1 minute | 1 h 40 min |
| By hand, complex orders | 100 × 10 minutes | almost 17 hours |
| With a script, simple orders | 100 × 3 seconds | 5 minutes |
| With a script, complex orders | 100 × 15 seconds | 25 minutes |
Time is only half the cost. The other half is typing mistakes: an item code with one digit swapped, a quantity with an extra zero, the wrong warehouse. Each one is discovered later, at delivery, at invoicing or at the stock count, and costs more to fix than it cost to enter. A script takes the values exactly as they are in the file. If the file is right, the document is right.
In plain terms: SAP GUI, the program your people use to log into SAP on Windows, has a built-in "tape recorder". You start it, do the transaction once as usual, stop it, and it has written to a file everything you did: which field you filled, with what value, which button you pressed. The file can be played back at any time, and if you give it the rows of an Excel file instead of the fixed values, it enters as many documents as the file has.
It isn't third-party software and it isn't a robot "looking" at the screen. It's an official SAP interface, included in SAP GUI for Windows, so you pay no extra licence. It's off by default, and the company decides whether to switch it on.
For IT. On the server, scripting is enabled with the profile parameter sapgui/user_scripting = TRUE
(dynamically in RZ11, permanently in the instance profile). Related parameters allow restrictions: sapgui/user_scripting_per_user
limits it to users with a dedicated authorisation, sapgui/user_scripting_set_readonly allows read-only access,
sapgui/user_scripting_disable_recording blocks recording. On the client, you tick "Enable scripting" in the SAP GUI options,
under Accessibility & Scripting, where you can also ask for a notification when a script attaches to the session. Recording produces a .vbs
file that addresses each element by ID (for example wnd[0]/usr/ctxtVBAK-AUART). The same scripting object can be called from
VBA in Excel or from Python, through pywin32.
The example is on VA01, but the steps are the same for any transaction.
| Step | What you do | What can go wrong |
|---|---|---|
| Recording | One complete order, from start to save | You skipped a field or a screen that only appears sometimes, and the script doesn't know about it |
| Parameters | Fixed values become Excel columns | The Excel format isn't what SAP expects: decimals, dates, leading zeros on codes |
| Multiple lines | The loop over the order lines | The line table shows a fixed number of visible rows; beyond them you have to scroll |
| Checks | You check the file before running | A customer or item code that doesn't exist stops the script halfway through an order |
| Test | 10 rows, documents checked by a person | You test only simple cases and miss the ones with extra windows |
| Run and log | Document number or error, for every row | Without a log, when it stops you don't know what went in and you enter duplicates |
The log is the part most people skip and the first one they regret skipping. Write it in the same Excel file, in a new column: if the run stops at row 63, you restart from 64, with no duplicates.
These are the four I've automated. The times are the measured ones: 1 to 10 minutes by hand, 3 to 15 seconds with a script, depending on how complex the document is.
| Transaction | Document | Where the data usually comes from | By hand | With a script | Specific traps |
|---|---|---|---|---|---|
| VA01 | Sales order | Excel or email from the customer, export from the customer's portal | 1 to 10 min | 3 to 15 s | The availability check opens a separate screen when you're out of stock; a price that isn't determined makes the document incomplete and SAP asks at save |
| ME21N | Purchase order | The replenishment calculation in Excel | 1 to 10 min | 3 to 15 s | The supplier and conditions (price, lead time) must exist in the info record; the screen has areas that can be collapsed or expanded, which changes the IDs |
| MB1B | Stock transfer | The rebalancing list between warehouses | 1 to 10 min | 3 to 15 s | The right movement type (between storage locations, between plants); source and destination swapped go through without an error |
| MB1A | Goods issue | The list of consumption, write-offs, samples | 1 to 10 min | 3 to 15 s | A mandatory cost centre for some movement types; the batch, for batch-managed items |
The general rule: the script doesn't get the values wrong, but it can get stuck on windows that only appear sometimes. That's why the 10-row test must include the awkward cases: an item out of stock, a supplier with no conditions, a batch-managed item.
It isn't the only way. There are add-ons built for exactly this, such as Innowera Process Runner and Winshuttle, and SAP has its own loading tools. Each has its place.
| SAP GUI Scripting | Commercial add-on (Innowera, Winshuttle) | LSMW or BAPI | |
|---|---|---|---|
| Licence cost | Included in SAP GUI | Per-user licence, price on request | Included in SAP |
| Who builds it | Someone who knows VBA or Python and the process | The key user, with a no-code interface | An ABAP or basis consultant |
| Support | Yours, or whoever built it | The vendor's | The internal SAP team or the partner |
| Robustness to screen changes | Low: you re-record | Medium, depends on how it works | High: a BAPI doesn't depend on the screen |
| When it's worth it | A few transactions, tens to hundreds a day, someone technical in-house | Many transactions, many users, nobody technical | Very high volumes, permanent integration with another system |
Add-ons aren't a waste. If you have 20 users loading dozens of document types and nobody in the company writes code, the licence pays for itself in time saved, and vendor support matters. If you have four transactions and one person who's comfortable with Excel macros, your own scripts do the same job with no recurring cost. And if documents arrive daily from another system rather than from an Excel file filled in by a person, a BAPI integration with IT is the right long-term solution.
What we automate in practice and how we work is on the automation page.
No. Scripting is part of SAP GUI for Windows, which you already have installed, and it is switched on in the settings, on the server and on the user's computer. The script works through the SAP user of the person logged in, with their licence. The only cost is the time to build and maintain the scripts.
Yes. SAP GUI Scripting is an interface delivered and documented by SAP, not a hack. That is exactly why it is off by default: the company decides, through server parameters, whether to switch it on, for whom, and whether the user is notified when a script takes over the session. The decision belongs to your IT team, under your security policy.
On S/4HANA it works, as long as you work in SAP GUI for Windows, the same as on ECC. Just note that some older transactions, such as MB1A and MB1B, no longer exist in S/4HANA, and stock movements are posted in MIGO, so the script is recorded on MIGO. Fiori apps run in the browser and have no GUI Scripting; there it's a different approach, usually through OData or BAPI interfaces, with IT.
Yes, and it's better to involve them from day one. They switch on the server parameter, decide which users get it, check the authorisations and give you access to a test client. Most objections disappear once they see the script doesn't bypass any authorisation and every run leaves a log with the document numbers.
For a single transaction with a stable Excel file, a few days: the recording, linking it to Excel, the checks, the 10-row test and the log. What usually takes longest is getting scripting switched on and access to the test environment, so ask for both on day one. Each additional transaction goes faster, because the checks and the log are reused.
Tell us which transactions you enter by hand and roughly how many documents a day. Within 24 hours we'll tell you whether they can be automated and how much time you free up.