Loading historical data into SAP using LSMW - writing a “macro”

Good afternoon!

I continue the instructions for using LSMW - Data Transfer Systems from Historical Systems.

In the last post, I looked at the method of loading data using standard (pre-configured to create a loading project) objects. This time I want to consider a method, in which we, as it were, record the sequence of our actions with the transaction, after which we map fields with the fields of the prepared template file. You can also record a sequence of actions in which we do not load data from a template file, for example, a sequential change of statuses, switching between screens, etc.

Read the previous instructions until step 1.

Now, at step # 1, we must select the Batch Input Recording item and go to the record manager by pressing the "Mountains, Sun" button.



Create a record.




Having selected the transaction for which we want to record a “macro” (in my case, it is ie02 “Change of Equipment Unit”), we are faced with, in fact, the corresponding. transaction We select the number of EO, go to the initial screen.

Suppose I need to change the "Inventory number". I drive in acc. field some value (I have a "habranomer"), press Enter (check if some error pops up; maybe the format of the field is numerical, but I forgot about it). No errors, the new inventory is accepted.



Suppose I also want to change the name of the “Premises” on the “Location” tab. I go to this tab, drive a value into the "Room" field (I have "Shop No. 3").



Enough for an example. I press "SAVE". And here the system shows me the following screen:



On it we see screens and fields on them, which I saw during the recording of the "macro".

SAPMIEQ0 0100 - this is the first screen where I drove the EO number into the card of which I later failed. The EO number now stands on the white-highlighted area, and the reddish area is empty. Double-click on the red area.

“Default value” is cleared; there stood the default EO number. And we do not need the default. We need to feed a bunch of different SW from the template file from the template file. In the first field “Name” we write EQUNR - the technical name of the field EO (we see it just above, in the “Field Name”). In the second field “Name” we write some name of the field “for myself”, for example, “Number EO” or repeat the technical name of the field.



We do the same with the rest of the fields that we feed the program to enter. If we need, say, in all SWs to change the value in some field to a value that is the same for everyone, then in this case we just use the Default value so as not to submit it N times in the file template.

Remember when I entered "Habranomer" in the "Inventory number" field, I pressed Enter? So because of this, I got another copy of the SAPMIEQ0 0101 sub-screen (this is the main screen of the SW, the first tab is “General”). Here I no longer need to re-designate the field names, so we just need to erase the fields that are on the duplicate screen. To do this, position ourselves on the field, press the button indicated on the screen:



So we prescribe the correspondence of the fields where necessary, and where not needed - delete from the screen. Also, for example, we delete the “Name for EO” field on the set of screens on which it appears again and again after switching to another bookmark. In other words, the names of the EO (if we need to change it by submitting it in the template) - the ITOB-SHTXT fields (I have its “Habratest” value) - we just need to indicate once, on the first of the sub-screens SAPMIEQ0 0101. In the final analysis, we save everything.

We have a record:



... which we select on the first screen of the first step:



Actually, all subsequent steps are similar to the steps of the previous instruction . Good luck!

Also popular now: