MRP of alternative bom

Hi gurus,
how can i ensure explosion of desired alternative BOM during MRP run? Setting of BOM explosion strategy by production version is not helping. I am using mySAP ECC 6.0
Thanks and regards
Abhik

Hello Abhik,
You have more options. You can use:
- lot size (defined in BOM header)
- production version (several option you have: lot size, manually assign a PV to a planned order) - it was mentioned by you
- you can use explosion date (OPPP, Logistcs > Production > MRP > Master Data > BOM by date)
MRP 4 (in material master) > 'BOM explosion/dependent requirement' tab > you can set selection method according to your wish.
Details:
http://help.sap.com/saphelp_46c/helpdata/en/f4/7d2b1144af11d182b40000e829fbfe/frameset.htm
BR
Csaba

Similar Messages

  • MRP run including Alternative BOM & Routing in sequence.

    Dear Experts,
    My client has maintained alternative BOM & Routing for there In house production materials.He wants to execute MRP run which can include all BOM's & Routing in sequence. Like, first MRP run should check material requirements as per first alternative followed with second & third alternatives.
    Regards,
    Rajesh.

    Dear Rajesh,
    ur req is not possible in that way. coz MRP run select only one PV or BOM and routing at a time and if stock is not available then it will genrate the req.
    You can try with this rather craeating an alteranative BOM create alternative group of material so when u run the MRP system will check the stock of first matrial and if short fall is there it will go for next.
    Regards
    Sachin

  • 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.

  • Subcontract PO item withdrawal issue when alternative BOM item used

    Hi,
    As title mentioned, when we issue alternative material for a subcontract PO in BOM, but it still shows the quantity from primary item.
    (For example, we have a product, let's say it as Product-A, it's combined by material-B1 and Material-C1
    And the BOM for Product-A for item material-B1 has an alternative item, material-B2
    Now the issue is when we issue material-B2 instead B1, but the PO usage/withdrawal listed in B1)
    Because we are making a list for China custom for material usage, the issue listed above makes our list not available for custom department.
    Please let us know how we could make the withdrawal in PO shows B2.
    thanks,
    Steven

    Dear Steven,
    As explained by our forum friend maintain this data.
    1.Create 2 different BOM for the same header material with the respective BOM components.
    2.Create production version for the header material using T COde MM02--->MRP4 view and click on prod.version,enter the same
    as 0001,text as prod version 1,default valid from date will be the current date and the valid to date will be 31.12.9999.
    3.Enter the lot size for which this prod version is valid and then in the alternative BOM select the BOM and save the data.
    4.Prdo.version can also be maintained through C223.
    5.Assign this prod version in the sub-contracting purchase info record in ME11,under prod version under purch org data(not sure
    check this alone).
    6.Likewise assign the prod version that is linked to the BOM to be picked for each sub-contracting vendor.
    Check the results after MRP and revert.
    Regards
    S Mangalraj

  • Alternative bom

    i have one finish product '' A '' ( say ), In one case to create '' A '' I require one  raw materials as AA and one packing material as BB . Secondly to create "A" i sometimes require AA (Row material ) & CC ( Packing material ) . This dipends on my customer's requirement.
                                                            To takeover this problem I had created a production version as 001 & 002 in MRP 4 screen of material "A" & two alternative BOM as 1 & 2 ..But now while creating sales order by VA01 how I will come to know regarding BOM selection which will indicate my customers packing requirement.

    Hi abhijeet
    In production version and Alternate BOM. You have to *differentiate between PV 1 & PV 2 by header quantity ( say 0 - 500 for first 501 - 100000 )*  or by Validity date. Then only the system will pick automatically the required BOM.
    Otherwise you have to manually select the BOM. By doing setting in OPL8 order type dependent parameter ( PV selection Manual ).
    Note
    This will work only for manual creation of prod order in CO 01.
    Hope this is clear
    Regards
    J . Saravan

  • SFG alternative BOM in Different BOM

    Hi all ,
    I have one SFG which is having two alternative bom .
    This SFG is used in 2 finished material BOM .
    In FG material- 1  i want use SFG alternative -1 and
    in FG material -2  i want to use SFG alternative -2 ,
    when  I RUN mrp system should select the relevant boms.
    Is it possible , If yes how to do?
    Thanks ,
    Regards ,
    Ganesh

    Dear ,
    Are you running MRP at a time for FG1 and FG2  ?
    Basically , I am looking for an work around like this :
    1.FG1 BOM Alternative  : SFG1 as Component   -Keep BOM Status -1 Active ,    SFG1 BOM Alternative 1  :  X, Y  as component  -Keep BOM Status -1 -Active
    2.Keep FG2 and SFG2 BOM In -active -2 in CS02
    3.Create Routing of FG1 and SFG1 with the same manner .
    4.Run MRP-MD02-FG1-Check MD4C-Convert SFG1 planned Order to Production Ordre and also FG1 -Planned Oder to Production Order .
    5.Repeate the the Same for FG2 and SFG2 keeping FG1 and SFG2 as inactive BOM status -2 and susequently convert the same .
    This is may the work around .
    But standard procedure is that , you need to go for Aleter native BOM selection in two fold (FG and SFG for both ) based on the Following set up
    1.MRP4 -BOM Selction Method -Keep 2/3 SELECTION by PV
    2.Maintain  two different PV1/PV2  with a lot size and validity  in FG and SFG
    Now , when MRP will run in FG and explode the BOM at FG, SFG level , it will chek the MRP4 view indicator frist , if it 2  then it will go to PV 1 and PV2 check the Lot size and Validity and select the alternaitve BOM in two fold
    Lastly , Implement the BAdI MD_MODIFY_PRODVERS.
    Use the method MODIFY_PRODUCTION_VERSION to write your logic (for checking the stocks) and change the production version to
    Hope it clarifies your doubt
    Regards
    JH

  • Alternative bom and routing selection in planned order

    hi
    how i can config the system so that while creating planned order
    system has to select the alteranative SEQUENCE and alternative routing ?
    at opl8 we do this for production orders what about the planned oreders
    in scheduling parameters of planned orders we can give only selection ID
    WHAT about alternative SEQUENCE .
    IN the same way how the system selects the alternative BOM with date in planned order
    iam not creating production versions
    plz suggest
    sasikanth

    Hi,
    If you r using Prod Version then system pick ups the BOM attached in first valid production version.
    So, normally put more frequently used BOM in your first Prod Version.
    You have more options to use:
    - lot size (defined in BOM header)
    - production version (several option you have: lot size, manually assign a PV to a planned order)
    - you can use explosion date (OPPP, Logistcs > Production > MRP > Master Data > BOM by date)
    MRP 4 (in material master) > 'BOM explosion/dependent requirement' tab > you can set selection method according to your wish.
    Details:
    http://help.sap.com/saphelp_46c/helpdata/en/f4/7d2b1144af11d182b40000e829fbfe/frameset.htm
    Regards,
    Sankaran

  • Purchase requisition generate for alternative bom use for finished product

    i hav alternative BOM for finished product in which different raw material component in both BOM of same finished product.But when i RUN MRP that time only one raw material requisition generate another alternative bom raw material requision not generate.
       Is there any option when i RUN MRP that time we select one of the alternative bom component of  raw material for generation purchase requisition.
    Thnaks in Advance

    Dear ,
    MRP will select the BOM based on the MRP4-BOM Explosion tab -Selection Indicator .It can eitehr of these ways :
    1.Maintain Production Version with  different Alternative BOM  and keep Selection Indicator -3 .So sysetm will look into only the Valaidty  and lot size of the Production version and select the correct BOM to explode  and generate PR for depednts based on stock situation
    2.If you maintain Blank -then it will look into order qty and select the BOM according ly
    As in your case , selection methods 3 will fit  and you need to maintain PV with correct validity and lot size in MMR-MRP4-PV option .
    Try in sand box with different lot size and validity with indicator-3 .Create Order and run MRP-MD02-1,,3,3,3,2
    Check and revert
    Regards
    JH

  • How sap trigger alternative bom ?

    Hi Experts,
      We need setup alternative BOM, like Part A is used up, then it could use another BOM with part B.
    But if we setup new BOM as alternative BOM, do we need use produciton version, then it could trigger out differnt BOM?How SAP could trigger the different BOM or production version ?   Could it by MRP?
    Thanks
    Alice

    Hi,
    For BOM Alternative Selection you need to maintain any of the following settings in Material Master --->
    MRP-4 View->BOM Explosion / Dependent Requirements->Selection Method :
    Method for Selecting Alternative Bills of Material
    Indicator determining the selection of the alternative BOM when requirements are exploded in material requirements planning.
    Use
    With Selection by order quantity, the system chooses the alternative BOM into whose lot size range the order quantity falls. The lot size range and area of validity of the BOM apply.
    With Selection by explosion date, the system chooses the alternative BOM into whose area of validity the date falls according to the setting BOM via dates.
    With Selection by production version, the system chooses the alternative BOM defined in the valid production version. The lot size range and area of validity of the production version apply.
    With Selection only by production version, the system chooses the alternative BOM defined in the valid production version. The lot size range and area of validity of the production version apply.
    If no production version is found, no production orders or process orders can be created.
    Hope this helps.
    Revert if any doubt.
    Regards,
    Tejas

  • Number of Alternative BOM

    Greetibgs ,
                   How Many number of  alternative BOM, we can created in standard system.

    Dear,
    In that case you need to define 99 production version then you have to decide which production version you want to use for actual production as per your material availability then assign that production version in demand management MD62 in schedule lie tape will consider for MRP and net requirement calculation.
    Hope clear to you.
    Regards,
    R.Brahmankar

  • CO01 CREATE SHOP ORDER MANUALLY SELECTING ALTERNATIVE BOM

    Hi, I can see how to set-up alternative bom selection when using mrp to create shop orders automatically but when we are manually creating a shop order and there are two alternative boms how do I select the second alternative at the time of creation, our set-up defaults to alternative 1 and gives no choice to select the other. Each alternative has different components of course and  allocated to different operations.
    Hope you can advise me, thank you.
    Craig Wood

    Hi Craig Wood,
    u can select  desire alternative bom while creating Production order manually by creating two production versions for your header material. Do the following settings..
    1.create two production versions and assign your alternative BOM  - Mrp view of MM01.
    2. define BOM selection Ind = 2 in (By production version) In Mrp view.
    3.then define selection of production version = 1 (Manual selection)for your order type and plant -  in OPL8
    4. Now create pro ord  , give your qty and date`s then sytem will show one pop-up window here u can select the production version .
    regards
    pradeep.

  • Alternative bom selection

    hello,
    i want solution for alternative bom selection.
    for eg.
    i have material say X00100 which has two alternative components
                                A00100
                                B00100
    now, i have to mapped the scinario that .the product pick the material   A00100
    first & if there is no stock then it will pick the material   B00100
    please give the solution
    marks are sure
    regards,
    mangesh

    Hi,
    Try using this concept.
    In BOM alternative items are assigned to alternative item group on the general
    data.
    In the production order in the general data tab page.
    We can define the alternative items based on priority , strategy and usage probability.
    Priority:
    This defines the priority of the item within the alternative item group.
    This determines the priority of planned withdrawls of items.
    EX Two items are assigned to alternative item group
    item A Priority 1
    item B Priority 2
    The system reads the item A first.
    Strategy:
    use the strategy to determine how the planned withdrawl is controlled
    within the alternative item group.
    The strategy should be same for all alternative items within a alternative
    item group.
    If the value 2( 100% check) is defined for the strategy the first material in
    the defined priority sequence for which sufficient quantities are available
    are reserved.
    If value 1 is used( manual maintainence/ usage probability) depending upon the
    availability you can manually with draw components.
    Usage Probability:
    MRP Plans these alternative material components according to probability
    of use.Material requirements for BOM Components are planned according
    to usage probability.
    The planned withdrawls for the production order are based on the
    reservation lists.These lists are based on the priority and strategy.
    Regards,
    nandha

  • Change Alternative BOM

    Dear SAP expert,
    We made an alternative BOM according to Reformulation of the product.
    For now the new Formula (in alternative BOM) become the new standard for its Production procedure.
    So all productions process will refer to that new alternative BOM.
    Is there any way to set the new alternative BOM to be the default BOM??
    regards,
    Hachi

    Dear
    There are two ways you can achieve the same :
    1.Goto CS02-Select the Frist Alternative and Goto to BOM header -Quantity and log text -Keep the BOM status as 2-In active .So that wehn ever you plan throuh MRP-MD02 , system will take the Active BOM -which will be your latest Reformualtion BOM .
    2.One more way will create two production version PV1 and PV2.PV1 will be your Formualtion BOM with correct lot size and validity and PV2 will be with frist alternative  .If both of them have same validity , lot size , system will choose the fist PV  as FIFO even if you keep BOM Explosion methos as 2/3-Selection by production version .Or eles you can lock the second PV2 and test the same duing BOM explosion  through MRP-MD02.
    Try and come back
    Regards
    JH

  • Critical Issue: Availabilty check & alternative BOM selction issue

    During the upgradation project I'm working facing the following critical issues:
    1)While creating the sales order, system carries out the availability check in APO.In material master checking group Z5 is defined.
        Actually I want to know hw the system carries out the search in APO & what are the settings in R/3 or APO we have to make?
    2)Suppose there are 3 alternative BOM's of a finished product.A requirement is while creating the sales order availabilty check should be carried out & system should check the availability of components on the required date.If the component is not avalable system should go & check the second alternative...third alternative until it gets the confirmation of component availability.
         How we can set this functionality & what are the prerequisites or customisation settings we needs to make?
        Would appreciate providing your inputs on this critical issue.
    Thanks,
    Nilesh<b></b>

    Before you understand how the APO Availability Checking concept works, I would suggest you understand about the regular R3 availability checking. As this is the core for the SD and APO GATP. Refer help.sap.com
    Question 1:
    <b>Settings in R3:</b> You have the ATP integration model in CFM1 transaction. You need to activate this just one time and never again. what this does is basically transfer all your availability checking customizing to APO.
    All the settings for the Availability Checking group ( Z5, etc) are already maintained in R3 and they get transferred to APO by the integration model. You donot need to anything else.
    <b>Settings in APO:</b>
    If you are using <b>Product Allocation Concept</b>, You have to maintain the Check Instructions.... Otherwise there are no other settings in APO
    <b>Availability Check in APO :</b>
    ( see the following blog for the requirements class( Name in R3) or check mode( Name in APO) determination http://solution-timezone-issue.blogspot.com/ )
    The check mode and the business event( These are hardcode internally in R3 - For SD- A) are determined from the order and based on this in APO it follows the following order
    (1) Reads the check instructions settings in APO
    For example say the following have been determined from the SD Order : Check Mode 041 and  Business Event A
    Say we have maintained in APO that the first step is Availability Check and all the other two steps we havent maintained or left blank ( Product Allocation and Forecast)
    Look for the customizing in APO
    SPRO>APO>GATP>General Settings>Maintain Check Instructions ****
    (2) Carries out availability Checking same as in R3 and no different
    From the masterial master considers the availability checking group ( Ex: Z1) and the business event( SD transactions- A)
    Very Important and the core of availability checking which is similar in R3 and APO***
    Against these 2 combinations, the settings are checked which define what stock and in/outward movements are to be considered during the availability check
    For customzing settings in APO
    SPRO>APO>GATP>Maintain Check Control>
       For Customizing in R3
    SPRO>Sales and Distribution>Basic Functions>Availability Check and transfer of requirements>Availability check with ATP logic or planning>Carry out control for availability check
    This is the answer to your first question.
    Your second question would need some time  and I will try to answer it as well.
    Hope this helps you..

  • 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