BOM in VA02 urgent

Hi,
The functionals have configured Sales Order to Explode BOM when a material is inserted e.g. Material Type Crates of bottles as CRT.
Now if they enter Material Type Bottles i.e BT then BOM is also exploding and it is putting the BOM values in the Order too.
I want this BOM to be executed on only Material Type CRT, not on any others.
What can i do i mean is there any configuration procedure or any enhancement or BADI to perform this task.
Thanks in Advance and Rewards will be given.

it is simple ....open mateial master record ...
in MM02 give ur material name and select the view sales org 2.
then it will ask for sales org / dst chnl   data relavant to org elements just fill up  them
and now you can see the tab sales org 2 opened.
now here here are two item categoreis one is gen item category group and item category group.
check the feild in item category group and change it to NORM.
then ur BOM wont xplode.
hope this solves it .

Similar Messages

  • Error while creating BOM using BAPI (urgent)

    Hi all,
    Thanks for ur help. i am getting some error while creting a BOM using that BAPI
    BAPI_MATERIAL_BOM_GROUP_CREATE.
    errors are
    1) Error/warning when checking the structure of the BOM group with ID =
    2)Alternative does not exist for material assignment to material BAPIBOMFG1
    is it mandatory to pass the bom group id to this bapi?
    In bomgroup structure , i am not passing anything to BOM_GROUP field.
    is it mandatory to pass this data? i am giving my coding below.plz suggest , where i am making mistake. it is urgent.
    regards
    pabitra
    report z_bom_create
    line-size 132
    line-count 65
    no standard page heading.
    *-- DATA DECLARATION--
    include <icon> .
    *---Tables
    tables : s076, t100, marc .
    *---Types
    types : begin of t_upload, " Upload file data
    col1(18),
    col2(10),
    col3(30),
    col4(12),
    col5(50),
    end of t_upload,
    begin of t_split,
    location like stpu-ebort,
    end of t_split.
    data:begin of i_return occurs 10.
    include structure bapiret2.
    data:end of i_return.
    types:begin of t_item."occurs 10.
    include structure BAPI1080_ITM_C.
    types:end of t_item.
    types:begin of t_subitem." occurs 10.
    include structure BAPI1080_SUI_C.
    types:end of t_subitem.
    types:begin of t_header." occurs 10.
    include structure BAPI1080_MBM_C.
    types:end of t_header.
    types:begin of t_bomgroup." occurs 10.
    include structure BAPI1080_BGR_C.
    types:end of t_bomgroup.
    types:begin of t_variant." occurs 10.
    include structure BAPI1080_BOM_C.
    types:end of t_variant.
    *--- Tables
    data: i_upload type standard table of t_upload, " to hold data
    i_upload1 type standard table of t_upload,
    i_split type standard table of t_split,
    i_item type standard table of t_item,
    i_subitem type standard table of t_subitem,
    i_header type standard table of t_header,
    i_bomgroup type standard table of t_bomgroup,
    i_variant type standard table of t_variant.
    data: wa_upload type t_upload, " to hold file data,
    wa_upload1 type t_upload, " to hold plan data,
    wa_split type t_split,
    wa_item type t_item,
    wa_subitem type t_subitem,
    wa_header type t_header,
    wa_bomgroup type t_bomgroup,
    wa_variant type t_variant.
    data:v_matnr like mara-matnr,
    v_start like sy-index,
    v_count(3) type c.
    *--Constants
    data: c_dot type c value '.',
    c_x type c value 'X',
    c_comma type c value ','.
    -------Selection Screen Design -
    *Selection screen for input of upload file address
    selection-screen skip 2.
    selection-screen begin of block blk1 with frame.
    parameters : p_file like rlgrap-filename obligatory .
    parameters : p_matnr like mara-matnr obligatory,
    p_werks like marc-werks obligatory memory id wrk,
    p_stlan like afko-stlan obligatory default '1' .
    selection-screen end of block blk1.
    ---AT SELECTION SCREEN -
    at selection-screen on value-request for p_file.
    *--For popup to select file.
    perform f_give_help.
    at selection-screen on p_matnr.
    perform f_check_matnr.
    -----START OF SELECTION -
    *--Data upload using WS_Upload.
    perform f_get_data.
    perform f_get_bom_data.
    perform f_get_bom_data1.
    perform f_call_bapi.
    *& Form f_give_help
    text
    --> p1 text
    <-- p2 text
    FORM f_give_help.
    call function 'WS_FILENAME_GET'
    exporting
    mask = ',.,..'
    mode = 'O'
    importing
    filename = p_file
    exceptions
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    others = 5.
    if sy-subrc <> 0 and not sy-msgty is initial.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    ENDFORM. " f_give_help
    *& Form f_check_matnr
    text
    --> p1 text
    <-- p2 text
    FORM f_check_matnr.
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = p_matnr
    PLANT = p_werks
    BOMUSAGE = '1'
    VALID_FROM_DATE =
    VALID_TO_DATE =
    TABLES
    RETURN = i_return.
    ENDFORM. " f_check_matnr
    *& Form f_get_data
    text
    --> p1 text
    <-- p2 text
    FORM f_get_data.
    call function 'WS_UPLOAD'
    exporting
    CODEPAGE = ' '
    filename = p_file
    filetype = 'DAT'
    tables
    data_tab = i_upload
    exceptions
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    others = 10
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    ENDFORM. " f_get_data
    *& Form f_get_bom_data
    text
    --> p1 text
    <-- p2 text
    FORM f_get_bom_data.
    delete i_upload where col1 is initial.
    delete i_upload where col1 cs 'ITEM'.
    read table i_upload into wa_upload with key col1 = 'FINISHED GOOD:'.
    if sy-subrc = 0.
    v_matnr = wa_upload-col2.
    if v_matnr <> p_matnr.
    message e001(zl) with p_matnr.
    endif.
    else.
    message e000(zl).
    endif.
    ENDFORM. " f_get_bom_data
    *& Form f_get_bom_data1
    text
    --> p1 text
    <-- p2 text
    FORM f_get_bom_data1.
    loop at i_upload into wa_upload where col1 CS 'FINISHED GOOD'.
    v_start = sy-tabix + 1.
    loop at i_upload into wa_upload1 from v_start .
    if wa_upload1-col1 cs 'FINISHED GOOD'.
    exit.
    else.
    perform f_split_upload_data.
    endif.
    endloop.
    endloop.
    ENDFORM. " f_get_bom_data1
    *& Form f_split_upload_data
    text
    --> p1 text
    <-- p2 text
    FORM f_split_upload_data.
    if not wa_upload1-col5 is initial.
    if wa_upload1-col5 cs c_comma.
    split wa_upload1-col5 at c_comma into table i_split.
    loop at i_split into wa_split.
    v_count = v_count + 1.
    endloop.
    if wa_upload1-col4 <> v_count.
    wa_upload1-col4 = v_count.
    endif.
    clear wa_upload1-col5.
    clear wa_split.
    loop at i_split into wa_split.
    wa_upload1-col5 = wa_split-location.
    append wa_upload1 to i_upload1.
    endloop.
    else.
    append wa_upload1 to i_upload1.
    endif.
    else.
    append wa_upload1 to i_upload1.
    endif.
    ENDFORM. " f_split_upload_data
    *& Form f_call_bapi
    text
    --> p1 text
    <-- p2 text
    FORM f_call_bapi.
    clear wa_upload1.
    wa_header-material = p_matnr.
    wa_header-plant = p_werks.
    wa_header-bom_usage = p_stlan.
    append wa_header to i_header.
    wa_bomgroup-bom_usage = p_stlan.
    wa_bomgroup-created_in_plant = p_werks.
    append wa_bomgroup to i_bomgroup.
    wa_variant-alternative_bom = 1.
    wa_variant-base_qty = 1.
    wa_variant-valid_from_date = sy-datum.
    append wa_variant to i_variant.
    loop at i_upload1 into wa_upload1.
    wa_item-item_no = wa_upload1-col1.
    wa_item-item_cat = wa_upload1-col2.
    wa_item-component = wa_upload1-col3.
    wa_item-comp_qty = wa_upload1-col4.
    append wa_item to i_item.
    wa_subitem-subitem_qty = '1'.
    wa_subitem-installation_point = wa_upload1-col5.
    append wa_subitem to i_subitem.
    endloop.
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
    EXPORTING
    TESTRUN = ' '
    ALL_ERROR = ' '
    TABLES
    BOMGROUP = i_bomgroup
    VARIANTS = i_variant
    ITEMS = i_item
    SUBITEMS = i_subitem
    MATERIALRELATIONS = i_header
    ITEMASSIGNMENTS =
    SUBITEMASSIGNMENTS =
    TEXTS =
    RETURN = i_return.
    if i_return[] is initial.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    *write: /'BOM created:', stpo-stlnr.
    else.
    *if not i_return[] is initial.
    loop at i_return.
    IF i_return-TYPE = 'E'.
    errmsg-type = i_return-type.
    errmsg-line = i_return-message.
    append errmsg.
    ULINE /1(108).
    write:/ icon_led_RED as icon, i_return-MESSAGE.
    ULINE /1(108).
    ENDIF.
    IF i_return-TYPE = 'W'.
    errmsg-type = i_return-type.
    errmsg-line = i_return-message.
    append errmsg.
    ULINE /1(108).
    write:/ icon_led_YELLOW as icon, i_return-MESSAGE.
    ULINE /1(108).
    ENDIF.
    ENDLOOP.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    *write: /'Error'.
    endif.
    ENDFORM. " f_call_bapi

    Hi shashi,
    Thanks for ur help.i tried after passing the group but it is giving same error.
    i am getting the error
    "Error/warning when checking the structure of the BOM group with ID= test"
    i am gettig the above error when i put bomgroup-bom_group_identification = 'TEST'.
    whatever i am putting in this field, the same error is comming having different value.
    if i put--- bomgroup-bom_group_identification = ' '. then i will get error
    "Error/warning when checking the structure of the BOM group with ID=
    if i omit that field, then also , i am getting same error.
    plz suggest what r the fields i need to pass for BOMGROUP structure for that bapi?
    regards
    pabitra

  • Bapi or Function module for getting Bom Item Details (Urgent)

    Hi All,
    I Want to get the Bom Item Details Corresponding to Production Order Number.
    So Please Provide me Some Function Module or Bapi So that by giving the
    Production Order number I will get all material related to that PO.
    Thanks In Advance.

    Hi,
    use the function module.
        call function 'CS_BOM_EXPL_MAT_V2'
          exporting
            capid                 = 'STD1'
            datuv                 = sy-datum
            mktls                 = 'X'
            mehrs                 = 'X'
            mmory                 = '1'
            mtnrv                 =  matnr
            werks                 = werks
          tables
            stb                   = it_stb2
            matcat                = it_matcat
          exceptions
            alt_not_found         = 1
            call_invalid          = 2
            material_not_found    = 3
            missing_authorization = 4
            no_bom_found          = 5
            no_plant_data         = 6
            no_suitable_bom_found = 7
            others                = 8.
    Regards,
    Sankar.

  • BOM Item Category (urgent)

    HI SAP Gurus,
    We have an issue in BOM.
    At first we cannot explode our BOM. The main item is in Item Category of NORM. So what we did is to change the Item Category group to ERLA. As I understand, If we use ERLA, the price will be in the Main Item and the component has no price.
    1. Is this set up in CS01 is possible/correct?
    Main Item 123
    components as:
    Item 10 material 123
    Item 20 material 456
    Item 30 material 789.
    2. Our configuration in Customizing: Assignmet of Item Category as:
    Sales Doc type     Item Cate Grp                         High Level                          Default Item Cat
    OR           ERLA                    TAP
    OR          ERLA          TAP          TAN
    With this config, I tried/tested sales order creation and the result becomes:
    Item 10     material 123     TAP
    Item 20     material 123     TAN
    Item 30     material 456     TAQ
    Item 40     material 789     TAQ
    Item 10 and 20 has a price which should not be since the only acceptable item to have a price is on Item 10 (main item) only. Also, Items 10, 30 and 40 keeps on asking for weight but item 20 already has. I checked in material master, and the weights were maintained correctly.
    3. I also tried to change the config to:
    Sales Doc type     Item Cate Grp                          High Level                          Default Item Cat
    OR           ERLA                    TAP
    OR          ER          TAP          TAQ
    The Item 20 of sales order has now Item Cat of TAQ. However, it still asks for weight for 10, 30 and 40. But is now asking for price in Item 20 (w/c for me is correct).
    Now the problem is in Delivery. The Pick Quantity column for Item 10 is disabled.
    I really need help on this one. Immediate response is highly appreciated. Points will be rewarded.
    Thank you so much for the help and taking time to read my questions/issues.

    HI Erza29,
    BOM can be done in 2 ways
    ERLA -(Above structure material)
    --IItem category group Header item is TAQ
    --Item category group Sub item is TAE
    LUMF -(Below Structure Material)
    --Item category group Header item is TAP
    --Item category group Sub item is TAN
    --Do the assignment of Item Category in VOV4 as follow
    Sales Doc typeItem Category Group Default Item Category
    OR+ ERLA+ TAQ
    Sales Doc typeItem Category Group High Level     + Default Item Category
    ORERLATAQ+TAE
    --Go to MM02 in sales organization2 tab you have to change the item category group as ERLA & save it.
    --Go to T.Code CS01
    Main Item 123
    components as:
    Item 10 material --123
    Item 20 material --456
    Item 30 material 789.
    --Go to T.Code VK11 & enter the condition type
    --Here the sub item prices should be equal to the main item price.
    Main Item 123---1000-Price
    Item 10 material 123300 Price
    Item 20 material 456400 Price
    Item 30 material 789--300 Price
    --Raise the sale order in VA01 & enter the main item material & qty
    --Click on  item overview here you can see the sub items with the main item & you can see the  price & weight only for the main item not for the sub items.
    --Item category will be TAQ for main item & Sub item is TAE
    --In ERLA concept we do pricing & delivery only for the header item only.
    --IN LUMF it is Vice Versa.
    Let me know if your problem is solved
    Regards
    Pradeep

  • BOM - Item Number (Urgent)

    Hi All,
    In BOM (CS03), the first column refers to BOM Item number & i find it having 4 digits at the moment. I would like to know is it possible to increase this to say 6 or 8 digits, if it is possible, please let me know how i can do the same & also what is the limit for the same.
    Hope my problem is clear, await inputs.
    Vivek

    Dear Vivek,
    I'm not sure abotu this,but the increment which's default as 0010,0020 can be
    changed as per the user Id.That's what Mr.Vijayprasad Shanmugham has
    mentioned which can be done in OS29.
    If possible try to post this thread in ABAP forums,I hope they can give a better
    solution for this.
    Regards
    Mangal

  • VA02 Urgent Help Required

    Hi,
    The functionals have configured Sales Order to Explode BOM when a material is inserted e.g. Material Type Crates of bottles as CRT.
    Now if they enter Material Type Bottles i.e BT then BOM is also exploding and it is putting the BOM values in the Order too.
    I want this BOM to be executed on only Material Type CRT, not on any others.
    What can i do i mean is there any configuration procedure or any enhancement or BADI to perform this task.
    Thanks in Advance and Rewards will be given.

    akshayaggarwal2 wrote:
    hi i use a nokia E62 device and i am not able to install any jar or jad file on it. i am able to instal all sis and sisx applications without any trouble.it gives an error-unable to install when ever i try to install any jar file.
    Does it make no difference if you try to install application via PC Suite rather than directly?
    Happy to have helped forum with a Support Ratio = 42.5

  • Insert new line item in va01&va02 - urgent

    Hi frndz,
    At the time of creation standard sales order using va01.
    When user enters the sold to party in header and then
    material & quantity in line item reocrds. After user enters the details in first line. I have some checks to be executed and on the basis of that customer will get the free material that should come on second line item.
    I am getting the details which i will be inserting on new line item but the problem is that in which exit i should write the code for the same.
    So frndz could you please let me know, in which userexit I should insert this new line item. There can be more than one free material.
    If anyone has done this already, please let me know.
    I know one exit i.e.MV45AFZB but in that there are many forms. so exactly which form i should where i will write the code to insert new line item???
    Points will be awarded surely.
    Regards,
    Prashant

    HI Stephen,
    I have the same prolem. I modified the 5 global tables, but I don't see the new line in the screen.
    Can you help me with some details?
    Thx!
    Mihaela

  • User exit for VA02  - Urgent Please

    Hi,
    I got a requirement to develop USEREXIT for the sales district (Vbkd-bzirk) validation based on item category.
    It is for ITEM level i have to check the user entered value with my newly developed ztable.
    Can any one tell me whether MV45afzz is the suitable user exit for this requirement and what is the approach.
    Also please importantly tell me the structure will have the value in runtime
    Points guaranteed
    Regards,
    Raghu

    Yes, MV45AFZZ will be suitable for the same. Please have a look at below link for details about the same.
    http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • To Grey out the material , item catagory and qty for BOM items.

    Hi,
      I have situtation where we need to block the changes for the BOM sub items when change of sales document(VA02). Ultimately user should not be able to change the sub items of BOM in VA02.

    Hi Ramakrishna Garapati,
    You can gray off the BOM sub items ultimately this will enable who ever has this profile to use va02, they will not be able to do any changes, if required also. This will restrict everybody under this profiles. In case you need to do some change it does not allow.
    The best possible way is to restrict the user from Transaction VA02, and make it authorized Tcode, i.e. when required need to take the authorisation and do the necessary changes, this way it is tracked.
    We had similar kind of issue, now restricted from using VA02, once authorized you get different login/pwd, specially for that point of time. Once changes done your pwd expires.
    Regards,
    Harish.

  • Tcode for block and unblock for the  material

    Hi Guru's
      What are the t-codes for blocking the material
      and to unblock the material.
    Thanks in advance.
    Rgds

    HI u can block material in material master as informed in one of above thread in T-CODE : MM17 as well in T-CODE : MASS.
    Re: BOM - block status (Urgent)
    Message was edited by:
            SHESAGIRI.G

  • For one Urgent Change during performing the Approval(chnging the status to 'To be Tested') system does not recognize any changes using the CTS WBS BOM in the development system. The transaction is therefore incorrect or the status was reset by the system.

    For one Urgent Change while performing the one of the Approval before changing the status to 'To Be Tested'
    We are getting below error.
    The system does not recognize any changes using the CTS WBS BOM in the development system. The transaction is therefore incorrect or the status was reset by the system.
    COuld anyone please help us to know, How it can be resolved?
    We also have this below error.
    System Response
    If the PPF action is a condition check, the condition is initially considered as not met, and leads to another warning, an error message, or status reset, depending on the configuration.
    If the PPF action is the execution of a task in the task list, and the exception is critical, there is another error message in the document.
    Procedure
    The condition cannot be met until the cause is removed. Analyze all messages in the transaction application log.
    Procedure for System Administration
    Analyze any other messages in the task list application log, and the entries for the object /TMWFLOW/CMSCV
    Additional Information:
    System cancel RFC destination SM_UK4CLNT005_TRUSTED, Call TR_READ_COMM:
    No authorization to log on as a trusted system (Tr usted RC=0).
    /TMWFLOW/TU_GET_REQUEST_REMOTE:E:/TMWFLOW/TRACK_N:107
    For above error Table /TMWFLOW/REP_DATA_FLOWwas refreshed as well but still the same error.

    If you are in Test System, you can use function module AA_AFABER_DELETE to totally delete the depreciation area (tcode SE37, specify chart of depreciation and depreciation area), After that recreate your depreciation area and run AFBN. But before you do that, have you created a retirement transaction type that limits the posting on your new depreciation area? If not create one.
    Hope this helps.
    Thanks!
    Jhero

  • *URGENT -Alternate BOM selection in MRP*

    Dear gurus
    I have an urgent requirement regarding alternate bom selection.
    our scenarion is complete subcontracting and no production versions are maintained and for suppose i have a product X which has 3 alternative boms during the sales order creation iam able to select the required alternative but during the mrp run the system is selecting the alternative "1" by default.I want that during the mrp run also the system should explode the bom which  i have selected during the sales order creation not the alternate "1".
    please reply.
    regards
    Kumar

    Dear Dharma
    in my previous post I havent got suitable reply from my previous post so i have posted again waiting for answers.
    regards
    Kumar

  • Please help urgently-VA02

    Hi,
      I have one urgent requirement, We have a condition type of ZFI2, ZFI3, ZFI4. My requirement is if the user enters this values, if ZFI2 having value that time no need to contion types in VA02. If ZFI2 is Zero and ZFI3 having the values then it will display the ZFI3 only in the condition type, the samething for ZFI4.
      I tried the program RV64A811. Can anyone please guide how to hide the condition types in sales order screen.
    plz its urgent.
    Point will be sure
    Mohana.

    Hello Mohan,
    Okies. I will assume that in your pricing procedure will be have the Condition type in the following Sequence ZFI1, ZFI2 ....and so on till ZFIN (N being ypur last condition type say ZFI6. In the Routine form userexit_xkomv_bewerten_end in the RV61AFZB.
    Read table xkomv INTO WF_KOMV  with KSCHL = 'ZFI6'.
    IF WF_KOMV-KWERT NE 0.
      DELETE FROM XKOMV WHERE KSCHL IS EQUAL TO  PREVIOS ONES
      SAY  ZFI5, ZFI4 ....ZFI1.
    ELSE.
    Read table xkomv INTO WF_KOMV  with KSCHL = 'ZFI5'
    DELETE FROM XKOMV WHERE KSCHL IS EQUALTO  PREVIOS ONES
      SAY  ZFI4, ZFI3 ....ZFI1.
    and so on..
    Regards
    Saket Sharma
    null

  • Simple BOM with sub-items (very very urgent)--1 item & 2 subitem

    Hi all,
    i am creating a BOM with sub-items using  'BAPI_MATERIAL_BOM_GROUP_CREATE'. while  creating sub-item, it is taking only one subitem. but i am giving multiple sub-items per item.
    i am giving a program where i am assigning 2 subitems to one item.
    after tha bapi call, 1 subitem is creating.
    i have tried so many times by clearing the work area & calling the bapi for each sub-item.but it is creating only one sub-item only.
    i am giving an example of my report.plz correct it if i am wrong.it is veryt very urgent.
    any idea will be highly appreaciated.
    Regards
    pabitra
    REPORT ZTEST_CHIN message-id 01.
    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,
        it_subitems LIKE bapi1080_sui_c OCCURS 0 WITH HEADER LINE,
        it_subitemas LIKE BAPI1080_REL_SUI_ITM_C 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 = 'BGR'.
    it_bomgroup-object_id = 'SIMPLE1'.
    it_bomgroup-bom_usage = '1'.  " YOU COULD CHANGE THE BOM USAGE TO YOUR
    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-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 = '1.000'.
    it_variants-valid_from_date = sy-datum.
    it_variants-function = 'NEW'.
    APPEND it_variants.
    Details of the materials of the different variants
    CLEAR it_matrel.
    it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
    it_matrel-material = 'BAPIBOMFG1'.
    it_matrel-bom_usage = '1'.
    it_matrel-alternative_bom = '01'.
    APPEND it_matrel.
    Linking subitems to the corresponding variants
    CLEAR it_subitemas.
    it_subitemas-bom_group_identification = 'BAPI_SMP_COL1'.
    it_subitemas-sub_object_type = 'SUI'.
    it_subitemas-sub_object_id = 'SIM1'.
    it_subitemas-super_object_type = 'ITM'.
    it_subitemas-super_object_id = 'SIMPLE1'.
    APPEND it_subitemas.
    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 = 'NEW'.
    APPEND it_itemas.
    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 = 'BAPIBOMRW1'.
    it_items-comp_qty = '2'.
    it_items-valid_from_date = sy-datum.
    APPEND it_items.
    CLEAR it_subitems.
    it_subitems-bom_group_identification = 'BAPI_SMP_COL1'.
    it_subitems-object_type = 'SUI'.
    it_subitems-object_id = 'SIM1'.
    it_subitems-subitem_no = '0001'.
    it_subitems-INSTALLATION_POINT = 'ab1'.
    it_subitems-subitem_qty = '1'.
    APPEND it_subitems.
    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
        subitems          = it_subitems
        subitemassignments = it_subitemas
        return            = it_return.
    CLEAR it_subitems.
    it_subitems-bom_group_identification = 'BAPI_SMP_COL1'.
    it_subitems-object_type = 'SUI'.
    it_subitems-object_id = 'SIM1'.
    it_subitems-subitem_no = '0002'.
    it_subitems-INSTALLATION_POINT = 'ab2'.
    it_subitems-subitem_qty = '1'.
    APPEND it_subitems.
    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
        subitems          = it_subitems
        subitemassignments = it_subitemas
        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.

    Hi rich,
    Thanks. i will do the same.can u plz suggest me , where i am doing mistake in my coding to create sub-items in a BOM?
    Thanks & Regards
    pabi

  • BAPI FOR BOM - URGENT

    Could anybody please give me the coding for uploading BOM by BAPI ? Please it is very urgent.
                                                             Regards,
                                                             SAURAV  LAHIRY

    Hi Saurav,
    Try the following Code.
    REPORT  ZTEST_BOM_BAPI.
    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 = 'BGR'.
    it_bomgroup-object_id = 'SIMPLE1'.
    it_bomgroup-bom_usage = '1'.  " YOU COULD CHANGE THE BOM USAGE TO YOUR
    *nEEDS
    *it_bomgroup-created_in_plant = '0001'.
    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-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 = '1.000'.
    it_variants-valid_from_date = sy-datum.
    it_variants-function = 'NEW'.
    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 = '000000000000000078'.
    it_items-comp_qty = '1'.
    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_items-item_no = '0020'.
    it_items-item_cat = 'L'.
    it_items-component = '000000000000000076'.
    it_items-comp_qty = '2'.
    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 = '000000000000000077'.
    *it_matrel-plant = '0001'.
    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 = 'NEW'.
    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.
    Reward if useful.
    Thanks and Regards,
    Maddineni Bharath.

Maybe you are looking for