cancel
Showing results for 
Search instead for 
Did you mean: 

Inspection plan LSMW issue

Former Member
0 Kudos

Hi All,

I am trying to create LSMW for inspection plan using standard batch input object: 0240 method: 0000

i have created 3 structure and assigned fields accordingly:

i have taken MATNR as a common field in first two structure but at the time of field mapping, in BIPPO i am not getting any field for MATNR. So what could be a connection between all three structure, because i can not use group counter a common field since this is internal number assignment.

Please provide your suggestions on the same.

Accepted Solutions (1)

Accepted Solutions (1)

former_member198406
Contributor
0 Kudos

Hi Nikhil,

I suggest you to add one more field "Record No" in each of the structure instead of using any other available fields. I have used this LSMW successfully many times.

Regards,

Dipeshkumar Bhavsar

Former Member
0 Kudos

Hi Dipesh,

Which field will be mapped to "Record No"?

former_member198406
Contributor
0 Kudos

Hi Nikhil,

it is not mandatory to map every structure field in LSMW. You can have extra field for identification of record numbers.

In this case the Header structure have one line, Operation structure may have one or more line and Characteristics structure will have one or more line for an inspection plan. So, when you read and convert the data for multiple inspection plan, the system need to identify the record for each and every structure (you may be uploading multiple inspection plan for the same material) and an additional common field in every structure does that job without mapping.

I hope it can help you.

Regards,

Dipeshkumar Bhavsar

former_member198406
Contributor
0 Kudos

Hi Nikhil,

Give it a try, and let me know if you face any difficulty.

Regards,

Dipeshkumar Bhavsar

Former Member
0 Kudos

Hi Dinesh,

i have tried your way but in the display data step i am able to see just header not operation and MIC values...

If worked for you then can you please provide the details is possible.

former_member42743
Active Contributor
0 Kudos

I beleive if I remember, the key to this is that you must sort and order the records properly.  What Arijit and Dipesh are suggesting is that in your EXCEL sheet where you maintain the data, you add one or more column of your own that links the various records.  Once you have the records in order you copy the sheet to a new file and delete your sorting columns so the structure matches what SAP expects.

So in your working file you'll have

1001 1 A BI000 ......

1001 1 B BIPKO ...

1001 1 C BIPMK ...

1001 1 C BIPMK ...

1001 1 C BIPMK ...

1001 1 D BIMPL ...

1001 1 D BIMPL ...

1001 1 D BIMPL ...

1001 1 D BIMPL ...

1001 2 A BI000 ......

1001 2 B BIPKO ...

1001 2 C BIPMK ...

1001 2 D BIMPL ...

1002 1 A BI000 ......

1002 1 B BIPKO ...

1002 1 C BIPMK ...

1002 1 D BIMPL ...

Once this structure is sorted by the first 3 columns, you copy the excel file to a new file, delete the first three columns and import that to the LSMW.

Craig

busyaban7
Active Contributor
0 Kudos

Craig has just explained you exactly what is the process SAP expects and you should sort the data before you can try for the upload. That should work for sure.

As many of us keep searching SCN for additional help, I thought of sharing a few more execution level issues you may face and the ways to handle those cases -

a) The LSMW structure relationship is perfect for your case. Only one thing is missing here is the unique identifier for all the three structures, against you wish to upload data. So you can try to add one common field called "Record No" or "Serial No." or "GrP-GrC" at the end of each structure. Basically this will serve as the unique link between all the three upload files and SAP will be able to understand which is the one it is processing now. Else, SAP will try to dump all Operations, MIC, and everything form your upload files in a new group counter you are trying to create using the Direct input program.

b) Also note that the best approach here is to create a Query first by joining the SAP tables in the said order MAPL+PLKO+PLAS+PLPO+PLMK. This will give you a straight forward link between the tables, and then you can create three files you need to upload in your LSMW.

c) Once you prepare the files, make three separate files - Header, MIC, Operation. As your query will give you same record multiple times for each GrP-GrC combination, based on number of MIC's in PLMK, you need to take the unique entries forward for the files - Header and Operation.

d) For the file MIC - the number of records will be more for the same GrP-GrC. Reason being, there are multiple MIC's in your operation. If there are multiple operations for your inspection plan, then you need to include the field "Operation/Activity No" [VORNR] in the two structures - Operation & MIC. So that for the same GrP-GrC combination you can upload operation 0010 and 0020 data uniquely, and they will not be dumped under a single operation.

e) Now one more important point - Once you prepare the file for MIC, you need to SORT the file based on this sequence -

i) First select all the records for the total MIC file, and then sort based on the GrP-GrC.

ii) After this sorting, sort the file again based on the "MIC position Number" [MERKNR].

After these two exercise in excel, you will get the file in this preferred order where - MIC postion is also sorted like 0010, 0020, 0030, 0040 and not like 0010, 0020, 0040, 0030. If that would have been the case, then direct input program will check the position at 30 and upload the inspection details for 0040 and then at position 40, it will try to upload the inspection details for 0030. As 0040 is already created before, it will not allow to create the MIC position 0030 now in this order and it's going to fail! Please remember this point while you execute the case.

Thanks,

Arijit

Message was edited by: Arijit Banerjee

former_member198406
Contributor
0 Kudos

Hi Nikhil,

Please refer the below screenshots and an text file for the uploading template (unfortunately unable to attach the excel file) (you just open these text files in excel and save as excel)

important field mapping

You need to put data first in the excel file then sort the same using the record no field. Then you need to copy the content of each sheet to each file. then try to read the data. I have kept the record number field in the file and the system has read the same and it looks like as below.

I hope this can help you a lot. I could have downloaded the LSMW and attached for your help. But, I have done some ABAP coding within the LSMW to suit my client's need and that I don't want to share. So, If you still find an issue do let us know. We are happy to help you.

Regards,

Dipeshkumar Bhavasr

Former Member
0 Kudos

Thanks you so much all for your kind help i have created the LSMW and processed successfully with out any error but when i checked plan through QP03 it is only displaying header details and operation and MICs are not created, but at time display converted data LSMW was showing each details (Header, Operation and MIC)

former_member198406
Contributor
0 Kudos

Hi Nikhil,

did you run the LSMW in background mode?

Regards,

Dipeshkumar Bhavsar

Former Member
0 Kudos

Yes, i have run this in Back ground mode, also tried in Foreground and found out it is not going in Operation screen.

busyaban7
Active Contributor
0 Kudos

As you already have set the structure relationship correctly, so the data you are trying to upload, is getting displayed, so no issues there. Please can you check if Field mapping and/or conversion rules are rightly setup for your case. May be you can take some help from your ABAP colleague to check this part too.

Former Member
0 Kudos

Thanks everybody for your guidance, it is working for me now.

Answers (3)

Answers (3)

busyaban7
Active Contributor

As Dipesh suggested, you should try using Inspection Plan Group & GrC combination in all the three structures (PLNNR-PLNAL), so that it will have unique link to create the inspection plan using the SAP batch input program -  RCPTRA01, object - 0240, Method - 0000.

Louis-Nicolas
Participant
0 Kudos

I agree with Craig.

Define your LSMW based on the Bapi BUS1191 and Idoc Basic Type  INSPECTIONPLAN_CREATE02

Then you just have to populate properly the input structured file. not easy task but feasible.

former_member42743
Active Contributor
0 Kudos

Is this an LSMW you wrote or are you using the standard one that SAP provides?

Why reinvent the wheel?

Craig