How to enable Negative Quantity in PSM/ASM of SAP PLM7

Hi Guru,
I got a request from my users that they want to use Negative Quantity in in PSM/ASM of SAP PLM7.
As we known, Negative Quantity is available in ERP via CS01/CS02, but i cannot maintain negative quantity in PSM or ASM. Does any one know how to maintain it? Thanks in advance.
BR
Simon

Satish,
You have to set up the component as secondary output. When creating a BOM/Recipe in PLM, you can designate a component as a "secondary output." This type of component will allow negative quantities to be entered, just like you do in CS01 and CS02 for "by-products."
-Best Regards,
Oscar

Similar Messages

  • How to enable negative values allowed in depreciation area?

    < MODERATOR:  Message locked.  Please post this message in the [Asset Accounting forum|SAP ERP Financials  - Asset Accounting;. >
    hello,
    i'm trying to make negative vals allowed in AS02 -> depreciation area , but this element is desabled, how to anable it ?
    thanks

    Hi,
    Check OABN transaction and change the settings to the dep. area.
    Regards,
    Eli

  • How to scrap the negative quantity

    Hi
    Our requirement is to scrap a material quantity for a plant. But that material has a negative quantity.
    Please let me know how to scrap negative quantity.
    Thanks & Regards
    Shilpi

    hi,
       In which period the stock is negative. If it is in current period, then do physical inventory for that material and increase the quantity and make it positive and do it scrap. If it is in earlier period, then you have to consult your peoples to post in that period.
    or
    If you have stocks in anyother sloc..then move that to the sloc where the quantity is in negative..then u can scrap...
    regards,
    prasath

  • How can negative quantity appears?

    Hi guys,
    I have trouble in production system. User reported me there was an odd line in item cost history that showing a discreate job transaction which could consumed zero onhand.
    It causes there was negative quantity in line.
    Allow negative balance always set to No (Unchecked) in Parameter Setting.
    I attached the image of our item cost history.
    Please give me an answer. Thank you so much.
    Regards,
    Contraseña Luz

    Hi guys,
    I looked at the transaction in material transaction. I think the problem causes by transaction_date that created earlier than creation_date. its make the line misorder.
    SEGMENT1
    TRANSACTION_QUANTITY
    TRANSACTION_TYPE_NAME
    TRANSACTION_DATE
    CREATION_DATE
    BM-200-1
    774.48
    WIP Completion
    27-FEB-2014 23:07:47
    27-FEB-2014 23:08:38
    BM-200-1
    -165.77
    WIP Issue
    27-FEB-2014 23:01:58
    27-FEB-2014 23:09:21
    BM-200-1
    -213.21
    WIP Issue
    27-FEB-2014 14:11:44
    27-FEB-2014 14:12:50
    BM-200-1
    -770.04
    WIP Issue
    27-FEB-2014 06:01:50
    27-FEB-2014 06:06:46
    BM-200-1
    -332.19
    WIP Issue
    27-FEB-2014 05:51:11
    27-FEB-2014 05:51:37
    BM-200-1
    990.86
    WIP Completion
    27-FEB-2014 01:16:54
    27-FEB-2014 01:17:44
    See two line on top of the table, the WIP Completion should be created before the WIP Issue.
    I have created new discussion on Why Transaction Date Line Earlier Created than Creation Date and Make Wrong Sequence?
    We here don't know how it can be happened.
    Any suggestion guys?
    Regards,
    Contrasena Luz

  • How to find a quantity is negative or positive

    Hi Friends,
    How to find a quantity is negative or positive.
    Thanks in Advance.
    Murali K

    Hi Martin,
    qty cannot be negative.
    u can have 10 qty but u cannot take -10 qty
    REPORT zex33.
    parameter : qty like mseg-menge.
    if qty < 0.
    write 'negative'.
    else.
    write 'positive'.
    endif.
    Here if u give negative value say -5.34 then,
    Negative values not allowed error message will be displayed in the status bar

  • How to enable excel downloading in ALV grid report.

    Hi all,
    How to enable excal downing in ALV grid report?
    Thanks in Advance.
    Siva Sankar.

    hi
    check the following code
    Example of a Simple ALV Grid Report
    REPORT  ZTUFI091                                .
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    *REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_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.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
          Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
          Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    hope it will help you
    regards
    sreelatha gullapalli

  • Need negative quantity non-inventory items on Credit Memo

    Version: (2007A)
    Description of requirements: (Please provide a detailed description)
    Our customer issues many invoices with a negative quantity line item for a miscellaneous non-inventory item. These non-inventory items are used to reduce the amount of the invoice regarding miscellaneous credits to their customers.  These are not discounts.
    When the customer wants to credit these invoices, they canu2019t create a Credit Memo based on the invoice because SAP wonu2019t allow this if there are line items with negative amounts.
    When they create a credit memo not based on an invoice, they arenu2019t allowed to enter a negative quantity for a line item as they are for an Invoice. They are forced to create a credit memo not based on an invoice the inventory item line items and an invoice or Journal Entry for the negative quantity line item to debit back the miscellaneous line amount.
    As an example:
    Invoice line item one for inventory item: qty one, price 100,line total $100.00
    Invoice line item two non-inventory item misc credit: quanity -1, price 10, total -$10.00
    Invoice Total $90.00
    In Order to provide the correct credit amount, they have to create a Credit Memo not based on an invoice for line item one, qty one, price 100 u2013 value -100 and an invoice for the non-inventory item for qty one, price 10 -  value 10.00.
    This creates a net credit for the customer of 90.00
    This looks ridiculous to their customers when they see these transactions on their statements, creates extra work for the users and there is no link between the three documents.
    By using inventory items for these miscellaneous credits, they can assign a sales revenue of their choice. They have multiple sales accounts and the GL posting is determined by the item group for the item. By assigning the desired item group to these non-inventory items, they can control which sales account is updated on their marketing documents when using these non-inventory items.
    If they were to use the Freight items, they would need a separate freight setup entry for combination of item group and miscellaneous credit. Because they have so many Item Groups and types of credits, they would need a great many separate Freight Charges to choose from.
    All of the above pertains to all of our customers. This customer has a custom add-on and their marketing documents are all created from custom objects.  They hit a button on the custom sales contract screen and an invoice is created.  When they hit another button on the screen, the selected invoice is credited. They have legally binding contracts for fixed quantities to be shipped, so we decrease the quantity shipped when creating an invoice and decrease the quantity shipped when a credit memo is created. The contract is fulfilled when the exact quantity contracted for has been shipped. Because the credit memo fails, we canu2019t update the custom objectu2019s remaining to be shipped, rendering it inaccurate from that time forward. (reducing the quantity shipped is part of the Credit Memo creation process).Creating Credit Memos and Invoices from the interface fixes the inventory count, customer balance, etc., but we have no way of fixing the sales contractu2019s quantity shipped & remaining to be shipped or linking the contracts to the documents created from the interface.
    Business needs: (Please describe the impact on your business, if the functionality is not realized)
    Examples: (Please describe a typical example, how the functionality should work.)
    Credit Memos should allow negative quantities and line total amounts for non-inventory items, the same way that A/R Invoices do, so that credit memos can be based on invoices that have negative quantity non-inventory line items.
    Current Workaround: (Please describe the workarounds you are using at the moment)
    Please see above
    Proposed solution: (Please suggest how the new functionality should work)
    Credit Memos should allow negative quantities and line total amounts for non-inventory items, the same way that A/R Invoices do.

    Hi Sean......
    System is behaving properly as per its logic. Infact it does same in all the previous or upcoming versions.
    If you have Item Type GRPO for Non Inventory Item it does not create any accounting but you can see the same during AP invoice.
    GRPO for such type is only optional. For further clarification you can discuss this with your CA what he suggests. But i suggest you to raise AP invoice also for getting Account effect. Just see doing this in test DB you get your answer......
    Regards,
    Rahul

  • How to enable APEX in 11gR2?

    I just got done starting from scratch on a new server. Installed OS (Windows 2008R2 SP1) and patched. Installed Grid Control. Installed 11gR2 (11.2.0.1). Verified that the database is up and working. I'm trying to enable the existing APEX already in the database. It's 3.2 version (I will upgrade to 4.1 AFTER porting my application). I can not find any documentation that is limited to just enabling it, even though I can already see the users (see output).
    SQL> select username from dba_users;
    USERNAME
    MGMT_VIEW
    SYS
    SYSTEM
    DBSNMP
    SYSMAN
    OUTLN
    FLOWS_FILES   <---
    MDSYS
    ORDSYS
    EXFSYS
    WMSYS
    APPQOSSYS
    APEX_030200   <---
    OWBSYS_AUDIT
    ORDDATA
    CTXSYS
    ANONYMOUS
    XDB   <---
    ORDPLUGINS
    OWBSYS
    SI_INFORMTN_SCHEMA
    OLAPSYS
    SCOTT
    ORACLE_OCM
    XS$NULL
    BI
    PM
    MDDATA
    IX
    SH
    DIP
    OE
    APEX_PUBLIC_USER   <---
    HR
    SPATIAL_CSW_ADMIN_USR
    SPATIAL_WFS_ADMIN_USR
    36 rows selected.Please tell me just how to enable access. Thanks.

    Okay, for anyone else trying to do this, here's all you have to do.
    First, don't read the documentation as a step-by-step guide. The only result will be to frustrate you (like it did me).
    Second, isolate what is installed already. If you were like me, you installed ASM, then the database, and didn't know where to go. A quick query of the users shows that the schemas for APEX are installed. XDB is also up and ready to go. What it doesn't tell you is that all you need is the application server portion. Though it would have been MUCH more straightforward if they just said "now reference this section in the APEX install guide to install the [insert application server here]", they don't. So here's where to go: http://docs.oracle.com/cd/E14373_01/install.32/e13366/db_install.htm#CBHEEDHJ (please note that this is for Embedded PL/SQL gateway)
    Third, copy/paste the few scripts into a command prompt logged in as the SYS user to enable the application server of your choice.
    Fourth, go to the URL: http://[hostname]:[port]/apex/apex_admin. This should be the main APEX admin page where you set up users, create applications, etc. If you can get it, great - you're ready to begin development, porting of applications, upgrading, etc.

  • Negative quantity in deliver field in production order - CO02

    Hi All,
    I am doing production confirmation and goods receipt for production order through back ground using standard BAPI.While doing GR for production order in background the following error occured.
      System is throughing dump - Arithmatical logical conversion problem.when we analysed through ST22 we came to know that negative quantity appearing in field of delivered in production order.
      Screen name.............. "SAPLCOKO1"
      Screen number............ 0120
      Screen field............. "CAUFVD-GWEMG"
    As per standard, delivered field in production order is always in display mode only. So there will not be any chance for user to change the delivered field.
    Pls guide me how to overcome the above issue and what is exact root cause for the above problem.
    System is throwing error in change mode ( Co02) and display mode ( CO03 ) for the respective production order number
    Thanks
    P.Srinivasan

    Hi,
    This inconsistency can be solved with the following correction report. If you want to try by yourself, then implement it manually in transaction SE38 and execute in test mode first to check if the inconsistency is found. And obviously, in a TEST system first.
    If you are NOT confident about it, I recommend you to submit a support message for SAP for further investigation since this is a database inconsistency.
    Regards,
    Marcelo
    <pre>
    *& Report  ZPCON_076B                                                  *
    *& This report checks goods receipt quantity (WEMNG) and value (WEWRT) *
    *& of an order item for consistency with the corresponding material    *
    *& documents. In UPDATE mode, the quantity and the value calculated    *
    *& from the material documents will be written to database table AFPO. *
    REPORT  zpcon_076b LINE-SIZE 90.
    INCLUDE lcokotyp.
    TABLES: afpo.
    SELECTION-SCREEN COMMENT /1(80) text1.                      "#EC NEEDED
    SELECTION-SCREEN COMMENT /1(80) text2.                      "#EC NEEDED
    SELECTION-SCREEN COMMENT /1(80) text3.                      "#EC NEEDED
    SELECTION-SCREEN COMMENT /1(80) text4.                      "#EC NEEDED
    SELECTION-SCREEN COMMENT /1(80) text5.                      "#EC NEEDED
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN COMMENT /1(80) texta.                      "#EC NEEDED
    SELECT-OPTIONS r_aufnr FOR afpo-aufnr.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN BEGIN OF BLOCK block WITH FRAME TITLE title."#EC NEEDED
    SELECTION-SCREEN COMMENT /1(72) texty.                      "#EC NEEDED
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME.
    PARAMETERS: testmode RADIOBUTTON GROUP mode DEFAULT 'X'.
    PARAMETERS: update RADIOBUTTON GROUP mode.
    SELECTION-SCREEN END OF BLOCK block2.
    SELECTION-SCREEN COMMENT /1(72) textz.                      "#EC NEEDED
    SELECTION-SCREEN END OF BLOCK block.
    DATA: BEGIN OF ls_afpo.
            INCLUDE STRUCTURE afpo.
    DATA: END OF ls_afpo.
    DATA  lt_afpo LIKE ls_afpo OCCURS 0.
    DATA: BEGIN OF ls_mseg.
            INCLUDE STRUCTURE mseg.
    DATA: END OF ls_mseg.
    DATA  ls_mseg2 LIKE ls_mseg.
    DATA  lt_mseg LIKE ls_mseg OCCURS 0.
    DATA  ls_mkpf TYPE mkpf.
    DATA l_initial_ltrmi TYPE co_ltrmi VALUE IS INITIAL.
    DATA l_orders TYPE sytabix.
    DATA l_entries TYPE sytabix.
    DATA l_sum_wemng TYPE wemng.
    DATA l_sum_wewrt TYPE wewrt.
    DATA l_error TYPE xfeld.
    INITIALIZATION.
      text1 = 'This report checks goods receipt quantity (WEMNG) and'.
      text2 = 'value (WEWRT) of an order item for consistency with the '.
      text3 = 'corresponding material documents. In UPDATE mode, the'.
      text4 = 'quantity and the value calculated from the material'.
      text5 = 'documents will be written to database table AFPO.'.
      texta = 'Please specify order numbers of orders to be processed.'.
      texty = 'If TESTMODE is set, no database update will occur.'.
      textz = 'Set radio button UPDATE for updating the database entries.'.
      title = 'Mode'.
    AT SELECTION-SCREEN.
    orders specified?
      IF r_aufnr IS INITIAL.
        MESSAGE e889(co) WITH 'Please specify order numbers'.
      ENDIF.
    START-OF-SELECTION.
    select order items
      SELECT *
             FROM  afpo
             INTO  TABLE lt_afpo
             WHERE aufnr IN r_aufnr
             AND ( dauty = auftragstyp-fert
                OR dauty = auftragstyp-netw
                OR dauty = auftragstyp-inst
                OR dauty = auftragstyp-rma
                OR dauty = auftragstyp-bord ).
      DESCRIBE TABLE lt_afpo LINES l_orders.
    check order items
      LOOP AT lt_afpo INTO ls_afpo.
        REFRESH lt_mseg.
        CLEAR l_sum_wemng.
        CLEAR l_sum_wewrt.
        CLEAR l_error.
        SELECT *
               FROM  mseg
               INTO  TABLE lt_mseg
               WHERE matnr = ls_afpo-matnr
                 AND werks = ls_afpo-pwerk
                 AND aufnr = ls_afpo-aufnr
                 AND aufps = ls_afpo-posnr
                 AND kzbew = 'F'
               %_HINTS ORACLE 'rule'.
        IF NOT sy-subrc IS INITIAL.
        no goods movements --> nothing to do.
          DELETE lt_afpo.
          CONTINUE.
        ENDIF.
        LOOP AT lt_mseg INTO ls_mseg.
          IF ls_mseg-shkzg ='S'.
          inward movement
            IF NOT ls_mseg-dmbtr IS INITIAL.
              l_sum_wewrt = l_sum_wewrt + ls_mseg-dmbtr.
            ENDIF.
            IF NOT ls_mseg-bstmg IS INITIAL.
              l_sum_wemng = l_sum_wemng + ls_mseg-bstmg.
            ELSE.
              IF ls_mseg-erfme = ls_afpo-amein.
                l_sum_wemng = l_sum_wemng + ls_mseg-erfmg.
              ELSE.
                IF ls_mseg-meins = ls_afpo-amein.
                  l_sum_wemng = l_sum_wemng + ls_mseg-menge.
                ELSE.
                  WRITE: 'ERROR - Order', ls_afpo-aufnr COLOR 6.
                  DELETE lt_afpo.
                  l_error = 'X'.
                  EXIT.
                ENDIF.
              ENDIF.
            ENDIF.
            ls_mseg2 = ls_mseg.
          ELSE.
          outward movement
            IF NOT ls_mseg-dmbtr IS INITIAL.
              IF ls_mseg-dmbtr NE ls_mseg-bualt AND
                 NOT ls_mseg-bualt IS INITIAL.
                l_sum_wewrt = l_sum_wewrt - ls_mseg-bualt.
              ELSE.
                l_sum_wewrt = l_sum_wewrt - ls_mseg-dmbtr.
              ENDIF.
            ENDIF.
            IF NOT ls_mseg-bstmg IS INITIAL.
              l_sum_wemng = l_sum_wemng - ls_mseg-bstmg.
            ELSE.
              IF ls_mseg-erfme = ls_afpo-amein.
                l_sum_wemng = l_sum_wemng - ls_mseg-erfmg.
              ELSE.
                IF ls_mseg-meins = ls_afpo-amein.
                  l_sum_wemng = l_sum_wemng - ls_mseg-menge.
                ELSE.
                  WRITE: 'ERROR - Order', ls_afpo-aufnr COLOR 6.
                  DELETE lt_afpo.
                  l_error = 'X'.
                  EXIT.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDLOOP. "AT lt_mseg
      only continue if no error in the calculation occurred
        CHECK l_error IS INITIAL.
        IF ls_afpo-wemng = l_sum_wemng AND
           ls_afpo-wewrt = l_sum_wewrt.
        values are correct, no update necessary
          DELETE lt_afpo.
          CONTINUE.
        ENDIF.
        FORMAT: COLOR 1.
        WRITE: / 'Order', ls_afpo-aufnr, 'material', ls_afpo-matnr.
        FORMAT: COLOR OFF.
        WRITE: /3 'Order item data   : quantity',
                  ls_afpo-wemng UNIT ls_afpo-amein, ls_afpo-amein, 'value',
                  ls_afpo-wewrt CURRENCY ls_mseg-waers, ls_mseg-waers.
        WRITE: /3 'Material documents: quantity',
                  l_sum_wemng UNIT ls_afpo-amein, ls_afpo-amein, 'value',
                  l_sum_wewrt CURRENCY ls_mseg-waers, ls_mseg-waers.
        FORMAT: COLOR 2.
        WRITE: /3 'Material doc.  BWART', 30 'stock qty  UoM',
               52 'entry qty  UoM', 77 'value  Curr'.
        FORMAT: COLOR OFF.
        LOOP AT lt_mseg INTO ls_mseg.
          WRITE: /3 ls_mseg-mblnr, ls_mseg-zeile, ls_mseg-bwart,
                   ls_mseg-menge UNIT ls_mseg-meins, ls_mseg-meins,
                   ls_mseg-bstmg UNIT ls_mseg-bstme, ls_mseg-bstme,
                   ls_mseg-dmbtr CURRENCY ls_mseg-waers, ls_mseg-waers.
        ENDLOOP.
        IF NOT update IS INITIAL.
        set delivery date
          IF l_sum_wemng IS INITIAL.
          initial delivery quantity --> initial delivery date
            UPDATE afpo SET   ltrmi = l_initial_ltrmi
                        WHERE aufnr = ls_afpo-aufnr
                          AND posnr = ls_afpo-posnr.
          ELSE.
          read posting date from last valid goods receipt
            SELECT SINGLE * FROM  mkpf
                            INTO  ls_mkpf
                            WHERE mblnr = ls_mseg2-mblnr
                              AND mjahr = ls_mseg2-mjahr.
            IF sy-subrc IS INITIAL.
              UPDATE afpo SET   ltrmi = ls_mkpf-budat
                          WHERE aufnr = ls_afpo-aufnr
                            AND posnr = ls_afpo-posnr.
            ELSE.
            leave LTRMI untouched
            ENDIF.
          ENDIF.
        set quantity and value
          UPDATE afpo SET   wemng = l_sum_wemng
                            wewrt = l_sum_wewrt
                      WHERE aufnr = ls_afpo-aufnr
                        AND posnr = ls_afpo-posnr.
          FORMAT: COLOR COL_POSITIVE.
          WRITE: /3 'Order item data corrected from material documents.'.
          FORMAT: COLOR OFF.
        ENDIF.
        ULINE.
      ENDLOOP. "AT lt_afpo
      WRITE: / 'Number of checked order items     :', l_orders.
      DESCRIBE TABLE lt_afpo LINES l_entries.
      WRITE: / 'Number of inconsistent order items:', l_entries.
      IF NOT update IS INITIAL    AND
         NOT l_entries IS INITIAL.
        WRITE: / 'Inconsistencies were corrected from material documents.'
                  COLOR COL_POSITIVE.
      ENDIF.
      ULINE.
    </pre>
    Edited by: Wilian Segatto on Jan 25, 2011 12:27 PM

  • How to enable frontend printing using Adobe Print Forms

    Otto Gold at the forum "SAP Interactive Forms by Adobe" gave me the tip that Sandra Rossi in this forum might help me out. Here is the link to my original thread How to enable frontend printing using Adobe Print Forms
    My question was:
    Hi Experts!
    Did anyone of you manage to enable frontend printing using Adobe Print Forms? In order to save administration effort we use frontend printing in our ERP system. We just changed some SMARTFORMS to the new Adobe Forms technology. Now we learned that direct frontend printing does not work with these forms.
    Any help will be very much appreciated.
    Kind Regards,
    Gerald

    I think you'll be disappointed by a rather negative answer but I'll try to explain everything I know (or think I know) the best I can
    The simplest solution is to do a preview, and print from Adobe Reader! (as I could see on one project, users have to display one more dialog than usually to print) It's the best workaround according to me.
    How Adobe form printing works:
    When you print an Adobe form from SAP, a printer language (PCL, PS, ZPL, PDF) is retrieved from TSP0B table according to the device type, ADS (Adobe Document Services, installed in the SAP java stack) is then contacted to generate the form: a file corresponding to the printer language is generated and sent back to SAP (there are also 2 other little files but it's of none interest here). SAP stores it as a file (named SPOOL...) in the global directory (DIR_GLOBAL when you use AL11 transaction).
    When you ask SAP to print it, it sends the file as is to the printer.
    Note: when you ask SAP to display the spool, SAP sends a request to ADS which will send back a PDF (binary stream which is not stored on disk, just displayed on frontend).
    How frontend printing works:
    If you want to print a normal spool via frontend, SAP doesn't know the language of the printer you will choose. SAP sends the spool in a format named SAPWIN to a frontend program named SAPLPD, it converts the SAPWIN format into GDI, a Windows format that is understood by all printer drivers, and it is sent to the printer driver (you have selected) which converts the GDI format into the printer language.
    Any workaround?
    First possibility would be that ADS converts the PDF into SAPWIN format (by creating an Adobe .XDC file at the ADS side). SAP says it's not possible in Note 685571 - Printing PDF-based forms. As I understand, SAPWIN is a very simple language compared to PCL for example, so it is very difficult to convert a PDF to SAPWIN without losing much information. There's a SAP note about the SAPWIN language if you want to check.
    Second possibility is to print directly the PDF through Adobe Reader: you get the PDF from ADS, download it to the frontend (easy), and execute directly Adobe Reader print function. Unfortunately, I don't know if it's possible. Moreover, we should enhance the standard SAP print dialog...
    Third possibility is the one I recommended at the beginning of this post

  • Misc Receipt with negative quantity

    Hi,
    Is there anyway to create a Misc Receipt with negative quantity. I tried using the INV_TXN_MANAGER_PUB.Process_Transactions.But not able to create it.Any clue?
    Thanks in Advance!
    Srini

    Hi,
    How about this?
    Create a non-quantity tracked subinventory by name say, DamagedInv. Whenever you want to reduce/remove the damaged quantity, perform a subinventory transfer transaction from the original subinventory to the DamagedInv subinventory.
    Since DamagedInv is non-quantity tracked, it will not appear in the Subinventory LOV while performing other transactions (except miscellaneous receipt)..
    Thanks,
    Pavan.

  • Allow negative quantity for items manage by batch

    Hi All,
    I am having this issue where all items are required to be managed by batch and yet stock is allow to go negative (with the Block negative quantity unchecked) due to customer requirement.
    E.g. there are no batch to select when the item hits negative quantity.
    Any idea if this is possible in SAP B1 and possible workaround.
    Thank you in advance.
    Lip Sin

    Hi Lip Sin,
    You need to discuss and ask the same to your customer.
    Your customer has to make choice between one of this two, because when there is possibility of negative stock, just imagine how the software can keep the integrity with batch nos. ?
    You need to clearly ask your customer to choose any of this and still the customer insist, you can think to handle it using UDF for batch no, but then your customer will loose the control by batch.
    BR
    Samir Gandhi

  • Negative quantity in deliver field in CO02

    Hi All,
    I am doing production confirmation and goods receipt for production order through back ground using standard BAPI.While doing GR for production order in background the following error occured.
    System is throughing dump - Arithmatical logical conversion problem.when we analysed through ST22 we came to know that negative quantity appearing in field of delivered in production order.
    Screen name.............. "SAPLCOKO1"
    Screen number............ 0120
    Screen field............. "CAUFVD-GWEMG"
    As per standard, delivered field in production order is always in display mode only. So there will not be any chance for user to change the delivered field.
    Pls guide me how to overcome the above issue and what is exact root cause for the above problem.
    System is throwing error in change mode ( Co02) and display mode ( CO03 ) for the respective production order number
    Thanks
    P.Srinivasan

    Have you checked for SAP Notes?  I don't see any, but I don't have all the search terms from your short dump. 
    I would suspect, though, that there is a customer enhancement that is affecting your data value, and erroneously resulting in a negative value....are you aware of any customer enhancements, user exits, badis, etc.?

  • Negative Quantity - ML81N

    Dear All
    I would like to post the negative quantity against some services in ML81N , mainly due to reconcilling the previous paid amount for the said services.
    Presently as per the configuration it is not allowing the same. Can it be done & how?
    regards
    Mitesh

    you need to reverse the previous document and post the new one
    don't think you can do negative in ML81N - its similar to goods receipt - you do reversal not negative

  • Negative quantity in Zero stock check

    Hi guys
    How do i enter negative quantity in zero stock check??
    Example
    I have 10 pcs of material A. i have posted 201 movement for this material.
    A TO is created, while confirmation of TO it is found that only 8 pcs of material A are available .
    how is this handle?? and how do i clear the difference quantity.
    Regards

    HI Karthi
    i have only 10 pcs of material A. I have activated zero stock check.
    1. i have posted movement 201 for 10 pcs in IM.
    2. a TR is created which is converted into a TO.
    3. While confirming TO, i have entered actual quantity as 8 pcs and difference quanity as 2 pcs. then i have confirmed that the stock is Zero for the bin.
    4. the system now has created -2 pcs in storage type 911 and 2 pcs in storage type 999.
    as suggested by you i have tried to create a TO with respect to TR
    Details of TO
    Source type 999 qty 2
    Destination 911 qty 2
    once i confirm the TO the quanity for this material becomes Zero.
    Now the stock in 999 and 911 is zero, so i cannot post LI21.
    Let me know what am i doing wrong?
    Regards
    Edited by: Gbettaiah on Jul 28, 2011 7:54 AM
    Let me know how do i post the difference in inventory??

Maybe you are looking for