Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SM30 Issue

Former Member
0 Likes
2,379

Hi all,

Here is my scenario.

Let's assume I am loading 1000 records using LSMW

and I am running this in background mode.

The 500th record, then 657th and so on... record didn't get loaded.

I go to SM35 or SM35P and download the log file to the excel sheet.

But this log file does not contain info like which PERNR[personnel number] or say[material number] failed to get loaded.

It gives a vague information like data for so and so screen not available.

The question is ---is there any way to know which records failed to get loaded based on our Input data. Example.... the PERNR or MATNR and so on.

Warm regards,

Hari Kiran

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
2,219

That is a typical problem with the LSMW and I have solved it like this:

In the data mapping logic, you enter simple ABAP code that does a SELECT SINGLE on the relevant table, e.g. MARA. If the record is found, you fire a SKIP_TRANSACTION. This way, you can run the convert data step again and end up with only those records that were not successfully created yet. You can repeat this over and over until all records have been loaded.

For changing data it is more complicated, you would need to read the entire data and compare with the new data after conversion, skipping transactions where the data is unchanged.

Also, internal numbering can be a problem, but that would exceed the scope here.

Greetings

Thomas

Hi all,

Here is my scenario.

Let's assume I am loading 1000 records using LSMW

and I am running this in background mode.

The 500th record, then 657th and so on... record didn't get loaded.

I go to SM35 or SM35P and download the log file to the excel sheet.

But this log file does not contain info like which PERNR[personnel number] or say[material number] failed to get loaded.

It gives a vague information like data for so and so screen not available.

The question is ---is there any way to know which records failed to get loaded based on our Input data. Example.... the PERNR or MATNR and so on.

Warm regards,

Hari Kiran

15 REPLIES 15
Read only

naimesh_patel
Active Contributor
0 Likes
2,219

The best possible way is to run the session in SM35 again with mode "Errors Only". System will stop at that point and you can correct the error and continue processing for next record.

Regards,

Naimesh Patel

Read only

0 Likes
2,219

Naimesh,

we have been doing that till now.

running it in display errors only.

But if there are many records with errors. we obviously wouldnt want to change them interactively.

We will be running in background mode for sure.

Thank you for replying.

Any further inputs are welcome.

regards,

Hari

Read only

ThomasZloch
Active Contributor
0 Likes
2,220

That is a typical problem with the LSMW and I have solved it like this:

In the data mapping logic, you enter simple ABAP code that does a SELECT SINGLE on the relevant table, e.g. MARA. If the record is found, you fire a SKIP_TRANSACTION. This way, you can run the convert data step again and end up with only those records that were not successfully created yet. You can repeat this over and over until all records have been loaded.

For changing data it is more complicated, you would need to read the entire data and compare with the new data after conversion, skipping transactions where the data is unchanged.

Also, internal numbering can be a problem, but that would exceed the scope here.

Greetings

Thomas

Read only

0 Likes
2,219

Thank you Thomas for the inputs.

Would appreciate if you can throw some more light with few lines of actual code and where to write it.

I am assuming in step," Maintain translation and user defined routines"

Let me know if I am right.

Warm regards,

Hari

Read only

0 Likes
2,219

Hi,

no, this code needs to be added in step "Maintain Field Mapping and Conversion Rules". I would choose field "MATNR" to place code like this:


select count(*) from mara where matnr = source-matnr.
if sy-subrc = 0.
  skip_transaction.
endif.

Greetings

Thomas

Read only

0 Likes
2,219

Thomas ,

Thank you for replying.

I believe the above code will allow me to enter only those records which failed to load previously.

But is there anyway to find out in the log file itself which records or MATNR failed to load. I want to see in the log file...so and so MATNR failed to load.

Lets say 200 MATNR's failed to load. I would obviuosly want to rectify the errors somewhere and then run the session again with only these 200 rectified records.

Hope you are getting my point.

Once again thank you for answering,

Warm regards,

Hari Kiran

Read only

0 Likes
2,219

> But is there anyway to find out in the log file itself which records or MATNR failed to load. I want to see in the log file...so and so MATNR failed to load.

not possible, I'm afraid, you have to work with the messages that the application sends.

> Lets say 200 MATNR's failed to load. I would obviuosly want to rectify the errors somewhere and then run the session again with only these 200 rectified records.

that's exactly where my idea above is aiming at. You run the "convert data" step again with a new input file, it will only process records that were not loaded previously. The new session will also contain only those records. You run that, if there is still errors, you start over with "convert data" until everything is done.

If this is still not what you want, then I am officially retiring from this discussion.

Thomas

Read only

0 Likes
2,219

Thank you for answering Thomas,

But how do I know in the first place which MATNR failed to load.

Only when I know that so and so MATNR failed to load will I be able to prepare a new flat file with the rectified records and then run the script you have written.

Ain't I right about this ?

Warmr egards,

Hari Kiran

Read only

0 Likes
2,219

do "convert data" with the same file as before, only the failed ones will be in the converted data file. Don't create a session yet. Display the converted data, there is your list of failed MATNRs.

Read only

0 Likes
2,219

Thomas,

You are right.

That will solve the issue. That's good enough.

I am closing the thread.

Thank you for answering.

Warm regards,

Hari Kiran

Read only

Former Member
0 Likes
2,219

The problem is that some screen field or screen has been missed,,, Please note that some transactions have Different screen sequence for different value inputs.. FOr Example in QP01... If you select Quantitative field the sequence of screens and screen no's are diff from that of Qualitative field.. Though the screen may look similar at points.

Please do a proper re-recording to find any such changes...

Hope this idea will help you...

Regards

Vijay

Read only

0 Likes
2,219

Hi Vijay,

Thank you for answering.

There is nothing wrong with the recording.

we have been loading around 2000 employee records for each infotype through PA30 transaction code.

What I am saying is that the Log file doesnot show which PERNR[ Personnel number or Employee number ] failed to load.

It does tell us that so and so row number failed to load. But it does not tell us which PERNR failed to load.

Inputs please.

Regards,

Hari Kiran

Read only

0 Likes
2,219

Hi Hari,

I understand the Error.. This error will not show you the PERNR for which the error has occurred..

This error occurs only when the BDC does not find the corresponding field on the next logical screen..

Regards

VIjay

Read only

Former Member
0 Likes
2,219

Gave the wrong guy the points

Read only

0 Likes
2,219

happy to help if I can

Cheers

Thomas