Total delivered Quantity field

Hi,
I am looking for a field that gives me total delivered quantities of an item of a sales order.
Foe Example : sales order 1000 item 20 qty 30.00 ea
two deliveries for this item
Delivery 8000 item 10 qty 20.00 each
delivery 8001 item 11 qty 10.00 each
I want to know if there is a field which gives me the total delivered quantity 30.00.
I am looking for something like the field in schedule lines tab of the sales order.
There is a structure field (RV45A-VSMNG).This field is for Delivered quantity in sales units.
Is this field directly available in a database table.
Please help.

Hi,
I am looking for a field which gives me total delivered quantity by giving the sales order. LIKP and LIPS need delivery number as the input.
e.g. sales order 1000 qty 30 ea.
I need the delivered quantity for this sales order.
If there are 2 deliveries for this sales order,
delivery1 qty 10 ea
delivery2 qty 15 ea
Now the total delivered quantity is 25 for the sales order.
I am looking for a field which gives me this field.
With likp I only get the delivered quantity in a particular delivery which is not necessarily the total delivered qty for a sales order.
Please let me know if there is a field for this.
Tks a lot ..

Similar Messages

  • How To Get The Total Delivered Quantity of a Sales Order

    Hello All,
    I have a requirement of getting the total delivery quantity of the sales order .I have checked it in LIps table but I am getting partially delivered quantity for a schedule line item.Can any one tell me how to get the total delivered quantity.
    Regards,
    Pavani.

    Hi
    Check the Table:
    VBEP  - Sales Document: Schedule Line Data.
    Inside the table check the Quantity Fields.
    Regards,
    Sreeram

  • Total planning quantity field

    hi friends,
    from which table i get the field for Total planning quantity.
    actually i found the structure for it i.e PBPT and fielld name is PLGMG
    but i dont get from any data base table.
    with regards.

    hi shreeram ,
    AM60X                            Work fields for SAPMM60X
    HM60X                            Help fields SAPMM60X
    MDALV_MD73_PBPT    Structure for ALV: Item Data MD73 Ind. R
    PBIMOUT               Output Structure Items Planned Independe
    PBPT                             Table of ind. requirements item data
    PBPTVB                           Reference structure for XPBPT
    RBPT                             Table for reference reqmts item data
    regards
    sandeep patel

  • Delivered quantity for each schedule line

    Hi,
    Our scenario is that we have an order for each order's each item we can have multiple schedule lines, when any of the schedule line is delivered the delivered quantity colum is updated, the schedule lines table in VBEP but the thing is it doesnot have the delivered quantity, system calculates it at runtime or may be it is keeping it in some other table.
    I hope some body can help in this regard.
    Thanks
    Khusro Habib

    It is a calculated value, not a value of a table field. Also, it may lead to wrong results if you don't pay attention to this description of the field here under in bold.
    Delivered quantity in sales units
    The quantity from the schedule line that has already
    been delivered.
    Use
    When there is more than one schedule line for an item,
    the system distributes the total delivered quantity for
    the item across the schedule lines according to the
    sequence of their delivery.
    Example
    A sales order item has three schedule lines, each with
    an order quantity of 50 pieces. You make two subsequent
    deliveries: the first for 20 pieces, the second for 60
    pieces. The delivered quantity for the first schedule
    line is 50 pieces, for the second 30 pieces, and for the
    third zero.
    If you delete the first delivery (20 pieces), the
    delivered quantity for this schedule line is still 50
    pieces. However, the system reduces the delivered
    quantity for the second schedule line to 10 pieces.

  • Quantity fields not getting displayed in the second total row

    Hi,
    As per the requirement I have to display 2 total rows for an ALV report using CL_GUI_ALV_GRID. I am able to get the first total row properly using method get_subtotal(). However for the next total row only the character fields are getting displayed and the quantity fields are coming blank.
    The second total row will have different values based on a formula.
    Please help me out in resolving the issue.
    Thanks,
    Abhishek

    You can provide first row as the SUBTOTAL and next row as the TOTAL.
    Get one extra column on which you can do the SUBTOTAL.
    Regards,
    Naimesh Patel

  • Getting Sales order -Schedule line field , Delivered Quantity ( VSMNG ) ??

    Hi...
    I need to use the Delivered Quantity present in a sales order at schedule line level.
    This field can be seen if we, enter a sales order in VA02 and click on the Item and then click on the 'Schedule Lines' tab... i need to know.. how do i fetch the field 'Delivered Quantity' present there....
    If no values are present .. then it means.. no delivery has been done for that material........
    The F1 or Techinical help points to the field VBEPD-VSMNG...... and i found that this field is calculated at runtime in the function module RV_SCHEDULE_CHECK_DELIVERIES.....
    Can someone please tell me... how do i fetch this field ...or calculate this field..... for my requirement.....
    Regards.....

    Hi.
    You can use the function module RV_SCHEDULE_CHECK_DELIVERIES to get the delivered quanity corresponding to schedule line item  in sales order.
    Please refer below code:
    ie3mdpslx-delnr is sales order numer
    ie3mdpslx-delps is line item.
    internal table tl_da_vbep has got field VSMNG which is the delievred quantity for each line item
      SELECT * FROM vbfa
        INTO CORRESPONDING FIELDS OF TABLE  tl_xvbfa
        WHERE vbelv = ie3mdpslx-delnr
        AND posnv = ie3mdpslx-delps
        AND vbtyp_v = 'C'.
        SELECT  * FROM vbup
        INTO CORRESPONDING FIELDS OF TABLE tl_xvbup
        WHERE vbeln = ie3mdpslx-delnr
        AND posnr = ie3mdpslx-delps.
        SELECT * FROM vbep
        INTO CORRESPONDING FIELDS OF TABLE tl_da_vbep
        WHERE vbeln = ie3mdpslx-delnr
        AND  posnr = ie3mdpslx-delps.
        SELECT  * FROM vbap
        INTO CORRESPONDING FIELDS OF TABLE tl_xvbap
        WHERE vbeln = ie3mdpslx-delnr
        AND  posnr = ie3mdpslx-delps.
        CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'
          EXPORTING
            fbeleg                  = ie3mdpslx-delnr
            fposnr                  = ie3mdpslx-delps
          TABLES
            fvbfa                   = tl_xvbfa
            fvbup                   = tl_xvbup
            fxvbep                  = tl_da_vbep
            fvbap                   = tl_xvbap
          EXCEPTIONS
            fehler_bei_lesen_fvbup  = 1
            fehler_bei_lesen_fxvbep = 2
            OTHERS                  = 3.

  • CJI3 report not displaying values correctly in the "Total Quantity" field

    Dear Friends,
    Need your assistance on the issue explained below,
    In our project there is a scenario where the actuals posted on a WBS are split/distributed to various WBS.These actuals that are split can be CATS entries,manual posting (KB21) or postings that come to R3 from a legacy system.The split happens by means of a custom program and is not standard.There is a tab seperated text file that contains the split percentages and the sender as well as the receiver WBS elements.Off late it has been observed that after the split is done the CJI3 report does not show the split quantities correctly and hence there is difference in the values displayed in the currency field.This is not a rounding off difference and is considerable.We have done all possible analysis from our side but i am unable to find how the difference occurs.
    To add to this i have even come across certain notes which describe the issue closely but none of it has helped so far. I have simulated the scenario with the same settings in the Quality server and it seems to work fine there without any glitches. We have even compared the program in both the Quality as well as the Production servers and there is no difference in the program as well.The values for the total quantity field are stored in the table COVP and it has been observed the report is fetching this data to display in CJI3.
    I have run CJEN too but this too does not correct the report. I was just wondering if any of our colleagues can provide me with some suggestions or insight in this issue.
    Regards,
    Gokul

    Hi Praveen,
    Thanks for the response.
    Actually i did debug the program with the help of our technical guys but found nothing wrong in both the quality and the production system. We compared the program in both the systems and it seems to be same. I am exploring this issue. Will update the findings here.
    In case anyone has any suggestion please do suggest.
    Regards,
    Gokul

  • Mapping of period with total quantity field

    Hi All,
    I haVe Total quantity field MEG001,MEG002,MEG003..............MEG012 from table COSP.
    I have parameter on selection screen as period(perio) from table mbewh
    No my requirement is if the period is 00 then field MEG001
    if period is 01 then MEG002
    period11...........MEG011
    period 12............MEG012
    Please let me know if any solution.
    Regards,
    oorvi

    Hi,
    You could try like this,
    parameter: p_period type (your period field).
    data: len type i,
             var type string.
    len = p_period + 1.
    concatenate 'MEG' len into var.
    select single ( var )
    from COSP
    into temp
    where (any conditions)
    Vikranth

  • Quantity field total

    Hi experts
    here in my quantity field there are units cm2(column centimeters) and WD(words)  if u caluculate total on qty naturally it will display * is any possibilty there in report level to disply cm2 total seperately and WD total seperately if so tetll me the solution.
    regards
    anand

    Hi Anand,
    As you want the subtotals for the quantity and due to different units you are getting * values in the result, the suggested approach was to distinguish the records based on units. This can be achieved using restricted KF where we will restrict the KF on Unit. This will ensure that all the records with "for example KG" as unit will be restricted in one restricted KF. Same can be achieved for all other units.
    This means you have to create 15 restricted KFs if you have 15 different units in the data. This will result in a bit slower response while executing the query with som many restricted KFs.
    Hope this clears your doubt.
    Regards,
    Yogesh,

  • BAPI for process order header delivered quantity

    Hi,
    current requirement is to get the process order quantity with drawn and delivered quantity , when we try using the BAPI
    BAPI_PROCORD_GET_DETAIL , it does not have the process order delivered quantity - it has only total quantity  for which process order is created .
    Is there a way or any standard BAPI/RFC gives the below :
    1. Process Order Header Delivered Quantity
    2. Process order component's quantity with drawn
    Regards,
    Madhu Kiran

    Hi Madhu Kiran,
    BAPI_PROCORD_GET_DETAIL of course has all the required fields:
    1. --> check table POSITION, field DELIVERED_QUANTITY
    2. --> check table COMPONENT, field WITHDRAWN_QUANTITY
    Regards,
    Andreas

  • Table Required for Delivered Qty field in Sales Order

    Hi friends
    I can see confirmed order qty, required qty, quantity committed  in VBEP table.
    But if you see in sales order Schedule Lines you'll see one more field named as
    Delivered Quantity.
    I am not able to find this Delivered Qty in any of the SD tables....
    pls help me to find this table and field
    Pts rewarded for helpful ans..
    Thanks and regards
    Snehal

    hi,
    delivery related data is stored in LIKP and LIPS tables
    related to sd.
    reward points if hlpful.

  • Alv subtotals  and grand total for a field

    Hi friends,
    I Have an internal table ITAB1
    in that i have a senario as below.
    In my GRID display iam getting values in the layou as follows
    BUKRS =  1000
    LIFNR      MATNR     STCST
    100          abc            500,00
    100          pqr             400,00
    100          xyz            200,00
                        sub total
    200         pto              700,00
    200         vbr              900,00
                        sub total
    BUKRS =  2000
    LIFNR      MATNR     STCST
    150          abc            500,00
    150          pqr             400,00
    150          xyz            200,00
                        sub total
    260         pto              700,00
    260         vbr              900,00
                        sub total
              GRAND TOTAL = 
    Now my requirement is at the end of every vendor  i need sub total for STCST field.
    and at the end of every company code i need GRAND TOTAL for STCST field.
    Its alv grid display.
    how can i do that.
    Regards,
    Priyanka.

    Check this sample code may it will help u:
    *& Report  Z_ALV_SUBTOTAL
    REPORT z_alv_subtotal.
    *& Table declaration
    TABLES: ekko.
    *& Type pool declaration
    TYPE-POOLS: slis. " Type pool for ALV
    *& Selection screen
    SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
    *& Type declaration
    * Type declaration for internal table to store EKPO data
    TYPES: BEGIN OF x_data,
           ebeln  TYPE char30,  " Document no.
           ebelp  TYPE ebelp,   " Item no
           matnr  TYPE matnr,   " Material no
           matnr1 TYPE matnr,   " Material no
           werks  TYPE werks_d, " Plant
           werks1 TYPE werks_d, " Plant
           ntgew  TYPE entge,   " Net weight
           gewe   TYPE egewe,   " Unit of weight                          
           END OF x_data.
    *& Internal table declaration
    DATA:
    * Internal table to store EKPO data
      i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
    * Internal table for storing field catalog information
      i_fieldcat TYPE slis_t_fieldcat_alv,
    * Internal table for Top of Page info. in ALV Display
      i_alv_top_of_page TYPE slis_t_listheader,
    * Internal table for ALV Display events
      i_events TYPE slis_t_event,
    * Internal table for storing ALV sort information
      i_sort TYPE  slis_t_sortinfo_alv,
      i_event TYPE slis_t_event.
    *& Work area declaration
    DATA:
      wa_ekko TYPE x_data,
      wa_layout     TYPE slis_layout_alv,
      wa_events         TYPE slis_alv_event,
      wa_sort TYPE slis_sortinfo_alv.
    *& Constant declaration
    CONSTANTS:
       c_header   TYPE char1
                  VALUE 'H',                    "Header in ALV
       c_item     TYPE char1
                  VALUE 'S'.
    *& Start-of-selection event
    START-OF-SELECTION.
    * Select data from ekpo
      SELECT ebeln " Doc no
             ebelp " Item
             matnr " Material*
             matnr " Material*
             werks " Plant*
             werks " Plant*
             ntgew " Quantity
             gewei " Unit
             FROM ekpo
             INTO TABLE i_ekpo
             WHERE ebeln IN s_ebeln
             AND ntgew NE '0.00'.
      IF sy-subrc = 0.
        SORT i_ekpo BY ebeln ebelp matnr .
      ENDIF.
    * To build the Page header
      PERFORM sub_build_header.
    * To prepare field catalog
      PERFORM sub_field_catalog.
    * Perform to populate the layout structure
      PERFORM sub_populate_layout.
    * Perform to populate the sort table.
      PERFORM sub_populate_sort.
    * Perform to populate ALV event
      PERFORM sub_get_event.
    END-OF-SELECTION.
    * Perform to display ALV report
      PERFORM sub_alv_report_display.
    *&      Form  sub_build_header
    *       To build the header
    *       No Parameter
    FORM sub_build_header .
    * Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    * Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.
    * Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.
    ENDFORM.                    " sub_build_header
    *&      Form  sub_field_catalog
    *       Build Field Catalog
    *       No Parameter
    FORM sub_field_catalog .
    *  Build Field Catalog
      PERFORM sub_fill_alv_field_catalog USING:
         '01' '01' 'EBELN' 'I_EKPO' 'L'
         'Doc No'(003) ' ' ' ' ' ' ' ',
         '01' '02' 'EBELP' 'I_EKPO' 'L'
         'Item No'(004) 'X' 'X' ' ' ' ',
         '01' '03' 'MATNR' 'I_EKPO' 'L'
         'Material No'(005) 'X' 'X' ' ' ' ',
         '01' '03' 'MATNR1' 'I_EKPO' 'L'
         'Material No'(005) ' ' ' ' ' ' ' ',
         '01' '04' 'WERKS' 'I_EKPO' 'L'
         'Plant'(006) 'X' 'X' ' ' ' ',
         '01' '04' 'WERKS1' 'I_EKPO' 'L'
         'Plant'(006) ' ' ' ' ' ' ' ',
         '01' '05' 'NTGEW' 'I_EKPO' 'R'
         'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.
    ENDFORM.                    " sub_field_catalog
    *&     Form  sub_fill_alv_field_catalog
    *&     For building Field Catalog
    *&     p_rowpos   Row position
    *&     p_colpos   Col position
    *&     p_fldnam   Fldname
    *&     p_tabnam   Tabname
    *&     p_justif   Justification
    *&     p_seltext  Seltext
    *&     p_out      no out
    *&     p_tech     Technical field
    *&     p_qfield   Quantity field
    *&     p_qtab     Quantity table
    FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                            p_colpos    TYPE sycucol
                                            p_fldnam    TYPE fieldname
                                            p_tabnam    TYPE tabname
                                            p_justif    TYPE char1
                                            p_seltext   TYPE dd03p-scrtext_l
                                            p_out       TYPE char1
                                            p_tech      TYPE char1
                                            p_qfield    TYPE slis_fieldname
                                            p_qtab      TYPE slis_tabname.
    * Local declaration for field catalog
      DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.
      wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
      wa_lfl_fcat-col_pos        =  p_colpos.     "Column
      wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
      wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
      wa_lfl_fcat-just           =  p_justif.     "Screen Justified
      wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
      wa_lfl_fcat-no_out         =  p_out.        "No output
      wa_lfl_fcat-tech           =  p_tech.       "Technical field
      wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
      wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table
      IF p_fldnam = 'NTGEW'.
        wa_lfl_fcat-do_sum  = 'X'.
      ENDIF.
      APPEND wa_lfl_fcat TO i_fieldcat.
      CLEAR wa_lfl_fcat.
    ENDFORM.                    " sub_fill_alv_field_catalog
    *&      Form  sub_populate_layout
    *       Populate ALV layout
    *       No Parameter
    FORM sub_populate_layout .
      CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'." Optimization of Col width
    ENDFORM.                    " sub_populate_layout
    *&      Form  sub_populate_sort
    *       Populate ALV sort table
    *       No Parameter
    FORM sub_populate_sort .
    * Sort on material
      wa_sort-spos = '01' .
      wa_sort-fieldname = 'MATNR'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    * Sort on plant
      wa_sort-spos = '02'.
      wa_sort-fieldname = 'WERKS'.
      wa_sort-tabname = 'I_EKPO'.
      wa_sort-up = 'X'.
      wa_sort-subtot = 'X'.
      APPEND wa_sort TO i_sort .
      CLEAR wa_sort.
    ENDFORM.                    " sub_populate_sort
    *&      Form  sub_get_event
    *       Get ALV grid event and pass the form name to subtotal_text
    *       event
    *       No Parameter
    FORM sub_get_event .
      CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
    'SUBTOTAL_TEXT'.
      DATA: l_s_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 4
        IMPORTING
          et_events       = i_event
        EXCEPTIONS
          list_type_wrong = 0
          OTHERS          = 0.
    * Subtotal
      READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " sub_get_event
    *&      Form  sub_alv_report_display
    *       For ALV Report Display
    *       No Parameter
    FORM sub_alv_report_display .
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .
    * This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort = i_sort
          it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    *    MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.
    ENDFORM.                    " sub_alv_report_display
    *       FORM sub_alv_top_of_page
    *       Call ALV top of page
    *       No parameter
    FORM sub_alv_top_of_page.                                   "#EC CALLED
    * To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page
    *&      Form  subtotal_text
    *       Build subtotal text
    *       P_total  Total
    *       p_subtot_text Subtotal text info
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    * Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.
    * Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    ENDFORM.                    "subtotal_text
    Edited by: Joyjit Ghosh on Aug 21, 2008 5:25 PM

  • Schedule lines not covering  the total order Quantity

    We have an issue  with Schedule lines
    Order created on  19-02-201
    Material =M
    Requirement type =KSV
    Order Quantity =2500
    Delivered Quantity=1700
    Schedule Lines
    Date               Order quantity       Confirmed Quantity        Delivered  Quantity
    19-02-2010     801                                        0
    19-03-210       500                                        0
    16-04-2010      500                                    500                                       500
    14-05-2010      500                                    0
    15-06-2010     0                                        500                                        500
    15-06-2010      0                                        500                                        500
    18-06-2010      200                                   200                                         200
    Item  Status
               Processing Status
                                         Overall status=Completed
                                         Delivery Status= Fully Delivered
    1)Even though we have not delivered the total Order Quantity 2500,Delivery Staus is Fully Delivered Why?
    2)Why the system not created SCHEDULE LINES for the remaining Order Quantity  2500-1700=800

    Check if there are still requirements existing for this order on MD04.
    You might also want to check how the availabilty is carried out, whats the replinishment lead time - anything mentioned there. Generally if you take RLT into consideration - then the unfulfilled qty is shown at the end of RLT.
    Not too clear at this moment on the dates you have mentioned, bit hard to read.
    Am curious too, why this is happening.

  • Down Payment - Final Invoice Based on Real Delivered Quantity

    Hello all!
    My need is the following:
    The final invoice for a Down-Payment must in consequence of the real delivered quantity:
    Exemple:
    Sales Order: 100 Units for a total amount of 100u20AC
    Down Payment Request: 30% --> 30u20AC - So it miss 70u20AC to clear it.
    Now: complicated:
    Delivery: Only 50 units available and shipped.
    Final Invoice:   Amount equal to (100-30)*50/100 
    Any idea?!
    Seb

    Hello Petronella,
    you are right that B1 is not checking the total value of DP created from the Sales Order.
    The logic and checking procedure here is only between Sales Order -> Delivery/Invoice.
    DP Invoice is considered as transaction related to document the receipt of the money (parallel to the sales process). Between the moment of basing of DP to Sales Order it is still possibility to adjust Sales Order as there is no posting behind Sales Order.
    The question is what would be a checking  procedure in case that on Sales Order there is based Delivery and DP? What would be the system priority to take into a consideration?
    Regards,
    Martin Slavik
    Regional Solution Manager

  • Quantity field in at user-command

    Hi,
    I have declared the quantity field  V_QTY TYPE AFKO-GAMNG.
    I am passing the quantity field values from the internal table which is having data for the quantity field to V_QTY. but the field V_QTY is not filling with the quantity.
    Instead of the quantity, it is taking the   * value into the field.
    I am not using any control break commands in my coding.  I am attaching the code also. can anyone guide me .
    Report ztest.
    TABLES:  AFKO,                         " Order Header
             AFPO,                         " Order Item
             AUFK,                         " Order Master
             RESB,
             AFVC,                         " Order Operation w/i an Order
             AFVV,                        " Qty/Dates/values in an Operation
             CRHD,                         " Work Center
             MARA,                         " Material Master
             MAKT,                         " Material Description
             AUSP,                         " Characteristic Values
             CABN,                         " Characteristic
             PLPO,                         " Task list-operation/activity
             PLFL,                         " Task list - sequences
             TJ02T,                        " System status texts
             JEST.                         " Individual Object Status
    TYPE-POOLS:SLIS.
    TYPE-POOLS:ICON.
    DATA:CHECK(1),
         TOTAL(7) VALUE 'TOTAL :',
         W_AMOUNT TYPE GAMNG VALUE 0.
    TYPES:BEGIN OF T_AFKO,
          CHECK,
          AUFNR TYPE AFKO-AUFNR,
          GLTRP TYPE AFKO-GLTRP,
          GSTRP TYPE AFKO-GSTRP,
          GAMNG TYPE AFKO-GAMNG,
          PLNBEZ TYPE AFKO-PLNBEZ,
          END OF T_AFKO.
    DATA:I_AFKO TYPE STANDARD TABLE OF T_AFKO,
         W_AFKO LIKE LINE OF I_AFKO.
    DATA:I_AFKO1 TYPE STANDARD TABLE OF T_AFKO,
         W_AFKO1 LIKE LINE OF I_AFKO1.
    DATA:PONUM TYPE AFKO-AUFNR,
         STDATE TYPE AFKO-GLTRP,
         FIDATE TYPE AFKO-GSTRP,
         QUANTY TYPE AFKO-GAMNG,
         MATER  TYPE AFKO-PLNBEZ,
         DESCR  TYPE MAKT-MAKTX,
         INDEX  TYPE SY-INDEX,
         COUNT(3) VALUE '0'.
    TYPES:BEGIN OF T_FINAL,
          CHECK,
          LIGHT  TYPE ICON-ID,
          MATNR  TYPE RESB-MATNR,
          AUFNR  TYPE AFKO-AUFNR,
          GLTRP  TYPE AFKO-GLTRP,
          GSTRP  TYPE AFKO-GSTRP,
          GAMNG  TYPE AFKO-GAMNG,
          PLNBEZ TYPE AFKO-PLNBEZ,
          MAKTX  TYPE MAKT-MAKTX,
          END OF T_FINAL.
    DATA:I_FINAL TYPE STANDARD TABLE OF T_FINAL,
         W_FINAL LIKE LINE OF I_FINAL,
         I_FINAL1 TYPE STANDARD TABLE OF T_FINAL,
         W_FINAL1 LIKE LINE OF I_FINAL1.
    TYPES:BEGIN OF T_CRHD,
          OBJID TYPE CRHD-OBJID,
          ARBPL TYPE CRHD-ARBPL,
          END OF T_CRHD.
    DATA:I_CRHD TYPE STANDARD TABLE OF T_CRHD,
         W_CRHD LIKE LINE OF I_CRHD.
    TYPES:BEGIN OF T_AFVC,
          AUFPL TYPE AFVC-AUFPL,
          ARBID TYPE AFVC-ARBID,
          END OF T_AFVC.
    DATA:I_AFVC TYPE STANDARD TABLE OF T_AFVC,
         W_AFVC LIKE LINE OF I_AFVC.
    TYPES:BEGIN OF T_ITEM,
          MATNR  TYPE RESB-MATNR,       " Component Matl Number
          MAKTX  TYPE MAKT-MAKTX,       " Matl Desc for Component
          BDMNG  TYPE RESB-BDMNG,       " Component Req'd Qty
          END OF T_ITEM.
    DATA:I_ITEM TYPE STANDARD TABLE OF T_ITEM,
         W_ITEM LIKE LINE OF I_ITEM.
    TYPES:BEGIN OF T_RESB,
          MATNR TYPE RESB-MATNR,
          AUFNR TYPE RESB-AUFNR,
          BDMNG TYPE RESB-BDMNG,
          END OF T_RESB.
    DATA:I_RESB TYPE STANDARD TABLE OF T_RESB,
         W_RESB LIKE LINE OF I_RESB.
    DATA:I_MAKT TYPE STANDARD TABLE OF MAKT,
         W_MAKT LIKE LINE OF I_MAKT,
         I_MAKT1 TYPE STANDARD TABLE OF MAKT,
         W_MAKT1 LIKE LINE OF I_MAKT1.
    TYPES:BEGIN OF T_AUFK,
          AUFNR TYPE AUFK-AUFNR,
          AUART TYPE AUFK-AUART,
          WERKS TYPE AUFK-WERKS,
          OBJNR TYPE AUFK-OBJNR,
          END OF T_AUFK.
    DATA:I_JEST TYPE STANDARD TABLE OF JEST,
         W_JEST LIKE LINE OF I_JEST.
    DATA:I_AUFK TYPE STANDARD TABLE OF T_AUFK,
         W_AUFK LIKE LINE OF I_AUFK.
    DATA:V_QTY TYPE AFKO-GAMNG,
         LINES TYPE I,
         V_AUFNR TYPE AFKO-AUFNR.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS:
    P_WERKS TYPE AUFK-WERKS OBLIGATORY MEMORY ID WRK,  " PLANT
    P_AUART TYPE AUFK-AUART OBLIGATORY.                "ORDER TYPE
    SELECT-OPTIONS: S_PLNBEZ FOR AFKO-PLNBEZ.          "material
    PARAMETERS: P_ARBPL TYPE CRHD-ARBPL OBLIGATORY.    "Work center
    SELECT-OPTIONS:
    S_GSTRP  FOR AFKO-GSTRP OBLIGATORY.   "ORDER BASIC START DATE
    *s_gltrp  FOR afko-gltrp OBLIGATORY,  "ORDER BASIC FINISH DATE
    *s_gstrs  FOR afko-gstrs,             "ORDER SCHEDULE START DATE
    *s_gltrs  FOR afko-gltrs.             "ORDER SCHEDULE FINISH DATE
    PARAMETERS:P_MATNR TYPE RESB-MATNR.
    SELECTION-SCREEN END OF BLOCK B1.
    *ALV data declarations
    DATA: I_FIELDCATALOG    TYPE SLIS_T_FIELDCAT_ALV,
          W_FIELDCATALOG    LIKE LINE OF I_FIELDCATALOG,
          S_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 VALUE SY-REPID,
          T_HEADING       TYPE SLIS_T_LISTHEADER,
          IT_LISTHEADER   TYPE SLIS_T_LISTHEADER,
          W_KEYINFO       TYPE SLIS_KEYINFO_ALV,
          WA_SORT         TYPE SLIS_SORTINFO_ALV,
          IT_SORT         TYPE SLIS_T_SORTINFO_ALV,
          IT_TITLE_BASIC  TYPE
                LVC_TITLE VALUE 'SELECTION OF PRODUCTION ORDERS',
          IT_TITLE_ITEM  TYPE LVC_TITLE VALUE 'MIXING REPORT'.
    DATA: PO TYPE AUFNR,
          P_SELFIELD TYPE SLIS_SELFIELD.
    DATA: I_EVENTS TYPE SLIS_T_EVENT,
          W_EVENTS LIKE LINE OF I_EVENTS.
    CLEAR:   W_EVENTS.
    REFRESH: I_EVENTS.
    DATA:I_HEADER TYPE SLIS_T_LISTHEADER,
         W_HEADER LIKE LINE OF I_HEADER.
    BEGIN OF CODE FOR ALV_HIERSEQ_LIST*************
    TYPES:BEGIN OF T_HHEADER,
         EXPAND,
          MATNR TYPE RESB-MATNR,
          MAKTX TYPE MAKT-MAKTX,
          V_QTY,
          END OF T_HHEADER.
    DATA:I_HHEADER TYPE STANDARD TABLE OF T_HHEADER,
         W_HHEADER LIKE LINE OF I_HHEADER.
    TYPES:BEGIN OF T_HITEM,
          CHECK,
          MATNR  TYPE RESB-MATNR,
          AUFNR  TYPE AFKO-AUFNR,
          GAMNG  TYPE AFKO-GAMNG,
          PLNBEZ TYPE AFKO-PLNBEZ,
          MAKTX TYPE MAKT-MAKTX,
          GLTRP  TYPE AFKO-GLTRP,
          GSTRP  TYPE AFKO-GSTRP,
          END OF T_HITEM.
    DATA:I_HITEM TYPE STANDARD TABLE OF T_HITEM,
         W_HITEM LIKE LINE OF I_HITEM.
    END OF CODE FOR ALV_HIERSEQ_LIST ****************************
    INITIALIZATION.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM GET_EVENTS.
      PERFORM GET_DATA.
    END-OF-SELECTION.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATALOG
          text
    FORM BUILD_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '1'.
      W_FIELDCATALOG-FIELDNAME    = 'MATNR'.
      W_FIELDCATALOG-TABNAME      = 'I_HHEADER'.
      W_FIELDCATALOG-SELTEXT_M    = 'Phantom Material'.
    W_FIELDCATALOG-ROLLNAME     = 'MATNR'.
      W_FIELDCATALOG-OUTPUTLEN    = '20'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '2'.
      W_FIELDCATALOG-FIELDNAME    = 'MAKTX'.
      W_FIELDCATALOG-TABNAME      = 'I_HHEADER'.
      W_FIELDCATALOG-SELTEXT_M    = 'Phantom Material Description'.
    W_FIELDCATALOG-ROLLNAME     = 'MAKTX'.
      W_FIELDCATALOG-OUTPUTLEN    = '40'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '3'.
      W_FIELDCATALOG-FIELDNAME    = 'BDMNG'.
      W_FIELDCATALOG-TABNAME      = 'I_HHEADER'.
      W_FIELDCATALOG-OUTPUTLEN    = '20'.
      W_FIELDCATALOG-SELTEXT_M    = 'Total Batch qty:'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '1'.
      W_FIELDCATALOG-SELTEXT_M    = 'Selection'.
      W_FIELDCATALOG-FIELDNAME    = 'CHECK'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      W_FIELDCATALOG-EDIT        = 'X'.
      W_FIELDCATALOG-CHECKBOX    = 'X'.
      W_FIELDCATALOG-INPUT       = 'X'.
    W_FIELDCATALOG-HOTSPOT     = 'X'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
    CLEAR W_FIELDCATALOG .
    W_FIELDCATALOG-COL_POS      = '2'.
    W_FIELDCATALOG-FIELDNAME    = 'MATNR'.
    W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
    W_FIELDCATALOG-ROLLNAME     = 'MATNR'.
    W_FIELDCATALOG-OUTPUTLEN    =  '12'.
    APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '2'.
      W_FIELDCATALOG-FIELDNAME    = 'AUFNR'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      W_FIELDCATALOG-ROLLNAME     = 'AUFNR'.
      W_FIELDCATALOG-OUTPUTLEN    =  '12'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-COL_POS      = '3'.
    W_FIELDCATALOG-SELTEXT_M    = 'PO Qty'.
      W_FIELDCATALOG-FIELDNAME    = 'GAMNG'.
      W_FIELDCATALOG-ROLLNAME     = 'GAMNG'.
      W_FIELDCATALOG-OUTPUTLEN    =  '20'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-COL_POS      = '4'.
    W_FIELDCATALOG-SELTEXT_M    =  'Header Material'.
      W_FIELDCATALOG-FIELDNAME    =  'PLNBEZ'.
      W_FIELDCATALOG-ROLLNAME     =  'MATNR'.
      W_FIELDCATALOG-OUTPUTLEN    =  '20'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG.
      W_FIELDCATALOG-COL_POS      = '5'.
    W_FIELDCATALOG-SELTEXT_M    = 'Material Description'.
      W_FIELDCATALOG-FIELDNAME    =   'MAKTX'.
      W_FIELDCATALOG-ROLLNAME     =   'MAKTX'.
      W_FIELDCATALOG-OUTPUTLEN    =  '40'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '6'.
      W_FIELDCATALOG-FIELDNAME    = 'GSTRP'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      W_FIELDCATALOG-ROLLNAME     = 'CO_GSTRP'.
      W_FIELDCATALOG-OUTPUTLEN    =  '10'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
      CLEAR W_FIELDCATALOG .
      W_FIELDCATALOG-COL_POS      = '7'.
      W_FIELDCATALOG-FIELDNAME    = 'GLTRP'.
      W_FIELDCATALOG-TABNAME      = 'I_HITEM'.
      W_FIELDCATALOG-ROLLNAME     = 'CO_GLTRP'.
      W_FIELDCATALOG-OUTPUTLEN    =  '10'.
    W_FIELDCATALOG-SELTEXT_M    = 'Basic End Date'.
      APPEND W_FIELDCATALOG TO I_FIELDCATALOG.
    ENDFORM.                    "BUILD_FIELDCATALOG
    *&      Form  get_events
          text
    FORM GET_EVENTS.
      CLEAR : W_EVENTS, I_EVENTS[].
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = I_EVENTS.
      READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                             INTO W_EVENTS.
      IF SY-SUBRC EQ 0.
        MOVE 'TOP_OF_PAGE' TO W_EVENTS-FORM.
        MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.
      ENDIF.
      READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
                             INTO W_EVENTS.
      IF SY-SUBRC EQ 0.
        MOVE 'SUB_USER_COMMAND' TO W_EVENTS-FORM.
        MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.
      ENDIF.
      READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_PF_STATUS_SET
                INTO W_EVENTS.
      IF SY-SUBRC EQ 0.
        MOVE 'PF_STATUS_SET' TO W_EVENTS-FORM.
        MODIFY I_EVENTS FROM W_EVENTS INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    "get_events
    *&      Form  build_layout
          text
    FORM BUILD_LAYOUT.
    gd_layout-no_input          = 'X'.
    gd_layout-colwidth_optimize = 'X'.
      GD_LAYOUT-ZEBRA             = 'X'.
      W_KEYINFO-HEADER01          = 'MATNR'.
      W_KEYINFO-ITEM01            = 'MATNR'.
      GD_LAYOUT-TOTALS_TEXT       = 'Totals'(201).
    GD_LAYOUT-EXPAND_FIELDNAME = 'EXPAND'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  data_retrieval
          text
    FORM GET_DATA.
    IF p_matnr IS NOT INITIAL.
      SELECT MATNR
             AUFNR
             BDMNG
             FROM RESB INTO TABLE I_RESB
             WHERE DUMPS = 'X'.
                AND matnr = p_matnr.
      SORT I_RESB BY MATNR AUFNR.
    ENDIF.
      SELECT * FROM JEST INTO CORRESPONDING FIELDS OF TABLE I_JEST
                   WHERE STAT = 'I0002'
                    AND INACT = ' '.
      SELECT OBJID
              ARBPL
              FROM CRHD INTO TABLE I_CRHD WHERE ARBPL = P_ARBPL.
      IF NOT I_CRHD[] IS INITIAL.
        SELECT AUFPL
               ARBID
               FROM AFVC INTO TABLE I_AFVC
               FOR ALL ENTRIES IN I_CRHD
               WHERE ARBID = I_CRHD-OBJID.
      ENDIF.
      IF NOT I_AFVC[] IS INITIAL.
        SELECT AUFNR
               GLTRP
               GSTRP
               GAMNG
               PLNBEZ
               FROM  AFKO INTO CORRESPONDING FIELDS OF TABLE I_AFKO
               FOR ALL ENTRIES IN I_AFVC
               WHERE AUFPL = I_AFVC-AUFPL
                 AND GSTRP IN S_GSTRP.
        SORT I_AFKO BY AUFNR.
      ENDIF.
      IF NOT I_AFKO[] IS INITIAL.
        SELECT AUFNR
               AUART
               WERKS
               OBJNR
               FROM AUFK INTO TABLE I_AUFK
               FOR ALL ENTRIES IN I_AFKO
                   WHERE AUFNR = I_AFKO-AUFNR
                     AND AUART = P_AUART
                     AND WERKS = P_WERKS.
        SORT I_AUFK BY AUFNR OBJNR.
        SELECT * FROM MAKT INTO TABLE I_MAKT1
                 FOR ALL ENTRIES IN I_AFKO
                 WHERE MATNR = I_AFKO-PLNBEZ
                   AND SPRAS = SY-LANGU.
        SORT I_MAKT1 BY MATNR.
      ENDIF.
      IF NOT I_RESB[] IS INITIAL.
        SELECT * FROM MAKT INTO TABLE I_MAKT
                 FOR ALL ENTRIES IN I_RESB
                 WHERE MATNR = I_RESB-MATNR
                   AND SPRAS = SY-LANGU.
        SORT I_MAKT BY MATNR.
      ENDIF.
    CLEAR W_HHEADER-BDMNG.
    ***BEGIN OF PHANTOM MATERIAL HEADER INTERNAL TABLE***
      CLEAR W_AUFK.
      CLEAR W_RESB.
      LOOP AT I_RESB INTO W_RESB.
        W_HHEADER-MATNR = W_RESB-MATNR.
        READ TABLE I_MAKT INTO W_MAKT
                  WITH KEY MATNR = W_RESB-MATNR BINARY SEARCH.
        W_HHEADER-MAKTX = W_MAKT-MAKTX.
        APPEND W_HHEADER TO I_HHEADER.
        MODIFY I_HHEADER FROM W_HHEADER INDEX SY-TABIX.
        CLEAR W_HHEADER.
        CLEAR W_RESB.
        SORT I_HHEADER BY MATNR.
        DELETE ADJACENT DUPLICATES FROM I_HHEADER.
      ENDLOOP.
    ****END OF PHANTOM MATERIAL HEADER INTERNAL TABLE***
    **BEGIN OF PHANTOM MATERIAL ITEM DETAILS***************
      IF NOT I_HHEADER[] IS INITIAL.
        LOOP AT I_HHEADER INTO W_HHEADER.
          LOOP AT I_RESB INTO W_RESB WHERE MATNR = W_HHEADER-MATNR.
            IF SY-SUBRC = 0.
              READ TABLE I_AUFK INTO W_AUFK
                         WITH KEY AUFNR = W_RESB-AUFNR.
              READ TABLE I_JEST INTO W_JEST
                         WITH KEY OBJNR = W_AUFK-OBJNR.
              IF SY-SUBRC = 0.
                W_HITEM-CHECK = CHECK.
                W_HITEM-MATNR = W_HHEADER-MATNR.
                READ TABLE I_AFKO INTO W_AFKO
                        WITH KEY AUFNR = W_AUFK-AUFNR BINARY SEARCH.
                W_HITEM-AUFNR = W_AFKO-AUFNR.
                W_HITEM-PLNBEZ = W_AFKO-PLNBEZ.
                READ TABLE I_MAKT1 INTO W_MAKT1
                        WITH KEY MATNR = W_AFKO-PLNBEZ.
                W_HITEM-MAKTX = W_MAKT1-MAKTX.
                W_HITEM-GLTRP = W_AFKO-GLTRP.
                W_HITEM-GSTRP = W_AFKO-GSTRP.
                W_HITEM-GAMNG = W_AFKO-GAMNG.
                APPEND W_HITEM TO I_HITEM.
                MODIFY I_HITEM FROM W_HITEM INDEX SY-TABIX.
                SORT I_HITEM BY AUFNR.
                CLEAR W_HITEM.
              ENDIF.
            ENDIF.
          ENDLOOP.
        ENDLOOP.
      ENDIF.
    ***********END OF PHANTOM MATERIAL ITEM DETAILS.*********************
    ENDFORM.                    "get_item_DETAILS
    *&      Form  top_of_page
          text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
      IT_LIST_COMMENTARY = I_HEADER
    I_LOGO =
    I_END_OF_LIST_GRID =
    ENDFORM.                    " alv_top_of_page
    *&      Form  user_command
          text
         -->P_UCOMM    text
         -->P_SELFIELD text
    FORM DISPLAY_ALV_REPORT.
      SORT I_HHEADER BY MATNR.
      SORT I_HITEM   BY MATNR AUFNR.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
      I_INTERFACE_CHECK              = ' '
         I_CALLBACK_PROGRAM             = GD_REPID
         I_CALLBACK_PF_STATUS_SET       = 'PF_STATUS_SET'
         I_CALLBACK_USER_COMMAND        = 'SUB_USER_COMMAND'
         IS_LAYOUT                      = GD_LAYOUT
         IT_FIELDCAT                    = I_FIELDCATALOG
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
         IT_EVENTS                      = I_EVENTS[]
      IT_EVENT_EXIT                  =
          I_TABNAME_HEADER               = 'I_HHEADER'
          I_TABNAME_ITEM                 = 'I_HITEM'
      i_structure_name_header        =
      i_structure_name_item          =
          IS_KEYINFO                     = W_KEYINFO
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB_HEADER                = I_HHEADER
          T_OUTTAB_ITEM                  = I_HITEM
    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
    *****BEGIN OF CUMMILATIVE QUANTITY***********************
    FORM PF_STATUS_SET USING EXTAB TYPE SLIS_T_EXTAB.
      BREAK POINT.
      SET PF-STATUS 'STANDARD' EXCLUDING EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    *&      Form  SUB_USEMR_COMMAND
          text
         -->P_UCOMM    text
         -->P_SELFIELD text
    FORM SUB_USER_COMMAND  USING P_UCOMM  LIKE SY-UCOMM
                           P_SELFIELD TYPE SLIS_SELFIELD.
      CASE SY-UCOMM.
        WHEN 'SUMM'.
          CLEAR W_HITEM.
          CLEAR W_HHEADER-V_QTY.
          P_SELFIELD-REFRESH = 'X'.
          DATA:LV_TABIX TYPE SY-TABIX.
          LOOP AT I_HITEM INTO W_HITEM.
            READ TABLE I_HHEADER INTO W_HHEADER
                        WITH KEY MATNR = W_HITEM-MATNR BINARY SEARCH.
            IF SY-SUBRC = 0.
              LV_TABIX = SY-TABIX.
              IF W_HITEM-CHECK = 'X'.
                W_HHEADER-V_QTY = W_HHEADER-V_QTY +  W_HITEM-GAMNG.
                MODIFY I_HHEADER FROM W_HHEADER
                      INDEX LV_TABIX." TRANSPORTING V_QTY.
              ENDIF.
            ENDIF.
          ENDLOOP.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    *********END OF CUMMILATIVE QUANTITY
    Thanks in advance.
    Ramesh.

    Hello Ramesh,
    Check your declerations,
    In internal table  I_HHEADER , the quantity field is of character type. And in internal table I_HITEM, the field GAMNG is of type quantity. There will be type mismatch.Correct it and see if it works.
    Regards

Maybe you are looking for

  • How to do comparison in a loop.

    Hi all,   TYPES: BEGIN OF ZROUTE,          VBELN TYPE VBELN,          ROUTE TYPE ROUTE,         END OF ZROUTE.   DATA : IT_ZROUTE TYPE STANDARD TABLE OF ZROUTE,          WA_ZROUTE TYPE ZROUTE.       LOOP AT I_XVTTP_TAB INTO LW_XVTTP.         WA_ZROUT

  • How to add a photo from a collection to a book in Lightroom 4.1?

    How to add a photo from a collection to a book in Lightroom 4.1?

  • I want to modify customer master record's bank detail with BAPI or FM.

    I searched for everywhere but I couldn't find it. is there anybody who knows the function or the bapi ? Thank you for reading, Best regards, Jonghwan.

  • Adobe Reader Toolbar Problem

    I am having a TOOLBAR problem with Adobe Reader 10.0 and 11.0. When I update from Reader 9.0 to either one of the aforementioned I do not get a toolbar so I have to revert to 9.0. What is the problem? My operating system is Windows XP 64.

  • Customizing the basic search

    hi all is there a way to fully customize the basic search portlet? how can i change the name of the "search" button - i want it to be in my native language, and the portal doens have a translation for it can anyone help?