Recent Questions

SAPLSMW has aggregated the knowledge gleaned over the course of several careers into an easy-to-use resource for all of the programming community. We do our very best to answer questions and solve problems and we add that to our shared knowledge base whenever we succeed. You're doing us a great favor when you ask us a question or post a problem to be solved, so don't hesitate to ask. No matter is too small, simple, easy or too big, complex or hard for us to handle.

Ask us a question.

Update to RFC_READ_TABLE function

Caio Jordão Calisto
[Email redacted]
Hi Jimbo.

First of all, thanks for all your efforts on maintain and share your knowledge regarding the LSWM and SAP Data connections. I'm writing you, and I don't know if it's too late for that, because recently I use your code to integrate ms access and SAP. This code was found in answer to an anonymous question, where you told that you didn't know if the RFC_READ_TABLE accepts more than one Option (Where condition). In fact, it accepts as part of the same string with the END Clause. So, I've updated your code and that's why i'm here, to share with you this update. Feel free to share in your website, if you want to.

I See two ways to improve this code: First, the login box should appear once allowing the programmer to process different tables without having to login again. And the second One, with the update of SAP GUI, the file SAPLogon.INI (Which is the file from where the login window of VBA pulls the information regarding the systems) is no longer used, and it was replaced by an XML file. I'll try to figure out a way to generate a login box with the updated file, and if I achieve it, i'll share with you.

Best Regards:

LSMW to load sales text with more than 132 characters

I use an LSMW Direct input Object 0001, Method 0001, Program name
The number of characters TEXTLINE in my source fields is defined as 132 Characters, which is the same as /SAPDMC/LTXTL-TEXTLINE the definition of the structure field. We have to load a lot of materials (> 1000) with sales text which have about 50% more then 132 characters.

How to Download Jimbo's VBA Automation Toolbox MS Access File

it is not possible to download the Jimbo's VBA Automation Toolbox.
Could you please advise. Kind Regard from swizerland Guido

Display a report after execution of all the 14/15 steps in LSMW

I have got an urgent requirement in LSMW and it goes like this :
I have created an object for migrating Open Accounts payable items with which after this LSMW execution, LSMW will generate a Document Number(BELNR) internally.
1. I need to capture these document numbers created by SAP and display in a report [like so many documents got created (success records)].
2. This report has to be displayed after all the steps of LSMW are executed.

System_Failure when trying RFC for some SAP tables

I try read some tables by RFC but I got an error message: System_Failure.
Although it works with most tables.
The problem table is AFIH

Best way to read in chinese characters in input file.

Do you have any advice or best practice for uploading chinese character data? There seems to be a myriad of options for codesets and codepages in various places, but which combination works and is considered best practice?
Many Thanks in advance.

LSMW for z transaction

How to use LSMW for a Z transaction? There seems to be an issue because batch input execution doesn't work, values are not transferred.
Thanks and regards,
Gonçalo Levy


Our company is doing a cutover to a new SAP. The system has the potential of being down for 3 to 16 days. I will be recording all of our packaged products. I plan on using Userforms that log all the information in excel sheets for my tech's to use while SAP is down. I know that i have to save the spreadsheets to TXT delimited before trying to use LSMW. My question is there any certain way i need to have the spreadsheet set up as far as format? I have never used LSMW before so it will be a learning experience to say the least. Any other information or direction would be appreciated.

Import a text file as a table in MS Access using VBA

Hi Jimbo,
I see your code to import text files into Access, but please can you put or send me a sample as how to use (Im new in VBA).
This will be very helpfully
Thank you for your help


Old Center Balances to new Cost Center

I am trying to use LSMW to transfer the balance of old cost centers to the new cost centers.
Can this be done with LSMW without any programming?
Our SAP System is ECC 6.0

Thanks in advance,


I am trying to load a text file in to T-code GP12N using LSMW.
I am new to LSMW and do not have ABAP knowhow.

I can create a simple LSMW. However GP12N needs to enter Header data in the initial screen and then further rows of data in the next screen. I can provide more details if required.

I would like to know how to enter data in the second screen where I have a number of rows to enter - how to repeat rows in the second screen before saving and moving back to enter header data again.

Project behaves badly after transport

I have a project that uses RMDATIND for direct input of material master records. My main source structure maps to BGR00, BMM00 and BMMH1. Other structures map to BMMH2, BMMH5 and BMMH6.

I make changes to the project in the development system (DEV) and transport the entire project to the Quality system (QA) for loading the data.

I need to create a Task List operation and then apply a package

I need to create a new task list operation on an existing task list, and then apply the maintenance package to the created operation line.
I can create the recording to select the task list and add the new operation line, but I cannot get it to then select the created line and move to the next step of adding the package.
I have used the code OBSE to select an operation line in other LSMWs I have created, but these rely on the operation number being specified in the loadsheet. In this case, the new operation line number is an known.

How to avoid duplicate customers creation?

1. Using LSMW , XD01
want to test data, before loading with a RADIO button option to user.
a) 'Radio button' TEST -- To test for errors in data file
b) Display Error records in excel file

c) 'Radio button' Create customer
d) Display created records in excel file

2. How to avoid duplicate customers creation -- Internal number range.
e)Say if customer with "ex: check if KNA1-legacy number is existing, then don't commit the data, go to next record.

How to code these requirements in LSMW

How to define "where" clause for RFC_READ_TABLE ?


I'm trying to define a where clause for the RFC_READ_TABLE function like so:


Where KUNNR = "260*" and KTOKD In ("9026","9017").

Could you tell me please where can i define this inside the code ?

Also, is it possible to export the table generated into a text file ? (not to overload the database.)

Thank you.

Would you recommend giving end users access to LSMW?

I have some people in management telling us that we should push out the usage of this transaction to the business users. I disagree as this transaction is very powerful. Can you provide some guidance?


No logon possible (no hw ID received by mssg server)

I'm getting an error when I try to log into MiniSAP 6.2. The "SAP ABAP Engine" is running and I can connect to the server, but I get this error when I enter the user and password. Any help is greatly appreciated.

LSMW with KS02 with valid records


I am trying lsmw for ks02 transaction.
I am using recording method, here i am facing problem while selecting the valid record as of today.

for some cost centers , iam having 2 records and am facing problem in selecting the correct record through lsmw.

request you to help me in acheiving the solution.

Naga Jyothi

How do I find the sncgss32.dll file?

When I attempt to connect to a SAP server the SAPGUI client throws the error below:

Unable to load GSS-API DLL
named "sncgss32.dll"
Error in SNC

The detailed description says:

SNC (Secure Network Communication)
Error 126 = "The specified module could not be found."

How do I get around this? Do I need to download this file?