BOM status

In bom header there is a field called as bom status, which is being used in case of mulitple bom inorder to make a particular bom active or inactive. In this field there is an option called as "active with history requirment", what is the use of this option.
RAJ

Hi Raj,
BOM status 3-Active with history requiremet means, changes done to BOM has to come through a Change number geerated in Engineering change management.
If the customization for the plant is ot active for history requirement, you can set a perticular material alone under change management purview by keeping the header status to 3.
By which whenever you chage the BOM of the header material, system throws a aring message saying , this BOM has history requiment indicator set, please enter change number.
Hope this helps...!
Regards,
Shashi

Similar Messages

  • Issue with BOM Status in MRP Run

    Dear All,
    I have a BOM structure and BOM status as attached below.
    In this case, system is generating the PR's for all three components correctly while i run MRP (MD51). But when i convert planned order to production order for "Assembly" & "BOM", it is coping the components for Assembly correctly but not for "BOM".
    If i maintain the BOM status as "4" for "BOM", then the components are copied into Production Order but i am getting double PR's as the BOM is exploding two times.
    As per my requirement BOM should be exploded only one time ie. for "Assembly" and component should be come in Planned order for "BOM".
    Please tell me where is the problem..
    Regards,
    Rao

    Dear Rao,
    assembly and Bom have the same type of production order?
    In the production order type which application is contained? PP01?
    You should check the explosion setting in the profile order and the setting of application of the Bom.
    if you can send me screen shot of the planned order of the Bom (components details).
    Thanks
    Daniele 

  • BOM Display in CS11/CS12 with BOM status "3"

    Hi,
    Just wanted to know if it is possible to display BOM using CS11/CS12 with BOM status "3"- Active with history requirement.
    Your quick reply is appreciated.
    Thanks
    Nitin
    Edited by: Nitin Pandhare on Jun 16, 2011 10:16 AM

    No, it doesn't display the BOM in CS11/CS12 which has BOM status '3' (Active with history requirement). It always give an error message " The BOM is not effective on current date" though the BOM exists in the system and has the history within the validity period. If you try, it also gives the same error message even if the BOM status is Inactive (2').  I guess it works only for the BOM, which has status "1" (Active).
    May I request you to try at your end as well and let me know.
    Thanks for your help and sharing your views.
    Regards,
    Nitin

  • BOM Status in cs02

    Hello Experts,
       I have need to change BOM Status in CS02 to be inactive when we save it .
    The steps I do are :--
      1. Goto CS02.enter material , plant BOM Usage
    2. Click on header level ,and now whatever be the BOM status , but when we go to save it , the BOM status should be 2.
    The function exits I used are :--
               1.EXIT_SAPLCSBT_001
               2. EXIT_SAPLCEB1_003
    But , both are not triggering when I save my BOM .
    So , I need your valuable guidance ,to solve this issue.
    Regards,
    Jeet

    Hi,
    Please try to implement method 'CHANGE_AT_SAVE'  in BADI 'BOM_UPDATE' .
    Hope it will work.
    Thanks,
    Leo

  • Function module needed to read all the BOM statuses

    Dear Friends,
    In a report we are using CS_BOM_EXPL_MAT_V2 function module to get the dispaly the BOMs. But it is displaying only the BOMs which are in Active stauts e.g 1 & 3.
    My requirement is needs to read both active and inactive BOMs. Inactive BOM status is 2.
    suggest me if there is any another FM or any another way to get all the BOM status materials.
    Thanks for your help.
    Srinivas.

    You need to supply another application for alternative determination (field CAPID). It should be possible to customize one for your needs using "Define Order of Priority for BOM Usages" and "Define Applications" under "Production->Basic Data->Bill of Material->Alternative Determination"
    Edited by: Carsten Grafflage on Aug 5, 2010 1:44 PM: Corrected one string from customizing - sorry.

  • BOM status change during material replacement

    we use CSKB to create an order BOM. within the bom, we do a material replacement for one of the components, so that it's bom can also be modified. At the time of replacement, the material bom has a status of 1,  but after copying to the sales order bom, the status is changed to 3. this causes history tracking to turn on for the sales order bom, and we dont want that.
    is this change of status configured soemplace?
    tia

    I have found what i think to be th eproblem. the default bom status is set to 3, which is fine for a material BOM, but it appears it is also being used for the order bom.
    so... i decided to implement a method in BOM_UPDATE BADI. I copied some code from another message on this site, as follows:
    method if_ex_bom_update~change_at_save.
      data: wstko type cs01_stkob.
      data: name_tstko(30) value '(SAPLCSBT)O1-STPOB[]'.
      field-symbols: <tstko> type table.
      assign (name_tstko) to <tstko>.
      read table <tstko> into wstko index 1.
      if sy-subrc = 0.
    * if an order bom at status 03, change it to status 01
        if wstko-stlty = 'K' and wstko-stlst = '03'.
          wstko-stlst = '01'.
          modify <tstko> from wstko index 1.
        endif.
      endif.
    endmethod.
    The code compiles and executes fine, but the change is not made. i am guessing it has to do with the value in name_tstko, since that program is not even in my program stack when i save the bom (i put a breakpoint at the assign statement, and ran CSKB. I have tried various values based on the code that IS in my stack, and it simply short dumps, apparently unable to assign the names.
    this could potentially fix my status issue (and a couple of other issues) if i can get it to work. any help is appreciated.
    dave

  • ECM - History Requirement for BOM status not activated

    Hello,
    He have an issue with the warning message  displayed when we are trying to modificate an BOM (transaction CS02).
    In OS25 transaction we defined that only BOMs with "usage = 1" and "status = 3" have history requirement.
    The parameters of OS27 transaction are OK too.
    The problem is that the warning message 045 is displayed when we execute CS02 for every kind of BOM usage and status.
    We must substitute the warning message by an error message. To do that, we must disable the field NOHIS in C_STUE_NOH object, in the user profile. But, when we do that, the error message is displayed to all kind of BOMs status, blocking the process (following the warning message, which is displayed to all kind of BOM status)
    This is an issue of SAP_APPL 470 system.
    We tested the similar procedure in an SAP_APPL 603 system, and the results were OK, in other words, the warning message is only displayed for the BOM usage and BOM status defined in OS25 transaction.
    Thank's in advance

    When the BOM with usage 1 and status 3, by example, is changed with a modification number (following OS25 parameters), the field STZU-HISTK is activated.
    Then, if the status of the BOM is changed to 2, the modification number is required, because the STZU-HISTK is activated.
    In OS25 transaction only the BOm usage = 1 and BOM status = 3 has the history requirement flag, but after the modification with the mod. number, all the status of the BOM now has the modification number requirement.
    How can I allow the modification of the BOM without modification number (other status not flagged in OS25), if this BOM hal already been changed with an modification number (by the status flagged in OS25)?
    Thank's in advance

  • BOM STATUS only released for costing

    Dear gurus ,
    i need create a BOM STATUS only for CK11N ( COSTING) but when a created the new BOM STATUS whit only the flag "released for costing" but when i run the CK11N
    the system don't find the bom .
    Are there the other customzing setting?
    Thanks a lot
    Daniele Pistilli
    PP TEAM

    HI
    Check with BOM usage 6 for your requirement.also check in OKKN for your costing variant and qty structure  control> BOM application> selection Id for your BOM
    Regards
    Anupam Sharma

  • Mass change in BOM status to inactive

    Hi,
    I want to change the status of BOM Alternate header to inactive. I want to do the same for some 1000 BOMs in one shot. Is there a way to do the same.
    Please suggest

    Hi,
    You can use CEWB to make it inactive.
    or
    Create a BDC using CS02.
    Regards,
    Vishal

  • CS11- BOM explosion with status inactive

    When a BOM is marked as inactive( at the header level), the BOM explosion using CS11 is not possible.  The systems says there is no effective BOM. However I can pull up the same using CS03 and drill down level by level.
    Is this standard SAP behaviour? Are there any settings in Customizing that will make the explosion for inactive BOM's  using CS11 possible?

    Alternative to select inactive BOM
    BOM status = inactive in BOM header
    In OS31
    Create a selection ID = 09, selection priority = 1, BOM usage = 1
    OS 30
    Create a BOm application copy from PP01 let us say ZP01
    In which enter the selection ID = 09, what you created before
    Remove all the ticks of check BOM
    Save
    That is all.
    In cs11, select the application as ZP01 and you will get the BOM explosion.

  • Deault BOM header status

    We have one client with 3 different plants in it.
    In customizing a default bom status was defined (fully released) which currently applies for all plants.
    this now raises a problem in one of the plants due to different products. So this plant requires that the default status should be "not released".
    My question;
    Is it possible to define the default bom status "plant dependent" ? i.e. to have a different default start status for bom for different plants in the same client?
    2nd question: Is there a way to mass-change the bom status for a material-bom with the entire sub-hirarchy? CS20 transaction somehow does not seem to work (or I don't find the appropriate settings).
    Thanks a lot in advance.

    Hi,
    For part - 1 of your query check with your developer on the BADi - BOM_UPDATE, which of the method best suits your need. the parameter would be: DELTA_STKOB-STLST (i.e. BOM Status). Here you can change the value depending on your need.
    For part - 2 of your query, you can work with CEWB. For the current working area specify SAP_BOM. Specify the material, plant & usage details. Then press CTRL + F8 or follow menu path Bills of material -> BOM header. Click on pencil, select the column, then the rows, then follow menu path: Extras - Mass change.
    If you're new to CEWB, would suggest to test in sandbox first.
    Regards,
    Vivek

  • Error for open process order when BOM alternative is not found

    Dear colleagues,
    When I open process order. BOM alternative is selected according to the production version. But when  BOM alternative is not found system gives only information message and I can open process order, I want to prevent open process order when there is no BOM alternative according to the production version. Because the Bom can be deleted after creation production version.
    Thanks for your helping,

    Hi,
    U need to use an enhancement at the creation of order to check the active status of the bom and restricting the order creation when BOM status is inactive.
    see whether following enhancement is useful for your scenario:
    PPCO0006 Enhancement & EXIT_SAPLCOZF_003
    Please confirm.
    Regards
    Suri

  • How to change the header of Material BOM in a program for alternative BOM ?

    Requirement: An Inbound IDOC creates /change/delete Alternative Material BOM. The Alternative Material BOM can have alternative values from 1 to 99.
    ISSUE: I am good with CREATE and DELETE BOM. The issue is with CHANGE of header Material BOM. The fields which we need to change in the header is the base quantity, BOM status, Lot Size from and Lot Size to. Please note that I am able to change the item details of the BOM with FM CSAI_BOM_MAINTAIN. I find no FM /BAPI which would change the header of a material BOM.
    Please NOTE that I am using BAPI_MATERIAL_BOM_GROUP_CREATE to create alternative Material BOM. This has a parameter in TABLES called "VARIANTS" which has a field CS_FUNCTION which can have value from NEW/CHG/DEL .Also ,there is another parameter in TABLES called "ITEMASSIGNMENTS" which has a field CS_FUNCTION which can have value from NEW/CHG/DEL which implies this FM will allow us to change the BOM. But this does not work when I use it for CHANGE scenario with CHG value. I debugged this BAPI and observed it requires a STNLR(Bill of Material) value . This field is not there in any of the structure. I am not sure if I am passing the right parameters to it.
    Let me know if the parameters are passed correctly for CHANGE scenario.
    Also let me know if there is any other way(FM/BAPI)  to update the Header of the Material BOM ?
    Here is the code I am using:
    *& Report  ZTEST_S_E
    REPORT  ZTEST_S_E.
    * This code will create a material BoM for the material
    * MAINMATERIAL with the components COMPON1 and COMPON2.
    * Data Declaration
    DATA:
    it_bomgroup LIKE bapi1080_bgr_c OCCURS 0 WITH HEADER LINE,
    it_variants LIKE bapi1080_bom_c OCCURS 0 WITH HEADER LINE,
    it_items LIKE bapi1080_itm_c OCCURS 0 WITH HEADER LINE,
    it_matrel LIKE bapi1080_mbm_c OCCURS 0 WITH HEADER LINE,
    it_itemas LIKE bapi1080_rel_itm_bom_c OCCURS 0 WITH HEADER LINE,
    it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    * Fill the data
    * Material BoM Group Header Data
    CLEAR it_bomgroup.
    it_bomgroup-bom_group_identification = 'BAPI_SMP_COL1'.
    it_bomgroup-object_type = 'BOM'.
    it_bomgroup-object_id = 'SIMPLE1'.
    it_bomgroup-bom_usage = '1'. " YOU COULD CHANGE THE BOM USAGE TO YOUR
    *NEEDS
    it_bomgroup-ltxt_lang = sy-langu.
    it_bomgroup-technical_type = ' '.
    it_bomgroup-bom_text = 'Simple BoM - FM'.
    APPEND it_bomgroup.
    * Header Details of the different variants
    CLEAR it_variants.
    it_variants-CHANGE_NO  = '500000000349'.
    it_variants-bom_group_identification = 'BAPI_SMP_COL1'.
    it_variants-object_type = 'BOM'.
    it_variants-object_id = 'SIMPLE1'.
    it_variants-alternative_bom = '01'.
    it_variants-bom_status = '01'.
    it_variants-base_qty = '2.000'.
    it_variants-valid_from_date = sy-datum.
    it_variants-function = 'CHG'.
    APPEND it_variants.
    * Details of the items of the variants
    CLEAR it_items.
    it_items-bom_group_identification = 'BAPI_SMP_COL1'.
    it_items-object_type = 'ITM'.
    it_items-object_id = 'SIMPLE1'.
    it_items-item_no = '0010'.
    it_items-item_cat = 'L'.
    it_items-component = '030790490'.
    it_items-comp_qty = '2'.
    it_items-valid_from_date = sy-datum.
    APPEND it_items.
    CLEAR it_items.
    it_items-bom_group_identification = 'BAPI_SMP_COL1'.
    it_items-object_type = 'ITM'.
    it_items-object_id = 'SIMPLE1'.
    it_itemas-change_no = '500000000138'.
    it_items-item_no = '0020'.
    it_items-item_cat = 'L'.
    it_items-component = '030790490'.
    it_items-comp_qty = '3'.
    it_items-valid_from_date = sy-datum.
    APPEND it_items.
    * Details of the materials of the different variants
    CLEAR it_matrel.
    it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
    it_matrel-material = '030790490'.
    it_matrel-bom_usage = '1'.
    it_matrel-alternative_bom = '01'.
    APPEND it_matrel.
    * Linking items to the corresponding variants
    CLEAR it_itemas.
    it_itemas-bom_group_identification = 'BAPI_SMP_COL1'.
    it_itemas-sub_object_type = 'ITM'.
    it_itemas-sub_object_id = 'SIMPLE1'.
    it_itemas-super_object_type = 'BOM'.
    it_itemas-super_object_id = 'SIMPLE1'.
    it_itemas-valid_from_date = sy-datum.
    it_itemas-function = 'CHG'.
    APPEND it_itemas.
    * Create variants
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
    EXPORTING
    all_error = 'X'
    TABLES
    bomgroup = it_bomgroup
    variants = it_variants
    items = it_items
    materialrelations = it_matrel
    itemassignments = it_itemas
    return = it_return.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    LOOP AT it_return.
    WRITE:/ it_return-type, it_return-id, it_return-number,
    it_return-message.
    ENDLOOP.
    Let me know if the parameters are passed correctly for CHANGE scenario.
    Also let me know if there is any other way(FM/BAPI)  to update the Header of the Material BOM ?

    Try doing something like this:
    class MyJTextArea extends JTextArea {
        public boolean keyDown(Event evt,int key) {
            if(key == 13 || key == 10) { // or whatever ascii codes enter may have
                // move carret to next line
            } else {
                super.keyDown(evt, key);
    }which means you have got to catch the enter-key before the actutal JTextArea does this.
    p.s. look at my post, maybe you can help me, too.
    http://forum.java.sun.com/thread.jsp?forum=5&thread=465803&tstart=0&trange=100

  • MRP RUN- KIT BOM explosion not working

    We setup one layer BOM’s for our maintenance KITs as parent material and components as child material.  For  example KIT is TS10000-K1 and components are TS10001, TS10002 etc setup as next layer with in the BOM. Both KITS and components are defined as material types ERSA (Spare parts). These one layers BOMs are setup as production BOMs and expected to create purchase requisitions for KITS and components by exploding BOMs during MRP runs. We use purchase requisitions and convert them into POs to procure both KITS and components. We DO NOT USE Panned orders and Production orders. 
    The safety stocks / reorder point are considered as demand for KITS and components as we do not have any external demand for KITS and components.  
    MRP run is creating purchase requisitions automatically for both KITS and components as per safety stocks and reorder point defined in MRP Views of Material Master. This is working as expected.  
    The issue is: KIT BOM’s are not exploding to generate purchase requisitions for the dependent components of KIT BOM. Please suggest the way to resolve this issue. 
    Split valuation: Also we plan to use split valued KITS with both new and refurbished. So we need BOM explosion for split valued KITS
    also (after the 1st issue is resolved).   
    I verified the following items to make sure the required configuration and data setup is defined correctly.
    1) Planning file activated Plant - OMDU 
    2) Executed MRP run with Total Planning - MDBT and MD02 (single item, multiple levels)
    3) BOM explosion for MRP activated- OS23 
    4) MRP type in MRP1 view- PD and VB (I tried both separately but BOM is not exploding).
    5) Procurement type “F” (MRP 2 view) and lot size “EX”  
    6) Planning strategy in MRP 3 view (tested w/o planning strategy and with strategies 10 and 40. But BOM is not exploded)
    7) BOM status and usage (status is active and usage is for production-CS02 and OS20)  
    8) BOM Validity date (Valid) 
    9) BOM structure in CS12 (BOM is exploding in CS11) 
    10) Availability check  
    11) Selection of BON ID to have BOM usage indicator assign (OS31).
    12) No alternate BOMs or production versions or work scheduling view are used.
    Please review the above 2 issues and suggest any workable solution. Thanks in advance!
    NOTE: I extensively used MRP with multi-level BOM explosion in my earlier projects without any issue. However the above issue is a  bit strange  why one layer BOM is not exploded in this case. 
    Regards
    Srini  

    Hi
    Thanks for your response. I reviewed all SAP notes and none of them are applicable to my scenario.
    1808396 - BOM changes not considered by MRP: I have not changed BOMs.
    1781324 - MD11: Valid BOM alternative is not found. We do not have alternative BOMs.
    1791009 - No BOM explosion after changing production version: We am not using production versions.
    Our Material KITS are PM spare assemblies set up as BOMs and consists of individual spare parts as components. We are creating purchase requisitions and not planned orders. We are not using PP functionality/Production orders.
    MRP is generating purchase requisitions for KITS and components as per ROP and safety stocks. In other words it is working as expected.  The issue is BOMs which are parent assemblies are not exploding to the next lower level components.
    Please note that I am not getting any error messages when MRP is executed.
    Regards
    Srini.

  • Reg: Creation of BOM along with Alternative BOM

    Hi Experts,
    I have written the below code for creating BOM along with Alternative BOM, I'm getting the following error.
    W BAPI1080             028
    Error/warning when checking the structure of the BOM group with ID=
    A BAPI1080             002
    Basic data for (BOM) group available twice
    A BAPI                 001
    No instance of object type BOMGroup has been created. External reference:
    W BAPI1080             028
    Error/warning when checking the structure of the BOM group with ID=
    A BAPI1080             002
    Basic data for (BOM) group available twice
    A BAPI                 001
    No instance of object type BOMGroup has been created. External reference:
    Please find the piece of code below.
      SORT it_bom01 BY matnr idnrk posnr ASCENDING.
      LOOP AT it_bom01 INTO wa_bom01.
        AT NEW matnr.
          CLEAR:
            it_bomgroup[],
            wa_bomgroup,
            it_variants[],
            wa_variants,
            it_items[],
            wa_items,
            it_matrel[],
            wa_matrel,
            it_itemas[],
            wa_itemas,
            it_return.
        ENDAT.
    * Material BoM Group Header Data
        wa_bomgroup-bom_group_identification = 'IDENTIFICATION'.
        wa_bomgroup-object_type = 'BGR'.
        wa_bomgroup-object_id = 'ID'.
        wa_bomgroup-bom_usage = wa_bom01-stlan.
        wa_bomgroup-ltxt_lang = sy-langu.
        wa_bomgroup-technical_type = ' '.
    *   wa_bomgroup-bom_text = .
        wa_bomgroup-created_in_plant = wa_bom01-werks.
        APPEND wa_bomgroup TO it_bomgroup.
    * Header Details of the different variants
        wa_variants-bom_group_identification = 'IDENTIFICATION'.
        wa_variants-object_type = 'BOM'.
        wa_variants-object_id = 'ID'.
        wa_variants-alternative_bom = wa_bom01-stlal.
        wa_variants-bom_status = wa_bom01-stlst.
        wa_variants-base_qty = wa_bom01-bmeng.
        wa_variants-valid_from_date = wa_bom01-datuv.
        wa_variants-alt_text = wa_bom01-alt_text.
        wa_variants-function = 'NEW'.
        APPEND wa_variants TO it_variants.
    * Details of the items of the variants
        wa_items-bom_group_identification = 'IDENTIFICATION'.
        wa_items-object_type = 'ITM'.
        wa_items-object_id = 'ID'.
        wa_items-item_no = wa_bom01-posnr.
        wa_items-item_cat = wa_bom01-postp.
        wa_items-component = wa_bom01-idnrk.
        wa_items-comp_qty = wa_bom01-menge.
        wa_items-valid_from_date = wa_bom01-datuv.
        APPEND wa_items TO it_items.
    * Details of the materials of the different variants
        CLEAR it_matrel.
        wa_matrel-bom_group_identification = 'IDENTIFICATION'.
        wa_matrel-material = wa_bom01-matnr.
        wa_matrel-plant    = wa_bom01-werks.
        wa_matrel-bom_usage = wa_bom01-stlan.
        wa_matrel-alternative_bom = wa_bom01-stlal.
        APPEND wa_matrel TO it_matrel.
    * Linking items to the corresponding variants
        CLEAR it_itemas.
        wa_itemas-bom_group_identification = 'IDENTIFICATION'.
        wa_itemas-sub_object_type = 'ITM'.
        wa_itemas-sub_object_id = 'ID'.
        wa_itemas-super_object_type = 'BOM'.
        wa_itemas-super_object_id = wa_bom01-matnr.
        wa_itemas-valid_from_date = wa_bom01-datuv.
        wa_itemas-function = 'NEW'.
        APPEND wa_itemas TO it_itemas.
        AT END OF matnr.
          CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
            EXPORTING
              all_error         = 'X'
            TABLES
              bomgroup          = it_bomgroup
              variants          = it_variants
              items             = it_items
              materialrelations = it_matrel
              itemassignments   = it_itemas
              return            = it_return.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
          LOOP AT it_return.
            WRITE:/ it_return-type, it_return-id, it_return-number,
            it_return-message.
          ENDLOOP.
        ENDAT.
      ENDLOOP.
    Thanks and Regards,
    Abdur Rafique

    Hi Sree,
    I used your code, I removed the levels because, i have only one level 'the lineitems'. Please find the modified code below. I'm not able to create the BOM, it throws an error as "BOM is recursive". I checked the header and item contents before passing to FM, it is correct.
    Please help me with the solution.
    REPORT  zbom_sdn.
    TYPE-POOLS: truxs.
    DATA: bom_header     LIKE cad_bicsk,
          bom_item       TYPE TABLE OF  cad_bom_item WITH HEADER LINE,
          bom_sub_item   TYPE TABLE OF cssubitem WITH HEADER LINE,
          dms_class_data TYPE TABLE OF cls_charac  WITH HEADER LINE,
          sap_field_data TYPE TABLE OF rfcdmsdata  WITH HEADER LINE,
          e_return       LIKE cad_return-value,
          e_message      LIKE message-msgtx,
          e_message_len  LIKE cad_return-message_len.
    DATA v_item  TYPE i.
    TYPES : BEGIN OF ty_data,
             matnr TYPE cad_bicsk-matnr," Material
             werks TYPE csap_mbom-werks," Plant
             stlan TYPE csap_mbom-stlan," BOM Usage
             datuv TYPE csap_mbom-datuv," Valid From
    *         posnr TYPE stpo_api03-item_no," Item Number
             idnrk TYPE stpo_api03-component," BOM Component
             postp TYPE stpo_api03-item_categ," Item category
             menge TYPE cad_bom_item-menge," Quantity
             bmeng TYPE stko_api01-base_quan," Base Qty
             stlst TYPE stko_api01-bom_status," BOM Status
             stlal TYPE csap_mbom-stlal," Alternative BOM
             alt_text TYPE stko_api01-alt_text," Alternative BOM text
            END OF ty_data.
    DATA : it_data TYPE TABLE OF ty_data ,
           wa_data TYPE ty_data.
    DATA:   wa_raw TYPE truxs_t_text_data.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    PARAMETER : p_file TYPE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          program_name  = syst-repid
          dynpro_number = syst-dynnr
        CHANGING
          file_name     = p_file.
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
           EXPORTING
    *       I_FIELD_SEPERATOR          =
             i_line_header              = 'X'
             i_tab_raw_data             = wa_raw     " Work Table
             i_filename                 = p_file
           TABLES
             i_tab_converted_data       = it_data[]  " Actual Table
           EXCEPTIONS
            conversion_failed          = 1
            OTHERS                     = 2 .
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CLEAR: bom_header, bom_item, bom_sub_item.
      REFRESH: bom_item, bom_sub_item.
      DATA : v_lineitem TYPE sposn VALUE '0000',
             v_slineitem TYPE sposn VALUE '0'.
      LOOP AT it_data INTO wa_data.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = wa_data-matnr
          IMPORTING
            output = wa_data-matnr.
    * fill BOM header
        CLEAR  bom_header.
        bom_header-matnr = wa_data-matnr. "'000000000200000016'.
        bom_header-stlal = wa_data-stlal. " Alternative Bom
        bom_header-werks = wa_data-werks.                       "'1000'.
        bom_header-stlan = wa_data-stlan.                       "'3'.
        bom_header-bmeng = wa_data-bmeng.
        bom_header-cadkz = 'X'.
        bom_header-stktx = wa_data-alt_text.
    *      bom_header-ztext = wa_data-text.
        bom_header-datuv = wa_data-datuv."'01.10.2010'.
    * fill item
        v_lineitem = v_lineitem + 10.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = v_lineitem
          IMPORTING
            output = v_lineitem.
    *    bom_item-upskz     = 'X'.     " If We hav the Sub items Enable it.
        bom_item-idnrk     = wa_data-matnr. "'000000000200000017'.
        bom_item-posnr     = v_lineitem.
        bom_item-postp     = wa_data-postp."'L'.
        bom_item-menge     = wa_data-menge.                     "'1'.
    *    bom_item-fmeng     = wa_data-fqty.
        APPEND bom_item.
        CLEAR: bom_item.
        AT END OF matnr.
          CALL FUNCTION 'CAD_CREATE_BOM_WITH_SUB_ITEMS'
               EXPORTING
                    i_bom_header   = bom_header
                    i_auto_posnr   = ''
               IMPORTING
                    e_return       = e_return
                    e_message      = e_message
                    e_message_len  = e_message_len
                    e_bom_header   = bom_header
               TABLES
                    bom_item       = bom_item
                    bom_sub_item   = bom_sub_item
                    dms_class_data = dms_class_data
                    sap_field_data = sap_field_data
               EXCEPTIONS
                     OTHERS         = 1.
          REFRESH bom_item.
          WRITE : e_message.
        ENDAT.
        CLEAR wa_data.
      ENDLOOP.
    Thanks and Regards,
    Abdur Rafique

Maybe you are looking for