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

LSMW BOM ERROR

Former Member
0 Likes
1,926

HI All,

I am trying to create a LSMW for BOM upload,and I have got this below solution from another post,which is very similar to my requirement,but the main problem is  how to identify which is BOM Header data and which is BOM Item data?In the previous post they are using indicator to seperate the  BOM header and BoM ITem data but this IDENT C(001) should be mapped to which field in the standard structure..plz do reply ...

"""""""""""""""""""

Step 1

Maintian Object attributes

Use standard  Batch / Direct Input

Object               0030   Material BOM

Method               0001   Create

Program Name         RCSBI010

Program Type         B   Batch Input

Step 2

Maintain Source structure

Create BOM Header and create Bom details as a child to Bom Header

should look like this...BOM details is assigned as a child to BOM Header

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Source Structures

        BOM_HEADER               Header Data for Bill of Material

            BOM_DETAILS              Bom details

Step 3

Maintain source fields..

Create a field called "IDENT" field type C and length 1....give value to IDENT in both places

Give IDENT= 1 for header and IDENT=2 for item details

below are sample fields that I used,

compare you screen with following

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Source Fields

        BOM_HEADER                Header Data for Bill of Material

            IDENT                          C(001)    Ident

                                           Identifing Field Content: 1

            WERKS                          C(004)    Plant

            MATNR                          C(018)    Material Number

            STLAL                          C(002)    Alternative BOM

            SPACE1                         C(003)    space1

            BMENG                          C(001)    Base quantity

            STLAN                          C(013)    BOM Usage

            BOM_DETAILS               Bom details

                IDENT                          C(001)    ident

                                               Identifing Field Content: 2

                POSNR                          C(004)    BOM Item Number

                IDNRK                          C(018)    BOM component

                MENGE                          C(013)    Component quantity

                MEINS                          C(003)    Component unit of measure

                AUSCH                          C(005)    Component scrap in percent

                AVOAU                          C(005)    Operation scrap in percent

                SANKA                          C(001)    Indicator for relevancy to costing

                NLFZT                          C(003)    Lead-time offset

                LGORT                          C(004)    Issue location for production order

                POSTP                          C(001)    Item Category (Bill of Material)

                SORTF                          C(010)    Sort String

                REKRS                          C(001)    Indicator: recursiveness allowed

                NETAU                          C(001)    Indicator: Net scrap

                INTRM                          C(018)    Phantom material

Step 4

Maintain source structure as shown below

Just assign BOM header to all structures...

you screen should look like below

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Structure Relations

        BGR00 Batch Input Structure for Session Data                       <<<< BOM_HEADER  Header Data for Bill of Material

              Select Target Structure BGR00 .

            BICSK Batch Input Structure for BOM Header Data                    <<<< BOM_HEADER  Header Data for Bill of Material

                  Select Target Structure BICSK .

                BICSP Batch Input Structure for BOM Item Data                      <<<< BOM_DETAILS Bom details

                      Select Target Structure BICSP .

                BICSU Batch Input Structure for BOM Sub-Item Data

Step 5

Maintain field mapping ..

make sure you maintained transaction CS01

Step 6   Specify files

For BOM header

File &#61664; Point to a text file where you are storing BOM info

File content &#61664;select data for multiple source structures(Seq File)

Select &#61664;tabular

Leave remaining as is.

Check if your screen looks similar to this shown below

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Files

        Legacy Data          On the PC (Frontend)

            Bom header                     C:\bom.txt

                                           Data for Multiple Source Structures (Sequential Files)

                                           Separator Tabulator

                                           Field Order Matches Source Structure Definition

                                           With Record End Indicator (Text File)

                                           Code Page ASCII

        Legacy Data          On the R/3 server (application server)

        Imported Data        File for Imported Data (Application Server)

            Imported Data                  BOM_CREATE.lsmw.read

        Converted Data       File for Converted Data (Application Server)

            Converted Data                 BOM_CREATE1_.lsmw.conv

                                           Logical Path C:\bom.txt

                                           Logical File bom.txt

        Wildcard Value       Value for Wildcard '*' in File Name

Step 7

Assign same file to header and item structure as we are using sequence file

Your screen will look as shown below

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Source Structures and Files

        BOM_HEADER Header Data for Bill of Material

                   Bom header C:\ bom.txt

            BOM_DETAILS Bom details

                        Bom header C:\ bom.txt

Test file format

1     PLT1     Material1     1          1     1                        

2     0010     Comp1          0.198     FT3     0     0     X     0     0020     L    

2     0020     Comp2           0.045     FT3     0     0     X     0     0020     L    

2     0030     Comp3          0.195     FT3     0     0     X     0     0020     L    

1     PLT1     Material2     1          1     1                        

2     0010     Comp1          0.114     FT3     0     0     X     0     0020     L    

1     PLT1     Material3     1          1     1                        

2     0010     Comp1          0.061     FT3     0     0     X     0     0020     L    

     

Here inorder to get this file format…

You might need a query to download this data from your old system if it is an earlier version of SAP

Use CMC logical data base to build your query.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

PLZ reply,

Thanks in advance

HI All,

I am trying to create a LSMW for BOM upload,and I have got this below solution from another post,which is very similar to my requirement,but the main problem is  how to identify which is BOM Header data and which is BOM Item data?In the previous post they are using indicator to seperate the  BOM header and BoM ITem data but this IDENT C(001) should be mapped to which field in the standard structure..plz do reply ...

"""""""""""""""""""

Step 1

Maintian Object attributes

Use standard  Batch / Direct Input

Object               0030   Material BOM

Method               0001   Create

Program Name         RCSBI010

Program Type         B   Batch Input

Step 2

Maintain Source structure

Create BOM Header and create Bom details as a child to Bom Header

should look like this...BOM details is assigned as a child to BOM Header

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Source Structures

        BOM_HEADER               Header Data for Bill of Material

            BOM_DETAILS              Bom details

Step 3

Maintain source fields..

Create a field called "IDENT" field type C and length 1....give value to IDENT in both places

Give IDENT= 1 for header and IDENT=2 for item details

below are sample fields that I used,

compare you screen with following

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Source Fields

        BOM_HEADER                Header Data for Bill of Material

            IDENT                          C(001)    Ident

                                           Identifing Field Content: 1

            WERKS                          C(004)    Plant

            MATNR                          C(018)    Material Number

            STLAL                          C(002)    Alternative BOM

            SPACE1                         C(003)    space1

            BMENG                          C(001)    Base quantity

            STLAN                          C(013)    BOM Usage

            BOM_DETAILS               Bom details

                IDENT                          C(001)    ident

                                               Identifing Field Content: 2

                POSNR                          C(004)    BOM Item Number

                IDNRK                          C(018)    BOM component

                MENGE                          C(013)    Component quantity

                MEINS                          C(003)    Component unit of measure

                AUSCH                          C(005)    Component scrap in percent

                AVOAU                          C(005)    Operation scrap in percent

                SANKA                          C(001)    Indicator for relevancy to costing

                NLFZT                          C(003)    Lead-time offset

                LGORT                          C(004)    Issue location for production order

                POSTP                          C(001)    Item Category (Bill of Material)

                SORTF                          C(010)    Sort String

                REKRS                          C(001)    Indicator: recursiveness allowed

                NETAU                          C(001)    Indicator: Net scrap

                INTRM                          C(018)    Phantom material

Step 4

Maintain source structure as shown below

Just assign BOM header to all structures...

you screen should look like below

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Structure Relations

        BGR00 Batch Input Structure for Session Data                       <<<< BOM_HEADER  Header Data for Bill of Material

              Select Target Structure BGR00 .

            BICSK Batch Input Structure for BOM Header Data                    <<<< BOM_HEADER  Header Data for Bill of Material

                  Select Target Structure BICSK .

                BICSP Batch Input Structure for BOM Item Data                      <<<< BOM_DETAILS Bom details

                      Select Target Structure BICSP .

                BICSU Batch Input Structure for BOM Sub-Item Data

Step 5

Maintain field mapping ..

make sure you maintained transaction CS01

Step 6   Specify files

For BOM header

File &#61664; Point to a text file where you are storing BOM info

File content &#61664;select data for multiple source structures(Seq File)

Select &#61664;tabular

Leave remaining as is.

Check if your screen looks similar to this shown below

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Files

        Legacy Data          On the PC (Frontend)

            Bom header                     C:\bom.txt

                                           Data for Multiple Source Structures (Sequential Files)

                                           Separator Tabulator

                                           Field Order Matches Source Structure Definition

                                           With Record End Indicator (Text File)

                                           Code Page ASCII

        Legacy Data          On the R/3 server (application server)

        Imported Data        File for Imported Data (Application Server)

            Imported Data                  BOM_CREATE.lsmw.read

        Converted Data       File for Converted Data (Application Server)

            Converted Data                 BOM_CREATE1_.lsmw.conv

                                           Logical Path C:\bom.txt

                                           Logical File bom.txt

        Wildcard Value       Value for Wildcard '*' in File Name

Step 7

Assign same file to header and item structure as we are using sequence file

Your screen will look as shown below

BOM_CREATE1 - BOM_CREATE - BOM_CREATE BOM_CREATE1

Source Structures and Files

        BOM_HEADER Header Data for Bill of Material

                   Bom header C:\ bom.txt

            BOM_DETAILS Bom details

                        Bom header C:\ bom.txt

Test file format

1     PLT1     Material1     1          1     1                        

2     0010     Comp1          0.198     FT3     0     0     X     0     0020     L    

2     0020     Comp2           0.045     FT3     0     0     X     0     0020     L    

2     0030     Comp3          0.195     FT3     0     0     X     0     0020     L    

1     PLT1     Material2     1          1     1                        

2     0010     Comp1          0.114     FT3     0     0     X     0     0020     L    

1     PLT1     Material3     1          1     1                        

2     0010     Comp1          0.061     FT3     0     0     X     0     0020     L    

     

Here inorder to get this file format…

You might need a query to download this data from your old system if it is an earlier version of SAP

Use CMC logical data base to build your query.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

PLZ reply,

Thanks in advance

10 REPLIES 10
Read only

Former Member
0 Likes
1,497

Hi

But which is your problem?

Your steps seems to be right

Max

Read only

0 Likes
1,497


we are having two types of data

1)Header data
2)item level data

We will use only one flat file.

and in that flat file we need to use the indicator to seperate those two types of data since both type is having different structure.

so for we are using  IDENT(indicator).the value of  IDENT will be 1 when its header data]
the value of  IDENT will be 2 when its item data.

but in the standard structure there should be a field where we should assign that indicator.

so when its 1 then it will take the value in header structure

when its 2 then it will take the value in item structure.    

Please let me know if you need any more details.

Thanks,

Aritra

Read only

0 Likes
1,497

Hi

No

Your input file structure should have 2 different structure:

- The first for header data

- The second (just a substructure of the first one) for item data

The first field of both strcuture is to indicate the type of record (header and item) and you assign to them the IDENTIF values

This setting has to be done in the step 3..........and I think you've done it correctly.

Now you need to assign the structures of your file to the structures of BI: this is done in the step 4: Maintain Structure Relations..........and I think you've done it correctly.

That's all......after defining the Relations between the structure the LSMW can know which is the record with header and item data.

Max

Read only

0 Likes
1,497

Yes ,I have done as your instruction,but the problem how the LSMW can know that if the indicator is '1' then consider it as header data and if it is '2' then it is item data.

There should be a link in the 5th step.

I have doubt on this.Please help me.

Thanks for your patience.

Aritra.

Read only

0 Likes
1,497

Hi

The LSMW knows:

- if the indicator is 1 then it's record BOM_HEADER and if it's 2 then it's BOM_DETAILS: you've defined it in step 3

- it can filled structures BGR00 and BICSK with data from BOM_HEADER only and BICSP with data from BOM_DETAILS only: you have deined it in step 4

- which fields of BGR00, BICSK and BICSP have to be filled: you have defined it in Mapping section (step 5)

So the LSMW can generate a program in order to fill BI structure correctly, try to run the step to read and see your input file, you should see an output like this;

BOM_HEADER .............................

BOM_DETAILS ............................

BOM_DETAILS ............................

BOM_DETAILS ............................

BOM_DETAILS .............................

BOM_HEADER .............................

BOM_DETAILS ............................

BOM_DETAILS ............................

BOM_DETAILS ............................

BOM_DETAILS .............................

and so

Max


Read only

Former Member
Read only

Former Member
0 Likes
1,497

Hi All,

       The BOMs are getting created successfully.I have taken two structures in the 3rd step,one is for header and one is for item data.I did not mention any indicator,but instead indicator I kept material number and plant common for both structure.I have created two upload file and assigned both files.It is working fine.Thanks all for your support.

Thanks MAX.

Read only

0 Likes
1,497

Hi Aritra,

I have the same doubt as you do..How the LSMW knows to differentiate between Header and Items data based on Identifier Values.

My files:

Header File:

IDLIFNRBUKRSEKORGEKGRPBSARTWAERS
A30000065100P510AUMNBUSD
B1203000P500KBFNBUSD

Item File:

IDEMATNMENGEWERKSEBELP
A7142120711510010
A12819712510020
A7142014013510030
B011020-110500010
B01000109600020

and it creates 2 PO's: one with 3 line items and second one with 2 line items... I didnt map the ID field in Field mapping and conversion Rules step of LSMW. This is for Creating PO's.

Pls help.

Thanks,

Shivakrishna

Read only

0 Likes
1,497

Hi Aritra,

I have the same doubt as you do..How the LSMW knows to differentiate between Header and Items data based on Identifier Values.

My files:

Header File:

IDLIFNRBUKRSEKORGEKGRPBSARTWAERS
A30000065100P510AUMNBUSD
B1203000P500KBFNBUSD

Item File:

IDEMATNMENGEWERKSEBELP
A7142120711510010
A12819712510020
A7142014013510030
B011020-110500010
B01000109600020

and it creates 2 PO's: one with 3 line items and second one with 2 line items... I didnt map the ID field in Field mapping and conversion Rules step of LSMW. This is for Creating PO's.

Pls help.

Thanks,

Shivakrishna

Read only

0 Likes
1,497

Hi Aritra,

I have the same doubt as you do..How the LSMW knows to differentiate between Header and Items data based on Identifier Values.

My files:

Header File:

IDLIFNRBUKRSEKORGEKGRPBSARTWAERS
A30000065100P510AUMNBUSD
B1203000P500KBFNBUSD

Item File:

IDEMATNMENGEWERKSEBELP
A7142120711510010
A12819712510020
A7142014013510030
B011020-110500010
B01000109600020

and it creates 2 PO's: one with 3 line items and second one with 2 line items... I didnt map the ID field in Field mapping and conversion Rules step of LSMW. This is for Creating PO's.

Pls help.

Thanks,

Shivakrishna