BAPI_MATERIAL_BOM_GROUP_CREATE with subitems.

Dear ABAPers,
       I want to create the BOM with the Subitems.Can anyone send me the Sample code.      
Thanks & Regards,
Ashok.

hi ashok,
* 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 = 'BGR'.
it_bomgroup-object_id = 'SIMPLE1'.
it_bomgroup-bom_usage = '5'. " 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-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 = 'COMPON1'.
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_items-item_no = '0020'.
it_items-item_cat = 'L'.
it_items-component = 'COMPON2'.
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 = 'MAINMATERIAL'.
it_matrel-bom_usage = '5'.
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.
regards,
sandeep

Similar Messages

  • BOM Creation with SubItem

    Does anyone has readymade code for creating Material BOM with SubItems.
    I have this sample code (I got this from web and changed to add subitem logic) which is creating subitems.
    but I have 2 problems.
    1. The Subitems get created for all the components.
    2. The code is written to create multiple subitems but only create 1 subitem.
    I am new to ABAP, just stared a month back. Any help is appreciated.
    My Sample Code:
    REPORT  y_bapi3.
    This code will create a material BoM for the material
    LSMWTEST12 with the components LSMWTEST14 and LSMWTEST50.
    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_subitems  LIKE bapi1080_sui_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_subitemas LIKE BAPI1080_REL_SUI_ITM_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-CREATED_IN_PLANT = '1000'.
    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 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 = 'LSMWTEST14'.
    it_items-comp_qty = '2.00'.
    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 = 'LSMWTEST50'.
    it_items-comp_qty = '3.00'.
    it_items-valid_from_date = sy-datum.
    APPEND it_items.
    *Details of the subitems of the variants
    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.
    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.
    Details of the materials of the different variants
    CLEAR it_matrel.
    it_matrel-bom_group_identification = 'BAPI_SMP_COL1'.
    it_matrel-material = 'LSMWTEST12'.
    it_matrel-plant    = '1000'.
    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.
    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.
    Create variants
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
      EXPORTING
        all_error          = 'X'
      TABLES
        bomgroup           = it_bomgroup
        variants           = it_variants
        items              = it_items
        subitems           = it_subitems
        materialrelations  = it_matrel
        itemassignments    = it_itemas
        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.
    -Uday Malgundkar

    Hi uday,
    i am facing the same problem while creating multiple sub-items per item.can u plz suggest me for this issue?
    only one subitem is creating for each item .This bapi is not taking multiple sub-items.i tried , by passing this bapi for each subitem & clearing the subitem field for each time. but only one sub-item is creating.
    can u plz give any sample code where sub-item details will be there?
    ur help will be highly appreaciated.it is urgent yar.
    Thanks & Regards
    pabitra

  • Need to create a menu with subitems similar to OTN main page bar menu

    Hi,
    Using Jdev 11.1.1.5
    I need to create a menu bar with simple sub-items (set of links to other sites or pages) similar to what OTN main page uses.
    The menuBar with subitems shown in the ADF demo site is close but doesn't look like as OTN i.e. set of tab/boxes.
    Link to the ADF demo with menuBar:
    http://jdevadf.oracle.com/adf-richclient-demo/faces/feature/index.jspx?_afrRedirect=3119879384215420#%2Fcomponents%2FmenuBar%2Felectronics.jspx%40%3FAdf-Window-Id%3Dw0
    Not sure which ADF component to use?
    Thanks

    Thanks Shay. I think skinning would be simpler and will make use of the provided components in ADF, but I haven't done any work with skinning but did use CSS so not sure how simple to figure this out.
    Most of the commercial web site uses tabs/boxes as I am trying to do. It will be nice to have ADF component or simple solution.
    Thanks

  • SD Overwrite condition type value of subitem with value of mainitem

    Hi,
    Suppose we have a sales order with a material and a submaterial. On the head material a condition record for according a reduction is found. On the submaterial also but it's different.
    Our requirement is that if there is a submaterial, the reduction on the submaterial should always be equal to the head material. I.o.w the reduction of the submaterial must be overwritten with the value of the head material.
    I've tried messing around with duplicate condition records and also in some user exits but can't find anything.
    Any ideas on this ?
    with regards

    I didn't use any exit, after creating the sales order, I check if there were substitute materials on the table vbap.
    If you use substitution with subitems you have to do it this way, if you use substitution without subitems you have to do nothing.
    example:
    you enter material A, quantity 10, with subitems you end with a SO
    pos     material         quantity
    10         A                 10        (blocked)
    11         B                 10        (subposition)
    Without subitems you end with a SO like this
    os     material         quantity
    10         B                 10        (all the values you entered in the bapi_sales_order_create are applied to this position)

  • Outbound Deliveries from Collective STO with SLS

    Hi all,
    Has anyone ever successfully created an outbound delivery from a collective STO with SLS sub items?
    All documentation states this is possible and that during delivery creation the SLS items are copied from the collective order to the delivery.
    We have all config setup correctly to create collective orders with SLS, as when we run WF10 we get the correct results in the collective document.
    When we run VL10G from the collective document it creates only with the main item, no sub items are copied over.
    We today found and applied a note which was meant to resolve this exact problem, but it's made no difference at all.  We've double checked the note and all appears to have been applied correctly.   However still got the same issue.
    From what I can see the item categories NLSH is used for the main item and NLSU is for the sub items, as standard for deliveries fro collectives with subitems.
    By debugging  delivery create we found it excluded the subitems due to the fact they were set to delivery completed. This however is how they seem to be created as standard.
    We did manage to "work around" the problem to prove it was possible to have SLS items in a delivery, where the sub items referenced the higher level item in the delivery and that additionals created for it also. 
    We did this by manually unsetting the delivery completed indicator of the SLS subitems in the collective STO by directly editing the record (SE16N) as PO change transactions would not allow subitems to not be set for del complete.
    This created exactly how we expected, with all associated additionals data in WTADAB.
    Problem is in standard code WF10 sets the sub items as delivery complete, so it would appears that either I've got some config incorrect somewhere (possibly in shipping) or this functionality just conflicts with each other and that nobody has reported it before.
    Any help would be great as we've spent a lot of time on this now and getting nowhere fast.
    Many thanks of the support.
    Dave
    Edited by: David King on Feb 27, 2012 9:42 PM

    Hello,
    Using tcode SM13 check if the update task has terminated for the user. From the error, you can see why the update failed.
    Cheers !

  • How do I share files between users on the same machine?

    I tried using /Users/shared to share files between myself (Admin user) and another user on the machine (Standard user). Whenever I put a file or a folder into said directory permissions are 755 for directories and 644 for files, my umask is 0022. The files and directories belong to my user and the group staff. This means I can read and write and others can read. If I do the same using the other users account. Permissions are 700 and 600 respectively. (Owner is the other user and group is staff.) Strangely the other users umask is 0022, too.
    The result is, that all directories and files I create with my account (Admin user) are readable to every other user on the machine, whereas all directories and files the other user (Standard user) creates are not readable for anyone else. I can easily rectify this using the Terminal and chmod and/or chown, but it is a pain having to do this, since I also need to forcefully restart the Finder App for it to notice the changed permissions.
    Ideally I'd like all directories in /Users/Shared to have permissions 777 and all files 666 no matter which user created, copied or moved them to said location. I think this could possibly be done using applescript and shellscripting and the folder action hook. So far my attempts to find such a script on the net or/and write it myself have failed. I'd be grateful for any hints how I:
    a) write and setup such a script
    b) accomplish what I try to do (share files and folders on the same machine) in another possibly more Mac way
    Kind regards
    David

    The following AppleScript will recursively descend the directory tree and change the items to your modes:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on adding folder items to this_folder after receiving these_items
    repeat with some_item in these_items
    ProcessStuff from some_item
    end repeat
    end adding folder items to
    to ProcessStuff from SomeItem
    processes items contained in SomeItem, recursively descending the directory tree
    parameters - SomeItem [mixed]: an item containing the items to process
    returns nothing
    set SomeItem to SomeItem as text
    set FileInfo to (info for SomeItem as alias)
    if (folder of FileInfo) and not (package folder of FileInfo) then -- a folder (not a package)
    do shell script "chmod 666 " & quoted form of POSIX path of SomeItem
    -- do shell script "chown root:staff " & quoted form of POSIX path of SomeItem user name "me" password "mypassword" with administrator privileges
    try -- to get items in the folder
    tell application "Finder" to set SubFolder to (items of folder SomeItem)
    on error
    return {}
    end try
    repeat with SubItem in SubFolder -- process the sub items
    ProcessStuff from SubItem
    end repeat
    else -- a file
    do shell script "chmod 777 " & quoted form of POSIX path of SomeItem
    -- do shell script "chown root:staff " & quoted form of POSIX path of SomeItem user name "me" password "mypassword" with administrator privileges
    end if
    return
    end ProcessStuff
    </pre>
    You shouldn't need to change the ownership, so I commented out the chown shell script since this would need to be run as a super user. You can run a shell script with administrator privileges, but in order to be used by a standard user you will need to provide the appropriate user name and password in the script, which might not be a good idea - note that the folder action script will need to be attached in all accounts that you want to change the permissions, which means that it would need to be accessible to those accounts.

  • Automate Creation of Folder based on Filename

    Hi,
    I am a total newbie to Automator, and although I have some programming background, I have not wrapped my brain around how this wonderful tool works yet. I need to perform a task on several hundred files and I need to do it soon, so no time to learn and play with Automator right now.
    I was wondering if someone can give me a true step by step instructions for creating a script that will do the following:
    This is how I would like the flow to behave:
    1. I select a file and run the script (hopefully based on a keystroke). The script will then:
    2. Create a new folder in the same directory as the file.
    3. Name the new folder based on the filename (minus the extension) of the above selected file.
    4. Move the selected file into the new folder.
    So basically I am enveloping the selected file in a new folder that is named the same as the file itself (minus the extension).
    Thank you in advance.

    OK, I reworked and tested it, so I think I've got all the oddities found. I wound up just using an AppleScript, since about the only thing Automator was used for was getting Finder Items (and it didn't do so well at that). Paste the script into the Script Editor and save it as an application (make sure the Startup Screen option is unchecked). You can either drop items on it or double-click it, in which case it will prompt for items. Document files are the only things processed, and packages/bundles are handled correctly (getting subfolders will not go into them), so you don't have to worry about things like application bundles and .rtfd files.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- make new folders with the name of document files, then move them into their respective new folders
    -- the following properties affect the operation of the script
    property GetFiles : false -- get individual files?  true chooses files, false chooses folders
    property GetSubFolders : true -- get contents of subfolders?  true gets contents of subfolders, false skips them
    property DestinationFolder : "" -- if a folder path is specified, it is used as the destination for file moves
    on run -- application double-clicked
    if GetFiles then
    choose file with prompt "Choose a file:" default location (path to desktop) with multiple selections allowed without invisibles
    else
    choose folder with prompt "Choose a folder:" default location (path to desktop) with multiple selections allowed without invisibles
    end if
    open the result
    end run
    on open TheItems -- items dropped onto the application
    if DestinationFolder is not missing value then try -- verify destination path
    DestinationFolder as alias
    on error
    set DestinationFolder to (choose folder with prompt "Invalid destination folder path - where do you want to move the items?")
    end try
    set SkippedItems to {} -- this will be a list of skipped items (errors)
    set TheFiles to {} -- this will be a list of items to process
    repeat with AnItem in TheItems -- expand folders
    set AnItem to the contents of AnItem
    set FileInfo to (info for AnItem)
    if (folder of FileInfo) and not (package folder of FileInfo) then -- a folder
    if GetSubFolders then
    repeat with SubItem in (ListFiles from AnItem)
    set the end of TheFiles to (contents of SubItem)
    end repeat
    else
    tell application "Finder" to (get files of AnItem) as alias list
    set TheFiles to TheFiles & the result
    end if
    else
    set the end of TheFiles to AnItem
    end if
    end repeat
    repeat with MyFile in TheFiles -- do stuff with the resulting items
    set {TheClass, TheName, TheExtension, TheContainer} to (GetTheNames from MyFile)
    if TheClass is «class docf» then try -- just document files
    tell application "Finder"
    if DestinationFolder is not missing value then
    make new folder at DestinationFolder with properties {name:TheName}
    else
    make new folder at TheContainer with properties {name:TheName}
    end if
    move MyFile to the result
    end tell
    on error ErrorMessage -- the folder already exists, permissions, etc
    log ErrorMessage
    set the end of SkippedItems to (TheName & TheExtension)
    -- set the end of SkippedItems to (AnItem as text) -- the full file path
    end try
    end repeat
    if SkippedItems is not {} then -- handle skipped items
    set AlertText to "Error with moving files to folders"
    if (count SkippedItems) is greater than 1 then
    set TheMessage to ((count SkippedItems) as text) & space & "items were skipped:"
    else
    set TheMessage to "1 " & "item was skipped:"
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
    display alert AlertText message TheMessage & return & SkippedItems
    end if
    end open
    to GetTheNames from SomeFile
    get a class, name, extension, and container from a file path
    parameters - SomeFile [mixed]: a file path
    returns [list] - item 1 [constant]: the class of the file object
    item 2 [text]: the name of the file
            item 3 [text]: the .extension (if no extension, the value returned is "")
    item 4 [alias]: the containing folder of the file
    set SomeFile to SomeFile as alias -- the Finder likes aliases
    tell application "Finder"
    set TheClass to class of (get properties of SomeFile)
    set TheName to name of SomeFile
    set TheExtension to name extension of SomeFile
    if TheExtension is in {missing value, ""} then
    set TheExtension to ""
    else
    set TheExtension to "." & TheExtension
    end if
    set TheName to text 1 thru -((count TheExtension) + 1) of TheName -- just the name part
    set TheContainer to (container of SomeFile) as alias
    end tell
    return {TheClass, TheName, TheExtension, TheContainer}
    end GetTheNames
    to ListFiles from SomeItem
    return a list of files contained in SomeItem, drilling down into subfolders (not packages)
    parameters - SomeItem [mixed]: the item to get the contents of
      returns [list]: a list of aliases
    set {FilesList, SomeItem} to {{}, SomeItem as text}
    set FileInfo to (info for SomeItem as alias)
    if (folder of FileInfo) and not (package folder of FileInfo) then -- a folder
    try
    tell application "Finder" to set SubItems to (items of folder SomeItem)
    on error
    return {}
    end try
    repeat with AnItem in SubItems -- drill down
    set FilesList to FilesList & (ListFiles from AnItem)
    end repeat
    else
    set the end of FilesList to (SomeItem as alias)
    end if
    return FilesList
    end ListFiles
    </pre>

  • Some EC-CS features not found in BCS

    Hello,
    in EC-CS there are two quite important features which don't see in BCS. They are:
    1) Multy-period consolidation (for consolidation several periods at once).
    In budget consolidation it's often required to consolidate annual figures in monthly detail. Due to the fact BCS can't process several periods at once, we have to perform consolidation 12 times per budget. Has anybody got experience how to simplify the procedure? I guess multy period consolidation in EC-CS was the standard way to do this.
    2) Equity aging report settings in CoI.
    In BCS I can't see the way to post to MI items with subitem breakdown, in other words to map CoI activities to movement types (which was possible in EC-CS). This is required for Shareholder's equity report where each equity item (including MI) must be broken down by movement type. What are practical recommendations?
    Thank you

    Dan, thanks for clarification.
    Alexey,
    Knowing how sophisticated the stockholders equity report might be in the former SU countries, I see here 2 issues: 1) a construction of the report itself, in general and 2) breaking down the MI.
    Issue #1, IMHO, is to be solved by proper combination of items/subitems and movement types. MoveTypes might be assigned/determined in different stages of data flow: in ECC, manually, during data load to/from staging cube, in BCS. Everything is dictated by the complexity of the report and the dataflow features.
    Issue #2. Frankly, I do not think that a reclass might help you to get what you need. Probably, sufficient number of subitems in equity and items for counterpart MIs would service better.
    And a little advice reg. you BEx query -- it's not necessary to use cell editor. You may use the following trick.
    Set several equity items in a column. And one of this items and a specific MoveType in a row (setting up the item is optional). Doing so, you'll get amount of this (row) item  accompanied by the determined MoveType on the intersection of a column and a row. Most likely, just in one cell only. It's much easier than using the cell editor.

  • Free Item Indicator on PO and SAP standards

    Hi,
    1. I'm trying to find the 'free item' indicator on my PO, but I'm not sure where it can be found. Where on the screen would this be located? Can I not find it because it's not configured in SPRO?
    2. Just to confirm, say company X receives 110 items when they made a PO for 100. 10 items are free. Is the SAP standard to GR 100 and make a PO for 10 free items, and then finally GR these 10 free items?
    I've searched on the forum but couldn't come up with anything.
    Thanks in advance,

    Hi,
    According to the description, the scenario can be achieved by "free goods item" via condition
    NR00 in info record.
    1. you allow "grant discount in kind" in vendor master-> purchasing view
    2. allow "Qual.f.FreeGoodsDis" in material master-> purchasing view
    3. in info record-> condition screen->press "Free goods" button, and maintain the condition
        NR00 for example 100 PC/10 PC free.
    4. customizing
        OLME
        ->Discount in Kind (Discount in Form of Bonus Goods)
        ->Define And Assign Discount-in-Kind Schema
        ->Determine Free Goods Schema
        set schema = NR0001 for "purchase group"/"Calculation Schema" combination
    Then when creating PO with quantity 100 PC, apart from the main item, there would be another
    subitem with "subitem category" = 4 derived by system automatically.
    When doing the GR, 2 lines will be proposed, however only main item will be reflected in
    accounting.
    When doing invoice, also only the main item will have amount.
    Hope it helps.
    Thanks and regards,
    Polly

  • Menu at right from tab in eb3

    How can I add a menu button with subitems to my extensión in Illustrator CC in from JS or JSX?
    Something like this:

    Please check out the Flyout menu feature in CEP. The following sample shows its capabilities:
    Samples/CEPFeatures.html at master · Adobe-CEP/Samples · GitHub

  • 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

  • BOM Cretion error with BAPI : BAPI_MATERIAL_BOM_GROUP_CREATE

    Dear All,
    Desc:
    Here i am trying to create a BOM with differnet componants :
    i am getting the below error while creating the BOM in varient alternative..
    W BAPI1080             028
    Error/warning when checking the structure of the BOM group with ID=BOMGROUP1
    A BAPI1080             010
    Variant/alternative 01 can only occur once with the function NEW
    A BAPI1080             010
    Variant/alternative 01 can only occur once with the function NEW
    A BAPI1080             010
    Variant/alternative 01 can only occur once with the function NEW
    Please find the below code:
    Code:
    To get SC details
    Get Plant details
    SELECT  * FROM y27d_dc_marc
           INTO TABLE l_t_y27d_dc_marc
          WHERE instnr = '552'.                                 "instnr
    IF sy-subrc = 0.
      SORT l_t_y27d_dc_marc BY werks.
    ENDIF.
    IF l_t_y27d_dc_marc IS NOT INITIAL.
    Get all Regions
      SELECT  * FROM y27d_dc_dt_plant
             INTO TABLE l_t_y27d_dc_dt_plant
             FOR ALL ENTRIES IN l_t_y27d_dc_marc
             WHERE werks = l_t_y27d_dc_marc-werks.
    ENDIF.
    Read the SC Details
    READ TABLE l_t_y27d_dc_dt_plant
               INTO l_r_y27d_dc_dt_plant
         WITH KEY werks_typ = g_c_sc.                           "SC
    IF sy-subrc = 0.
    Populate SC details
      g_f_sc_plant = l_r_y27d_dc_dt_plant-werks.
    ENDIF.
    Material BoM Group Header Data
    l_r_bomgroup-bom_group_identification = 'BOMGROUP1'.
    l_r_bomgroup-object_type              = 'BGR'.
    l_r_bomgroup-object_id                = 'BOMGROUP1'.
    l_r_bomgroup-bom_usage                = '1'. " YOU COULD CHANGE THE BOM USAGE TO YOUR needs
    Plant assignment for the corresponding group
    l_r_bomgroup-created_in_plant         = g_f_sc_plant.       "'0470'.
    l_r_bomgroup-ltxt_lang                = sy-langu.
    l_r_bomgroup-technical_type           = 'M'.                     "  bomgroup-technical_type           = wstzu-stlty.
    l_r_bomgroup-bom_text                 = 'Test for BOM YSPR'.
    APPEND l_r_bomgroup TO l_t_bomgroup.
    CLEAR l_r_bomgroup.
    DATA : l_f_var_alter TYPE stalt,
           l_f_var_alter_cnt TYPE stalt.
    Get BOM Item details
    SELECT * FROM y27d_dc_bom
             INTO TABLE l_t_bom_item
             WHERE instnr = '552'.
    IF sy-subrc = 0.
    DESCRIBE TABLE l_t_bom_item LINES l_f_var_alter.
    Populate item data
      LOOP AT l_t_bom_item INTO l_r_bom_item.
    Varient alternative for all the corresponding componants
        l_f_var_alter = sy-tabix.
    Details of the items of the variants
        l_r_itemdata-bom_group_identification    = 'BOMGROUP1'.
        l_r_itemdata-object_type                 = 'ITM'.
        l_r_itemdata-object_id                   = l_r_bom_item-bcomponant. "'MDTRAW2011'
        l_r_itemdata-item_no                     = l_r_bom_item-bitemno."'0010'.
        l_r_itemdata-item_cat                    = l_r_bom_item-bitemcat.    "'L'.
        l_r_itemdata-component                   = l_r_bom_item-bcomponant. "'MDTRAW2011'.
        l_r_itemdata-comp_qty                    = l_r_bom_item-bquan."'2'.
        l_r_itemdata-valid_from_date             = sy-datum.
        APPEND l_r_itemdata TO l_t_itemdata.
        CLEAR l_r_itemdata.
    Item componant assignment to a variant/alternative
        l_r_variants-bom_group_identification = 'BOMGROUP1'.
        l_r_variants-object_type              = 'BOM'.
        l_r_variants-object_id                = l_r_bom_item-bcomponant.  "'MDTRAW2011'.   "'BOM1'.
        l_r_variants-alternative_bom          = '01'.
        l_r_variants-bom_status               = '01'.
        l_r_variants-base_qty                 = '100'.
        l_r_variants-valid_from_date          = sy-datum.
        l_r_variants-function                 = 'NEW'.
        APPEND l_r_variants TO l_t_variants.
        CLEAR l_r_variants.
    Item componant assignment to linked items
    Linking items to the corresponding variants
        l_r_itemlink_to_var-bom_group_identification = 'BOMGROUP1'.
        l_r_itemlink_to_var-sub_object_type          = 'ITM'.
        l_r_itemlink_to_var-sub_object_id            = l_r_bom_item-bcomponant.       "'MDTRAW2011'.       "componant linked with varient
        l_r_itemlink_to_var-super_object_type        = 'BOM'.
        l_r_itemlink_to_var-super_object_id          = l_r_bom_item-bcomponant.       "'MDTRAW2011'.       "componant linked with varient
        l_r_itemlink_to_var-valid_from_date          = sy-datum.
        l_r_itemlink_to_var-function                 = 'NEW'.
        APPEND l_r_itemlink_to_var TO l_t_itemlink_to_var.
        CLEAR l_r_itemlink_to_var.
      ENDLOOP.
    ENDIF.
    Get the Header details
    SELECT SINGLE * FROM y27d_dc_mara
                    INTO l_r_bom_head_mara
                    WHERE instnr = '552'.               "instnr
    IF sy-subrc = 0.
    Populate header data
      l_r_bom_head-bom_group_identification = 'BOMGROUP1'.
      l_r_bom_head-material                 = l_r_bom_head_mara-matnr.  "'MDT01022011'.
      l_r_bom_head-plant                    = g_f_sc_plant.     "'0470'.
      l_r_bom_head-bom_usage                = '1'.              "'5'.
      l_r_bom_head-alternative_bom          = '01'.
      APPEND l_r_bom_head TO l_t_bom_head.
      CLEAR l_r_bom_head.
    ENDIF.
    Create BOM
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
      EXPORTING
        all_error         = 'X'
      TABLES
        bomgroup          = l_t_bomgroup          "BOM group
        variants          = l_t_variants          "Varients
        items             = l_t_itemdata          "Item details
        materialrelations = l_t_bom_head          "Header details
        itemassignments   = l_t_itemlink_to_var   "Item lineked to Varient
        return            = l_t_return.
    LOOP AT l_t_return INTO l_r_return WHERE type CA 'AEX'.
      l_f_error = 'X'.
    ENDLOOP.
    IF l_f_error = space.
        Processing successful --> Commit work on PDM system
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ELSE.
        Error in processing --> Rollback work on PDM system
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ENDIF.
    LOOP AT l_t_return INTO l_r_return.
      WRITE:/ l_r_return-type, l_r_return-id, l_r_return-number,
              l_r_return-message.
    ENDLOOP.
    could you please help me to come out of this problem.

    Hi,
    Did you try creating manually through CS01 with the same data? There could be a customization setting to restrict like this.
    Thanks,
    Vinod.

  • BAPI_MATERIAL_BOM_GROUP_CREATE

    Hi
    any step by step procedure of passing data to this function module BAPI_MATERIAL_BOM_GROUP_CREATE ???
    I am  geting errors:
    Item ID= is not assigned to a variant/alternative
    Cheers
    Shakir

    Hello,
    Check this sample code:
    EPORT 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.
    Cheers,
    Vasanth

  • FM: BAPI_MATERIAL_BOM_GROUP_CREATE inquiries?

    My inquiries as bleow:
    1. This function is create BOM group or can be create BOM?
    2. If my requirement include BOM 'Create', BOM 'Change' and BOM 'Delete', this function can be to do these three requirement?
    3. We use 'AFS' and this function support the AFS(Apparel & Footwear Solution ) or not ?
    4. If i want to througth PDM to get BOM data, and to create, change and delete BOM, have any solution to let me reference?
    Thanks a lot!!

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

  • Regarding BAPI_MATERIAL_BOM_GROUP_CREATE

    Dear All,
                  Bom is created with given BAPI_MATERIAL_BOM_GROUP_CREATE. But the issue is while creating multiple subitems for each item. it is creating only one subitem for each item.
    Please let me know regarding this.
    Regards
    Anil

    Hello,
            To create a BOM u can use "CSAP_MAT_BOM_CREATE" this FM.
    CALL FUNCTION 'CSAP_MAT_BOM_CREATE'
          EXPORTING
            MATERIAL                 = MATERIAL
            PLANT                    = N_PLANT
            BOM_USAGE                = '1'
        VALID_FROM               =
        CHANGE_NO                =
        REVISION_LEVEL           =
            I_STKO                   = I_STKO
        FL_NO_CHANGE_DOC         = ' '
        FL_COMMIT_AND_WAIT       = ' '
        FL_CAD                   = ' '
        FL_DEFAULT_VALUES        = 'X'
      IMPORTING
        FL_WARNING               =
        BOM_NO                   =
          TABLES
            T_STPO                   = T_STPO
        T_DEP_DATA               =
        T_DEP_DESCR              =
        T_DEP_ORDER              =
        T_DEP_SOURCE             =
        T_DEP_DOC                =
        T_LTX_LINE               =
        T_STPU                   =
          EXCEPTIONS
            ERROR                    = 1
            OTHERS                   = 2
        IF SY-SUBRC <> 0.
       MESSAGE I001 WITH 'BOM not Created for' MATERIAL.
    elseif SY-SUBRC = 0.
       MESSAGE I001 WITH 'BOM Created for' MATERIAL.
        ENDIF.
    Thanks & Regards,
    Sayali Paradkar

Maybe you are looking for

  • Calculated Key Figures Issue!

    Hello Experts - I'm getting error messages for the calculated key figures. The message says that the key figure is not defined correctly. Therefore, I started breaking down the calculated key figures and use them in the eventual calculated key figure

  • Check transaction authorization

    How to check transaction authorization using Z_AUTH_OBJECT_CHECK  function module

  • Create a Datafile in UNIX

    Hi, In Unix System, File System SAPDATA1,SAPDATA2, SAPDATA3 are Fully Used. Only SAPDATA4 is occupied 97%. Now I want to Create a New File system SAPDATA5 and I want to attach the same to SAP Database. Kinldy Adivce how to proceed with Usefull steps

  • Where can i find fresh new synths for logic 9 ??

    Looking for some new sounds to use ( pads, synths, drum kits ) mainly synths for house music, let me know ! Thanks eric

  • A 205 CD/DVD drive not working, and slow start-up

    My A 205 Satellite laptop no longer recognises its CD/DVD drive.  Drive does not work, though it can be heard spinning when a disc is in it, and it does not show in My Computer.  I have been into the registry and removed the upper and lower filters,