Break implementation of Sales&Distribution FROM Production into phases

I have found this forum very helpful and responsive.  Thanks for all the help.
Due to the requirement of getting the ecommerce site up fast, is it possible to just implement:
Sales Distribution side of business one 2007A
APART
From the Production MRP modules
I suppose for this:
1.  In the item master, all items for planning tab have NONE for planning method
2.  Item is setup as INVENTORY and SALE ITEM in the general area
The raw materials cost are already accounted for as part of the purchase.
The question is how to deplete the raw goods inventory, when the finished good is completed.
If I use Inventory GI or GR then that would work but it will effect the inventory variance gain/loss account.  Effecting this account is not quite right or is it?
Or is there another way to do it?
Mike

What if I don't care about consumption of the raw goods since it is very cheap about .5% cost of the finished goods.
But I do want to show finished goods inventory coming into the warehouse. 
Mike

Similar Messages

  • Block Sales order from production and shipping.

    Hi Experts,
    I have a requirement to block sales order from production and shipping if the credit limit of the customer is beyound the allowed value.
    Also sales order should not show demand for production until it has been released.
    Can someone throw light on how to acheive this?
    Regards
    Balu
    Edited by: balu umapathy on Sep 13, 2010 6:39 AM
    Moderator message: please work yourself first on your requirement, ask specific question later if required, always search before posting.
    locked by: Thomas Zloch on Sep 13, 2010 1:10 PM

    I will pass only the Prod Order as input. And I should get the Sales Order information... Very important is I need the schedule Line Number along with the Sales order and item.
    To recap once again,
    In MD04..or in BAPI MD_STOCK_REQUIREMENTS_LIST_API, I pass the input
    WERKS - Plant Code
    MATNR - Material Id
    Output should be like this,
    MRP element                                     MRP Element Data
    PrdOrder                                           OrderNumber/OrderType
    CusOrder                                          Salesorder/Item/ScheduleLine1      
    CusOrder                                          Salesorder/Item/ScheduleLine2
    PrdOrder                                           OrderNumber/OrderType
    so with the output, how can I find the Salesorder/Item/ScheduleLine for a particular prod order? I think I am clear with my question.

  • Sales Order from production Order - MD_STOCK_REQUIREMENTS_LIST_API

    Hi,
    We are using MTO scenario, in which after the MRP run, Production order are created using the sales order / order item / Schedule line.
    I can able to view this information in MD04 and also using BAPI 'MD_STOCK_REQUIREMENTS_LIST_API'. Now my problem is how can I identify the Sales Order/ Item / Schedule line based on the production order number in the output of this BAPI 'MD_STOCK_REQUIREMENTS_LIST_API'?
    Regards,
    Kumaresh

    I will pass only the Prod Order as input. And I should get the Sales Order information... Very important is I need the schedule Line Number along with the Sales order and item.
    To recap once again,
    In MD04..or in BAPI MD_STOCK_REQUIREMENTS_LIST_API, I pass the input
    WERKS - Plant Code
    MATNR - Material Id
    Output should be like this,
    MRP element                                     MRP Element Data
    PrdOrder                                           OrderNumber/OrderType
    CusOrder                                          Salesorder/Item/ScheduleLine1      
    CusOrder                                          Salesorder/Item/ScheduleLine2
    PrdOrder                                           OrderNumber/OrderType
    so with the output, how can I find the Salesorder/Item/ScheduleLine for a particular prod order? I think I am clear with my question.

  • How to break down single file imported from quicktime into clips?

    Can anyone help? I am trying to import video footage from a sony handycam, and have managed to import using USB via DvDxDV and then quicktime. However, it imports the movie as one big clip, is there anyway to instruct iMovie to break the clips down? Thanks

    is there anyway to instruct iMovie to break the clips down?
    You have to do that manually by Command-T or by "Split Clip at Playhead" -menu command.

  • Copy from Sales Order to Production Order

    Hi all,
    Is there a way to copy direct a Sales Order to Production Order (probably for item with BOM).I am using SAP B1 2005
    Thanks in Advance

    Hello,
    Currently you can choose relevant Sales Order from Production Order but only for information purpose.
    I think you can try to use SDK to implement it.
    Hope this helps.
    Regards,
    Maggie An
    SAP Business One Forums Team

  • How to take back or sale the scrap From Production

    Hello
    Suppose we have Issue some materials to Production say 1000 qty, for production, then here some scrap remains,we want to sell this scrap how to do?
    we have created the one material code for this scrap , How to take this material back and sale to out side how to to do this ? which is the best option, what is the use of movement type 531 here?
    Regards
    sapman

    Dear,
    At the time of production confirmation, the by-product that is produced gets transferred to the respective location. In this case the SCRAP, the goods movement takes place with the movement type ‘531 – Receipt of by-product into unrestricted use’ which is assigned already in co11n, goods movements.
    Once the Scrap is the respective storage location, it is ready for sale.
    Create a pricing procedure for selling scrap.
    It consists of Excise, education cess & higher secondary cess. And also you have conditions for CST & VAT, & TCS, Surcharge on TCS, education cess & higher secondary cess.
    Once you are done with pricing procedure, create condition records, create sales order, deliver and invoice, which is your normal sales process.
    Cheers!!

  • Purchase and sales flow resulting from 'production in other plant'.

    Dear all,
    When using the procurement type 'P' (production in other plant), materials are consumed in plant A and goods receipts from production order happens in plant B.
    When plants A and B belong to different company codes, SAP generates a cross-company document. Within the receiving company, the offsetting account for the stock account is the cross-company clearing account.
    This posting is generally not sufficient as legal and tax requirements ask for a sales and purchasing flow between the 2 company codes. Therefore many companies need to 'develop a solution' to complete this posting 'after the facts'.
    Does anybody know whether this additional posting exists under the form of an 'add-on' or additional solution to the standard made available by one or another partner of SAP ? Note that the starting point for this question is important : our company wants to use the 'production in other plant' flow because the native purchase and sales flows are too much time consuming.
    Thanks for your help.
    José Beghein

    Hi all,
    I want to be a bit more accurate here :
    The produced material in plant B has a special procurement type code (MARC-SOBSL) which in its definition contains procurement type E (BESKZ) and special procurement P (ESOBS). It is special procurement P that triggers the 'production in other plant' behaviour. The production plant (WRK02) is also specified in the definition of the special procurement type code.
    Kind regards.
    José Beghein

  • While copy into return sales order from sales invoice.

    I am creating one sales document assign one pricing procedure for that(eg. zpos)
    same way I am creating another return sales order which have I assign return sales order pricing procedure(zposr).
    Every time client want to create return sales order with reference to sales invoice (which having procedure zpos).
    but when copy from sales invoice into the return sales order pricing procedure is not change(in return sales order it's show pricing procedure zpos instead of zposr. )
    please provide me help
    so that after copy from invoice into the return sales order s/m should pick correct pricing procedure (zposr)
    thank you.

    hi,
    check in t code ovkk what is the pricing procedure for the return sales cocument type
    the pricing procedure for sales area+custpric proc +doc pric proc =zposr(it should be there)
    and the document pricing procedure should be different as that of determing the pricing procedure for(zpos)
    check in t code vov8 what is the doc pric proc assigned to the the return sales document type,
    this same shall be allocated in ovkk infront of your pricing procedure(zposr),
    if not then maintain it and then test and revert
    revert  if helpful
    Mohit Singh

  • Not able to select Base unit in Receipt from production and Sales order

    Can anybody help me out for the below scenario
    I have defined Sales UOM , Sales Packaging UOM, Items per Sales unit and Quantity per Packing UOM  for all finished product in the item master.
    I have created Production BOM and Production Order (with Issue method is Manual because they maintained items batchwise ) for all Finished products. 
    Based on Production orders, I received finished products(Batch wise) through receipt from production.  But the base unit shows Yes and it is not allow me to change. 
    In Sales order, the quantity column shows the value of quantity per packing UOM instead of Items per sales unit. 
    For Ex. ItemA - 01 No (Item per Sales Unit)
                             3600 Pcs ( Quantity per Packing UOM)
                             Receipt from Production - 10 Nos
                             In Sales order - it shows 36000 (10*3600 ) instead of 10 nos
    Expecting favourable solution for that.

    The selectable units on the sales order are the inventory unit or the sales unit. So if you want to see in units of 3600 Pc-s you should define this as Sales Unit (not as packaging unit). Then you can show the item in this unit in the sales documents.
    (In the receipt from production document you should always use the inventory Uom.)
    Edited by: István K#rös on Dec 22, 2009 10:07 AM

  • Assign batch number from sale order to production order automatic

    Dear all, I have a question for all. Please help me in this case
    My scenario is make to order
    I have a sale order, when i create sale order, i have assigned batch number at each line item.
    When i run MRP for sale order (MD50), the system generate a planned order for it and I've converted to production order.
    So when I view production order, I think that batch number what I've assigned to sale order will be assign to production order but that is not happen.
    So, can you help me solve this problem. I think that sap can assign batch number from sale order to production order automatic but i don't know how to configure that
    Thanks all

    Hi,
    To the best of my knowledge, when system is generating planned order / production order from sales order system doesnt copy batch number from sales order.
    In fact , you are following wrong practice for generating batch no.
    Follow procedure like this :
    Create sales order without any batch assigning there. Run MRP with MD50 and then convert planned order to Production Order.
    While creation / releasing of Production order, you have option to generate batch automatically by following way :
    Go to OPKP (Production Scheduling Profile) -> Take your plant & give suitable name to Production scheduling profile-> Batch Management tab -
    > Automatic Batch creation in the order maintain this field as
    1     Automatic batch creation at order creation
    or
    2     Autom. batch creation at order release
    This will generate batch number automatically at the time of creation or release of order.
    Then follow same process i.e. Goods Issue, Confirmation & GR for production order.
    So you will get sales order stock in the form of batch managed.
    Check & revert if any issue in above flow.
    Regards,
    Tejas

  • Transfer addition information from Sales Order to Production Order

    Hi,
    In MTO we need to transfer addition information from sales order to production order, such as OUTER DIAMETER and INNER DIAMETER of the product.
    Regards,
    Ahmed

    Hi Ahmed,
    Specific information from sales order in MTO process if you want to pass onto the production order then as suggested by expert production memo can be used.
    Follow below steps.
    Select the item in the sales order and  Goto -> Item -> Text as displayed below
      Create a production memo by specifying the language key as displayed below.
    Once you create production order against the sales order - In production order you can see the text maintained. CO02-Menu Bar - Header -Production Memo
    Thanks & Regards,
    Ramagiri

  • How to Ignore Negative Values from taking into consideration while Calculating MTD sales

    Hi Guys,
    I need to ignore negative Sales (Returns) from the Month to Date Sales  and calculate the Average only for those values.
    How can I do that.
    I researched on net but could not find any useful suggestions.
    Please help!
    Regards
    Ajoy

    Hi Mark,
    I have added a screen shot above explaining where I need to put the calculation.
    So basically we have a sales figure either positive or negative every hour.
    I need for every day only positive values and take the average. The count to calculate hours where only positive values works. But Sum doe not work.
    I am using following formula to calculate count of hours where Sales Positive
    Count(Sum([HOUR]) Where ([Sales]>-1))
    And for Sales Sum, following:-
    =Sum([Sales]) Where([Sales]>-1)
    It does not work. In the result set I do not want to see [HOUR] as a column.
    Please suggest something.
    Regards

  • QT Player 7.0.2 crashes when encoding from MJPEG into H.264

    Another interesting thing about QT 7.0.2 (first one was 10GB bug, check my earlier thread here) - it crashes when the user switches to another account and back while the QT Player encodes MJPEG video into H.264. How to reproduce this bug, step by step:
    1) open any MJPEG video in QT Player 7.0.2, could be in MOV or in AVI, doesn't make difference which
    2) do File->Export
    3) choose "Movie to QuickTime Movie" in the "Export" drop-down menu
    4) in the "Save exported file as" dialog go to Options->Video->Settings and set H.264 as your output video codec, encoding settings don't make a difference as well
    5) close "Movie settings" dialog, then click "Save" in "Save exported file as" dialog
    6) QT Player starts encoding your MJPEG video into H.264 video, the small "Progress" window appears with a progress bar inside
    7) now switch to another user account using Fast User Switching feature of Windows XP
    8) switch back to the account where QT Player was encoding your MJPEG video
    9) observe the crash window - your QT Player has joined his ancestors now
    Can anyone reproduce this? If yes, please post your crash dump here, so that I can send another bugreport to Apple (10GB bugreport is in the works now, almost done
    If you follow all the steps above and your QT Player does NOT crash, please post the details about your system. My setup is QT Player Pro 7.0.2 and Windows XP Pro SP2. Also post the details about your MJPEG file - the codec you used to encode it (mine two codecs were Pegasus PicVideo 3 and Apple Motion JPEG A), and the resolution (mine was 720x480).

    when i said i couldn't do audio and video at the same time i meant that i cannot edit and process video and at the same time record or edit ADR, sound effects. i have an audio engineer in the audio room working on the audio while i work on the video. is that clear?
    Yeah, now it sounds reasonable. You possibly could do that on a single computer using X Windows or Windows Terminal Server but it's totally different topic.
    as for fast user switching...here's a comment from another forum... "just don't use fast user switching, it isn't implemented well and it breaks some programs"
    "Don't use Windows, it isn't implemented well and doesn't run some poorly written MS-DOS games"
    I found several others in that regard, but you know more about it so i don't need to post links, right? plus a lot of them dealt with quicktime, but again you are the expert.
    If you found anything that's related to QuickTime crashes during account switching, you're welcome to post this concrete info here, it'll help with my bugreport.
    and since you make the inference that i have a cheap system operating on ms-dos which is laughable because that means that you can't read.
    I said that when I read about single-task computers this reminds me about MS-DOS times, but now it looks like it is not about your case, since you have two people working in parallel on two machines.
    i looked up on Yahoo! the terms "mjpeg"+"crashes" and got 16,800 hits. plus i do recall on another forum someone was having problems with mjpeg and the responder said it wasn't a good codec to work with...
    So what's the deal if 95% of these 16800 Yahoo posts are about crash in Premiere or Microsoft Movie Maker or some other buggy tool? You could even search for an f-word, and you'll find a lot of posts with that word, then you can make any conclusion you like about that word being so often cited and then we could start a lengthy discussion about it, but what's the point? I can find 10000 posts about "single task" + "bad" but I'd never use this to justify anything. I give you concrete facts from my experience, so please give me something concrete in return, not 16800 Yahoo posts about something out there.
    "Disadvantages: There's also the problem of recompression. While the human eye can be fooled by JPEG's compression, computers aren't. Thus, when you compress from MJPEG into another format to use for distribution, you will receive a lower-quality picture than if you had a lossless source because there is data missing which, while it's not important to the visual cortex, is very important to a mathematical analysis of things such as color data. The only time you should use MJPEG otherwise is for fast-editing temporary files, but DON'T use them as your final source."
    I know that already, thank you.
    since you said i'm the one who suggested that you use uncompressed video and that doing so the computer doesn't crash...
    You suggested that in a different thread about 10GB MJPEG limitation. That's another bug that may be or may be not related to the crash problem.
    then why don't you work that way and finish your video?
    Yes, I can employ this trick. I will do it if I'm forced to (i.e. if I absolutely have no other way to load MJPEG in QT Player and Apple refuses to fix that crash). However, I'll push Apple with fixing the issue at the same time. Maybe they'll work something out while I'm using uncompressed RGB workaround or some other workaround.
    mjpeg is unstable in that regard so contact the codec manufacturer/developer and ask them why or give them the bug report because it's not apple
    Unfortunately it is Apple, because it's the Apple's software that crashes. All the other codecs and video editors work fine, and there are even conditions when Apple doesn't crash, like loading uncompressed RGB. Since crash is inside QuickTime I will send my bugreport to Apple. If the crash had happened inside the MJPEG codec, I'd have sent the bugreport to

  • Can we Delete the Product/Material  from Product Master in CRM

    Hi Gurus,
    I want to delete some test products from Product master, I don't see any link for delete there in product master transaction.
    Can we Delete the Product from Product Master in CRM??
    Thanks in Advance.
    Regards,
    Manoj Tiwari

    Try this:
    *& Report  ZVB_PRODUCT_DELETE          (release CRM 4.0 SP03)          *
    *&         Instructions are in OSS Note #427332                        *
    report  zvb_product_delete line-size 300.
    const, include
    include com_product_const001.
    include com_product_const003.
    include com_product_const009.
    include com_product_const011.
    include com_settype_attribute_const03.
    tables:  comm_iproduct,                                     "#EC NEEDED
             comm_product.
    constants:
           gc_program type programm value 'COM_PRODUCT_DELETE_SINGLE'.
    data:  gv_product_guid type comt_product_guid,
           gv_prty  type comt_product_type,
           gv_syslog(70)  type c,
           lv_mobile_active  type comt_boolean,
           lv_delete  type comt_boolean value 'X'.
    data:  lt_settypes      type  comt_frgtype_tab_ext,
           lt_status_guid   type comt_prd_status_guid_tab.
    data: begin of lt_products occurs 0,
             product_id   like comm_product-product_id,
             product_guid like comm_product-product_guid,
          end of lt_products.
    Screen User query
    selection-screen comment /1(60) text-006.
    selection-screen skip 2.
    select-options: s_prid for comm_product-product_id.
    *parameters: p_prid type comt_product_id   obligatory,
    parameters: p_prty type comt_product_type obligatory default '01',
                p_logs type comt_logsys       obligatory,
                p_objf type comt_product_object_family,
                p_send  as checkbox modif id 001 default on,
                p_usage as checkbox modif id 001 default off,
                p_test  as checkbox default 'X'.
    at selection-screen output.
      perform check_mobile_download
          changing lv_mobile_active.
      if lv_mobile_active is initial.
        loop at screen.
          check screen-group1 = '001'.  "disable field p_send, p_usage
          screen-active = '0'.
          modify screen.
        endloop.
      endif.
    start-of-selection.
    perform check_authority.
    Write syslog entry
    concatenate 'Rep. ' sy-repid ': ' p_prid(30) '/' p_prty '/' p_logs
            into gv_syslog.                                    "#EC NOTEXT
    call 'C_WRITE_SYSLOG_ENTRY'
       id 'TYP' field ' '
       id 'KEY' field 'C00'
       id 'DATA' field gv_syslog  .
    inactive product are not supported here
    select * from comm_iproduct
            where product_id    = p_prid
            and   product_type  = p_prty
            and   object_family = p_objf
            and   logsys        = p_logs.
    endselect.
    if sy-subrc = 0.
       write: / text-001, text-005.
       exit.
    endif.
    read products according to the selection criteria
      select * from comm_product
             into corresponding fields of table lt_products
             where product_id    in s_prid
             and   product_type  = p_prty
             and   object_family = p_objf
             and   logsys        = p_logs.
      if sy-subrc ne 0.
        write: / text-010.
        exit.
      endif.
      loop at lt_products.
      read product and enqueue
        perform product_enqueue
             using lt_products-product_id
                   p_prty
                   p_logs
                   p_objf
             changing gv_product_guid
                      gv_prty.
        check not gv_product_guid is initial.
        if p_usage = on.
          perform check_usage
                  using gv_product_guid
               changing lv_delete.
        endif.
        check lv_delete = on.
        check p_test = space.
      first delete the component of the IBase
        perform delete_ibasecomponent
             using gv_product_guid.
        perform delete_extensions
             using gv_product_guid
                   lt_settypes.
        perform delete_settypes
             using gv_product_guid
                   lt_settypes
          changing lt_status_guid.
        perform delete_interlinkages
             using gv_product_guid.
        perform delete_pme_data                      "multivalue attributes
             using gv_product_guid.
        perform delete_decoupled_data                "long text, longmatnr,
             using gv_product_guid.                  "ibase prodvar,...
        perform delete_status
             using lt_status_guid.
        perform delete_favorites
             using gv_product_guid.
        perform delete_clear_case
             using gv_product_guid.
        if p_send = 'X'.
          perform send_deletion_to_mw
               using gv_product_guid.
        endif.
        delete from comm_product     where product_guid = gv_product_guid.
        delete from comm_producth    where product_guid = gv_product_guid.
        delete from comm_product_idx where product_guid = gv_product_guid.
        delete from comm_prwb_user_2 client specified
               where client = sy-mandt and last_object = gv_product_guid.
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
            wait = 'X'.
        write: / text-001, lt_products-product_id, text-004.
      endloop.
    *&      Form  product
    form product_enqueue
       using   iv_prid  type comt_product_id
               iv_prty  type comt_product_type
               iv_logs  type comt_logsys
               iv_objf  type comt_product_object_family
      changing ev_pguid type comt_product_guid
                          ev_prty type comt_product_type.
      data ls_product type  comt_product.
      call function 'COM_PRODUCT_GUID_GET'
        exporting
          iv_product_id    = iv_prid
          iv_product_type  = iv_prty
          iv_logsys        = iv_logs
          iv_object_family = iv_objf
          iv_show_popup    = 'X'
        importing
          ev_product_guid  = ev_pguid
        exceptions
          not_found        = 1
          wrong_call       = 2
          internal_error   = 3
          others           = 4.
      if sy-subrc <> 0.
        write: / text-001, space, iv_prid.
        write:   text-003.        "Product not found
        exit.
      else.
        write: / text-001, space, iv_prid.
        write:   text-002.        "Product found
      endif.
      call function 'COM_PRODUCT_READ_SINGLE'
        exporting
          iv_product_guid = ev_pguid
          iv_enqueue_mode = ' '
        importing
          es_product      = ls_product
        exceptions
          not_found       = 1
          wrong_call      = 2
          foreign_lock    = 3
          enqueue_failed  = 4
          others          = 5.
      if sy-subrc <> 0.
        if sy-subrc > 2.
          write: / text-001, space, iv_prid.
          write:   text-007. "Product enqueued
          exit.
        else.
          message id sy-msgid type sy-msgty number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          exit.
        endif.
        exit.
      endif.
      ev_prty = ls_product-product_type.
    special authotirty check (with considering the assigned
    categories)
    call function 'COM_PRODUCT_CT_AUTHORITY_CHECK'
       exporting
         iv_auth_act     = '06'
         iv_product_guid = ev_pguid
       exceptions
         no_authority    = 1
         wrong_call      = 2
         internal_error  = 3
         others          = 4.
    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.                               " product
    *&      Form  delete_extensions
    form delete_extensions
         using iv_product_guid type comt_product_guid
               et_settype      type comt_frgtype_tab_ext.
      data:  lv_db_tab        type ddobjname,
             lv_subrc_pr_guid like sy-subrc,
             table_name_ref   type ref to data,
             lt_extension     type comt_frgtype_tab_ext,
             ls_extension     type comm_frgtype_ext.
      field-symbols: <table_name> type any,
                     <field_name> type any.
      check not iv_product_guid is initial.
    delete extensions e.g. COMM_PRFREEATTR, CRMM_PR_TAX, COMM_PR_UNIT,
                           COMM_PR_SHTEXT,COMM_PR_GTIN, comm_prprdcatr,..
      perform load_extensions
              using  iv_product_guid
           changing  lt_extension
                     et_settype.
      loop at lt_extension into ls_extension.
        lv_db_tab = ls_extension-frgtype_tab.
        check not lv_db_tab is initial. "CRM_CAT_SAT & CRM_CAT_PUR
      does table exist ?
        call function 'DDIF_NAMETAB_GET'
          exporting
            tabname   = lv_db_tab
          exceptions
            not_found = 1
            others    = 2.
        check sy-subrc = 0.
      Due to any reason (I don't know why) sometimes we have product_guid
      and sometimes we have frg_guid as name of the key field.
        create data table_name_ref type (lv_db_tab).
        assign table_name_ref->* to <table_name>.
        assign component 'PRODUCT_GUID' of structure <table_name>
               to <field_name>.
        lv_subrc_pr_guid = sy-subrc.
        if lv_subrc_pr_guid = 0.
          delete from (lv_db_tab)
                 where product_guid = iv_product_guid.
        else.
          delete from (lv_db_tab)
                 where frg_guid     = iv_product_guid.
        endif.
      delete history of extension table
        concatenate ls_extension-frgtype_tab 'H' into lv_db_tab.
        create data table_name_ref type (lv_db_tab).
        assign table_name_ref->* to <table_name>.
        assign component 'LOGSYS' of structure <table_name>
                                  to <field_name>.
        check sy-subrc = 0.
        call function 'DDIF_NAMETAB_GET'
          exporting
            tabname   = lv_db_tab
          exceptions
            not_found = 1
            others    = 2.
        check sy-subrc = 0.
        if lv_subrc_pr_guid = 0.
          delete from (lv_db_tab)
                 where product_guid = iv_product_guid.
        else.
          delete from (lv_db_tab)
                 where frg_guid     = iv_product_guid.
        endif.
      endloop. "  end of loop for all extensions
    endform.                    " delete_extensions
    *&      Form  delete_settypes
    form delete_settypes
         using iv_product_guid   type comt_product_guid
               it_settypes       type comt_frgtype_tab_ext
        changing et_status_guid  type comt_prd_status_guid_tab.
      data: ls_reldesc type  coms_pr_org_rel,
            lt_reldesc type  comt_pr_org_rel_tab,
            lt_reltab  type  ref to data,
            ls_settype type  comt_settype_ext,
            ls_table   type  tabname,
            ls_status_guid   type crmt_object_guid.
      field-symbols:
           <fs_reltab>   type any table,
           <fs_relrow>   type any,
           <fs_settype>  type comt_frgtype_guid,
           <fs_setguid>  type comt_frg_guid,
           <fs_statguid> type crmt_object_guid.
    memorise product status guide
      ls_status_guid = iv_product_guid.
      append ls_status_guid to et_status_guid.
    load description of relation tables
      call method cl_com_product_org_type=>comc_pr_org_link_read_all
        importing
          et_pr_org_rel = lt_reldesc
        exceptions
          no_desc       = 0.
    for all relation types (e.g. comm_pr_frg_rel, comm_pr_frg_rod)
      loop at lt_reldesc into ls_reldesc.
      read product/settype relations
        create data lt_reltab type (ls_reldesc-link_table_ttyp).
        assign lt_reltab->* to <fs_reltab>.
        call function ls_reldesc-func_rel_read_pr
          exporting
            iv_product_guid = iv_product_guid
          importing
            et_rel          = <fs_reltab>
          exceptions
            wrong_call      = 1
            not_found       = 2
            others          = 3.
        check sy-subrc = 0.
      for all links...
        loop at <fs_reltab> assigning <fs_relrow>.
          assign component 'FRAGMENT_TYPE' of structure <fs_relrow>
                                                     to <fs_settype>.
          assign component 'FRAGMENT_GUID' of structure <fs_relrow>
                                                     to <fs_setguid>.
          assign component 'STATUS_OBJECT' of structure <fs_relrow>
                                                     to <fs_statguid>.
          read table it_settypes with key frgtype_guid = <fs_settype>
                                 into ls_settype.
          check sy-subrc = 0.
        settype table
          delete from (ls_settype-frgtype_tab)
                 where frg_guid = <fs_setguid>.
        history table
          concatenate ls_settype-frgtype_tab 'H' into ls_table.
          delete from (ls_table)
                 where frg_guid = <fs_setguid>.
        memorise settype status guide
          if not <fs_statguid> is initial.
            ls_status_guid = <fs_statguid>.
            append ls_status_guid to et_status_guid.
          endif.
        endloop. "of links
      relation table (e.g. comm_pr_frg_rel)
        delete from (ls_reldesc-link_table)
               where product_guid = iv_product_guid.
      history table
        concatenate ls_reldesc-link_table 'H' into ls_table.
        delete from (ls_table) where product_guid = iv_product_guid.
      endloop. " of relation types
    endform.                    " delete_settypes
    *&      Form  delete_interlinkages
    form delete_interlinkages
         using iv_product_guid type comt_product_guid.
      constants: cv_db_name(8)  type c value 'COMM_IL_',
                 cv_suffix_h(2) type c value '_H'.
      data: lt_ilinks   type  comt_il_data_tab,
            lt_reltype  type  comc_il_reltype_tab with header line,
            lv_ddictype type  dd02v-tabclass,
            lv_dbname        type  comt_structure.
    CHECK p_objf IS INITIAL.
    first we have to read all ILs where the productguid is sourceguid
      refresh lt_ilinks.
      call function 'COM_IL_API_WHERE_USED'
        exporting
          iv_objectguid   = iv_product_guid
          iv_objtype      = gc_bus_objtype_bus1178
          iv_direction    = 'S'
        importing
          et_interlinkage = lt_ilinks.
      check not lt_ilinks[] is initial.
      delete adjacent duplicates from lt_ilinks comparing reltype.
    read ilinkage customizing
      select * from comc_il_reltype into table lt_reltype
         for all entries in lt_ilinks where reltyp = lt_ilinks-reltype.
    delete interlinkages
      loop at lt_reltype.
        if lt_reltype-streltyp ne space.
          concatenate cv_db_name lt_reltype-streltyp into lv_dbname.
        else.
          concatenate cv_db_name lt_reltype-reltyp   into lv_dbname.
        endif.
      delete data
        call function 'DDIF_NAMETAB_GET'
          exporting
            tabname   = lv_dbname
          importing
            ddobjtype = lv_ddictype
          exceptions
            not_found = 1
            others    = 2.
        check sy-subrc = 0 and lv_ddictype = 'TRANSP'.          "#EC NOTEXT
        delete from (lv_dbname) where sourceguid = iv_product_guid.
      delete history
        check lt_reltype-change_doc = 'X'.
        concatenate lv_dbname cv_suffix_h into lv_dbname.
        call function 'DDIF_NAMETAB_GET'
          exporting
            tabname   = lv_dbname
          importing
            ddobjtype = lv_ddictype
          exceptions
            not_found = 1
            others    = 2.
        check sy-subrc = 0 and lv_ddictype = 'TRANSP'.          "#EC NOTEXT
        delete from (lv_dbname) where sourceguid = iv_product_guid.
      endloop.
    endform.                    "delete_interlinkages
    *&      Form  delete_pme_data
    form delete_pme_data
         using iv_product_guid type comt_product_guid.
    delete multivalue attributes from PME
      data: lt_pmemap  like standard table of comm_pme_prd_map,
            ls_pmemap  like comm_pme_prd_map.
      select *  into table lt_pmemap
                from comm_pme_prd_map
                where crm_object_guid = iv_product_guid.
      check sy-subrc = 0.
      loop at lt_pmemap into ls_pmemap.
        call function 'CRM_SCE_DB_KB_DELETE'
          exporting
            iv_kbid = ls_pmemap-kbid.
      endloop.
      delete comm_pme_prd_map from table lt_pmemap.
    endform.                    "delete_pme_data
    *&      Form  send_deletion_to_mw
    form send_deletion_to_mw
         using iv_product_guid type comt_product_guid.
      data:  cv_function_module like  rs38l-name
                  value 'CRM_PROD_SEND_DELETION_MESSAGE'.       "#EC NOTEXT
      data:  lt_product_guid  type comt_product_s_tab with header line.
      lt_product_guid-product_guid = iv_product_guid.
      append lt_product_guid.
      call function 'FUNCTION_EXISTS'
        exporting
          funcname           = cv_function_module
        exceptions
          function_not_exist = 1
          others             = 2.
      check sy-subrc = 0.
      call function cv_function_module
        exporting
          it_product_guid = lt_product_guid[]
          iv_test_only    = space
        exceptions
          internal_error  = 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.
    endform.                    " send_deletion_to_mw
    *&      Form check_mobile_download
    form check_mobile_download
      changing ev_mobile_active type comt_boolean.
      data:
            cv_db_tab   type ddobjname value 'SMOMARA'.
      data: lv_lines    type i value 0.
      clear ev_mobile_active.
      call function 'DDIF_NAMETAB_GET'
        exporting
          tabname   = cv_db_tab
        exceptions
          not_found = 1
          others    = 2.
      check sy-subrc = 0.
      select count( * ) into lv_lines
        from (cv_db_tab) up to 10 rows.                     "#EC CI_NOWHERE
      if lv_lines > 0.
        ev_mobile_active = on.
      endif.
    endform.                    " check_mobile_download
    *&      Form check_authority
    form check_authority.
      tables:  t000, comc_pr_tool_reg.                          "#EC NEEDED
    check productiv system - report must not be executed
      select single * from t000 client specified             "#EC CI_CLIENT
                      where mandt = sy-mandt.
      if t000-cccategory = 'P'.
        message e807(com_product) .
        leave.
        leave to transaction '    '.
      endif.
    Check authority for product delete
      call function 'COM_PRODUCT_AUTHORITY_CHECK'
        exporting
          iv_auth_act    = '06'
        exceptions
          no_authority   = 1
          wrong_call     = 2
          internal_error = 3
          others         = 4.
      if sy-subrc ne 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      MESSAGE e808(com_product).
        leave.
        leave to transaction '    '.
      endif.
    Additional step: registration
      select single * from comc_pr_tool_reg
             where program_name = gc_program
             and   user_name    = sy-uname
             and   exec_date    = sy-datum.
      if sy-subrc ne 0.
        message e809(com_product).
      endif.
    endform.                    " check_authority
    *&      Form  delete_decoupled_data
    form delete_decoupled_data
         using iv_product_guid type comt_product_guid.
      include com_product_const018.
    Deleting decoupled and customer requested data (long_text, longmatnr,
      upload registry, ibase product variants coming from R/3,
      archive verify registry). Documents like PDF,XLS,DOC,JPG stored in
      Content Management will not be deleted
    load BADI implementations
      class: cl_exithandler definition load.
      data:  exit_obj type ref to if_ex_com_product_delete.
      call method cl_exithandler=>get_instance
        exporting
          exit_name              = gc_badi-com_product_delete
          null_instance_accepted = on
        changing
          instance               = exit_obj.
    call BADI implementations (User Exit)
      call method exit_obj->delete_extra_data
        exporting
          iv_product_guid = iv_product_guid.
    endform.                    " delete_decoupled_data
    *&      Form  load_extensions
    form load_extensions
         using iv_product_guid type  comt_product_guid
      changing et_extension    type  comt_frgtype_tab_ext
               et_settype      type  comt_frgtype_tab_ext.
      data: lt_prd_cat      type  comt_prod_cat_rel_tab,
            ls_prd_cat      type  comt_prod_cat_rel,
            lt_cat_frg      type  comt_prcat_frag_rel_tab,
            ls_cat_frg      type  comt_prcat_frag_rel,
            lt_settype_guid type  comt_frgtypeguid_tab,
            ls_settype_guid type  comt_frgtype_guid,
            lt_settype      type  comt_frgtype_tab_ext.
      refresh et_extension.
    read categories assigned to product
      call function 'COM_PROD_CAT_REL_READ_WITH_PR'
        exporting
          iv_product_guid = iv_product_guid
        importing
          et_set          = lt_prd_cat.
      loop at lt_prd_cat into ls_prd_cat.
      read allowed settypes for categories
        call function 'COM_PRCAT_FRAG_REL_READ'
          exporting
            iv_category_guid  = ls_prd_cat-category_guid
          importing
            et_prcat_frag_rel = lt_cat_frg
          exceptions
            wrong_call        = 1
            others            = 2.
        check sy-subrc = 0.
        refresh lt_settype_guid.
        loop at lt_cat_frg into ls_cat_frg.
          ls_settype_guid = ls_cat_frg-frgtype_guid.
          append ls_settype_guid to lt_settype_guid.
        endloop.
      read settype defintions
        call function 'COM_SETTYPE_READ_MULTIPLE'
          exporting
            it_settype_guid = lt_settype_guid
          importing
            et_settype      = lt_settype
          exceptions
            nothing_found   = 1
            others          = 2.
        if sy-subrc =  0.
        only settypes
          et_settype[] = lt_settype[].
          delete et_settype[] where
            ( prod_comp_type = gc_prod_comp_type-extension or
              prod_comp_type = gc_prod_comp_type-simple_extension ).
        only extensions
          delete lt_settype[] where
            ( prod_comp_type ne gc_prod_comp_type-extension and
              prod_comp_type ne gc_prod_comp_type-simple_extension ).
          et_extension[] = lt_settype[].
        endif.
      endloop. " end of product categories
    endform.                    " load_extensions
    *&      Form  delete_status
    form delete_status
      using it_status_guid type comt_prd_status_guid_tab.
      data:
        lt_status like crm_jsto_pre occurs 0,
        ls_status type crm_jsto_pre,
        ls_status_guid type crmt_object_guid.
      loop at it_status_guid into ls_status_guid.
        ls_status-objnr = ls_status_guid.
        append ls_status to lt_status.
      endloop.
      call function 'CRM_STATUS_DELETE_MULTI'
        tables
          objnr_table = lt_status.
    endform.                    " delete_status
    *&      Form delete_favorites
    form delete_favorites
         using iv_product_guid type  comt_product_guid.
      call function 'COM_PRODUCT_DELETE_FAVORITES'
        exporting
          iv_object_guid = iv_product_guid.
    endform.                    " delete_favorites
    *&      Form delete_clear_case
    form delete_clear_case
         using iv_product_guid type  comt_product_guid.
      data:   ls_customizing type comc_product,
              lv_clear_case_guid type comt_clear_case_guid.
    Is cusotmizing-flag INACTIV_PROD activated ?
      call method cl_com_product_general=>comc_product_read_all
        importing
          es_prod_general = ls_customizing
        exceptions
          not_found       = 1
          others          = 2.
      check ls_customizing-inactive_prod = on.
      select single clear_case_guid from comm_clear_targ        "#EC *
               into lv_clear_case_guid
               where object_guid = iv_product_guid  "active
                 and object_class = 'PROD'.
    normaly two entries for active and inaktive product version
      delete from comm_clear_targ
               where clear_case_guid = lv_clear_case_guid
                 and object_class = 'PROD'.
      delete from comm_clear_stack
             where guid = lv_clear_case_guid
               and application = 'PROD'.
    endform.                    "delete_clear_case
    *&      Form check_usages
    form check_usage
         using iv_product_guid type  comt_product_guid
      changing ev_delete type comt_boolean.
      include sbal_constants.
      data:  cv_function_module like  rs38l-name
                  value 'COM_PRODUCT_USAGE_CHECK'.              "#EC NOTEXT
      data:  ls_product  type comt_product,
             lt_product  type comt_product_tab.
      data:  ls_logheader     type bal_s_log,   "Kopfdaten des Protokolls
             lv_loghandle     type  balloghndl.
      data:  ls_msg_filter type bal_s_mfil,
             ls_log_filter type bal_s_lfil,
             lt_msg_handle type bal_t_msgh,
             ls_log_handle type bal_s_logh,
             ls_msg_handle type balmsghndl,
             ls_msg        type bal_s_msg,
             ls_string     type string.
    does CRM function exist
      call function 'FUNCTION_EXISTS'
        exporting
          funcname           = cv_function_module
        exceptions
          function_not_exist = 1
          others             = 2.
      check sy-subrc = 0.
    create log handle
      ls_logheader-aldate    = sy-datum.
      ls_logheader-altime    = sy-uzeit - 10.
      ls_logheader-aluser    = sy-uname.
      ls_logheader-alprog    = sy-repid.
      call function 'BAL_LOG_CREATE'
        exporting
          i_s_log                 = ls_logheader
        importing
          e_log_handle            = lv_loghandle
        exceptions
          log_header_inconsistent = 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.
      ls_product-product_guid = iv_product_guid.
      append ls_product to lt_product.
    call usage checks
      call function cv_function_module
        exporting
          it_product   = lt_product
          iv_loghandle = lv_loghandle.
    filter settings
      ls_log_handle-sign   = 'I'.
      ls_log_handle-option = 'EQ'.
      ls_log_handle-low    = lv_loghandle.
      append ls_log_handle to ls_log_filter-log_handle.
    get messages
      call function 'BAL_GLB_SEARCH_MSG'
        exporting
          i_s_log_filter = ls_log_filter
          i_s_msg_filter = ls_msg_filter
        importing
          e_t_msg_handle = lt_msg_handle
        exceptions
          msg_not_found  = 1
          others         = 2.
      check sy-subrc = 0.
      ev_delete = space.
      write: / text-001, text-008.
    read messages
      loop at lt_msg_handle into ls_msg_handle.
        call function 'BAL_LOG_MSG_READ'
          exporting
            i_s_msg_handle = ls_msg_handle
          importing
            e_s_msg        = ls_msg
          exceptions
            log_not_found  = 1
            msg_not_found  = 2
            others         = 3.
        check sy-subrc = 0.
        message id ls_msg-msgid type ls_msg-msgty number ls_msg-msgno
            with ls_msg-msgv1 ls_msg-msgv2 ls_msg-msgv3 ls_msg-msgv4
            into ls_string.
        write: /, ls_string.
        clear ls_msg.
      endloop.
    endform.                    " check_usages
    *&      Form  delete_ibasecomponent
          text
         -->P_GV_PRODUCT_GUID  text
    form delete_ibasecomponent using p_product_guid.
      data: lv_guid22 like sysuuid-c22,
            ls_comp   type  ibas_dat1.
      tables: ibin.
      break pvho.
      call function 'GUID_CONVERT'
        exporting
          iv_guid_x16            = p_product_guid
        importing
          ev_guid_c22            = lv_guid22
        exceptions
          no_unicode_support_yet = 1
          parameters_error       = 2
          others                 = 3.
    find the component
      select * from ibin
             where objnr = lv_guid22.
        clear ls_comp.
        ls_comp-instance = ibin-instance.
        ls_comp-ibase = ibin-ibase.
        call function 'IBASE_COMP_DELETE'
          exporting
            i_comp              = ls_comp
          exceptions
            data_not_consistent = 1
            ibase_locked        = 2
            not_succesful       = 3
            others              = 4.
        if sy-subrc eq 0.
          call function 'IBASE_SAVE'.
        endif.
      endselect.
    endform.                    " delete_ibasecomponent

  • Releasing Sales Orders from SNP to DP at correct levels

    We have a requirement where we want to do month to date tracking of sales orders in DP compared with the forecast. We have three important characteristics in DP at which we want the data to be released - Product, Location and Customer. Is there a way to release Sales Order data from SNP to DP at such a detailed level ? A product at a location could have sales orders from multiple customers.

    why would you want to send Sales Orders from SNP to DP
    Why not load it into DP planning area through a cube in the DW workbench directly
    As far as i know you can only trasfer from SNP to DP in Product Location (or similar characterstic Level) 
    DP to SNP demand transfer can use descriptive characteristics but dont think you can do it in reverse

Maybe you are looking for