Notification Status on a Particular Date

Hi Experts,
Could you help know in case if there is any FM to track a Notification Status on a particular Date.
Regards,
KB

Hi KB, 
Not sure what it is you want.  What is FM?  Is Notification Status a field in your database? 
A little more information would help here. 
Thanks,
Brian

Similar Messages

  • PR status on a particular date..

    Gentlemen,
    I have to develop this Report for Procurement for the buyer monthly Performance.
    In this one of my requirement is to get all the PR's which were open before 1st of may..(or which ever month they like to see)
    How can i get these PR's..?
    Please suggest some solution...appreciate ur help..
    thanks.

    Hi Srinivas,
    I did actually say in my post that performance would be an issue with this approach.  But it appears that in standard functionality there is not much more you can do.
    There are a lot of ways to be smart with the way you select your initial candidates, however.  You dont need to select all PRs with status p,A,K.  On the PR Eban table, you have ERDAT which is last changed date.  You can exclude all p,A,K records whose last changed date is before your report date as they have not changed after the report date and hence will not have changed status after the report date.  This is just one example, there will be many more you can choose (maybe a business rule is that PRs older than 2 months are not relevant, restrict by purchasing org, purchasing grp etc.).
    If you still don't like this solution then you will have to do some enhancement of the PR/PO transaction.  There are no standard change documents for PR status, so you can perhaps use a BADI/User exit to update a z table every time the PR status changes.  Just record the PR number, the old status, the new status, the date, and the time. 
    Then your report can use the z table in its processing.
    I thought your question was related to standard functionality.  If you are prepared to enhance the PR transaction then clearly you will get a solution which performs better.
    Cheers,
    Brad

  • Stock Status on a particular date in past.

    Hi MM Gurus,
    I am looking for a transaction code that should give me a report when i enter a plant and /or storage location along with the date from and date to. This report should have all the material that are there in that plant and /or storage location and their details like quantity recieved and quantity issued. I know about MB5B and MC.8. Is there any other T-code apart from these two.
    I am actually after the opening and closing stocks of all the materials in a plant and/ or storage location for particular period like from beginging of month till the end of the month.
    Can any one suggest something.
    Anoop

    Hi,
    For this you need to develop a custom report using the tables mseg ,mbew,mkpf,t001w,makt,bseg,bkpf,bsim,t001k,mara,t134,t023 etc. As the details being required are to be got from different fields of these tables.
    Dhruba

  • How to know the status of equipment on a particular date

    hi experts,
                   when we go to IE02 t.code there is a field showing the status of the equipment on particular date( Valid from and valid to ). If it is assigned to a particular functional location its status is displayed INST and its not assined its AVBL . Can i know from which table i can get the status of the equipment on particular date.

    hi expert,
                 I could not get the status whether it is AVLB  or INST from those table, i could see who has changed it.Could you be a bit clear regarding it

  • Stock on a particulare date

    Hi,
    i am developing a STOCk-in-transit report, wherein , i need to display stock on a date entered by the user on selection screen. The stock includes all stock type (unrestricted, quality and blocked stock). How do we calculate the stock on a particular date?

    check out the logic in this program if it helps...
    TABLES : MARA,MAKT,MARD,t001w,stpo,stas.
    data : begin of t_mara occurs 0,
           matnr like mara-matnr,
           end of t_mara.
    data : begin of t_mard occurs 0,
           matnr like mara-matnr,
           werks like mard-werks,
           labst like mard-labst,
           insme like mard-insme,
           speme like mard-speme,
           end of t_mard.
    data : l_stk1 like mard-labst,
           l_stk2 like mard-insme,
           l_stk3 like mard-speme.
    ----   BOM -
    DATA : BEGIN OF it_mast OCCURS 0,
            matnr LIKE mast-matnr,
            werks LIKE mast-werks,
            stlan LIKE mast-stlan,
            stlnr LIKE mast-stlnr,
            stlal LIKE mast-stlal,
           END OF it_mast.
    DATA : BEGIN OF wa_mast OCCURS 0,
           matnr LIKE mast-matnr,
           werks LIKE mast-werks,
           stlan LIKE mast-stlan,
           stlnr LIKE mast-stlnr,
           stlal LIKE mast-stlal,
          END OF wa_mast.
    DATA : BEGIN OF it_mast1 OCCURS 0,
            matnr LIKE mast-matnr,
            werks LIKE mast-werks,
            stlan LIKE mast-stlan,
            stlnr LIKE mast-stlnr,
            stlal LIKE mast-stlal,
           END OF it_mast1.
    DATA : BEGIN OF it_stas OCCURS 0,
            stlty LIKE stas-stlty,
            stlnr LIKE stas-stlnr,
            stlal LIKE stas-stlal,
            stlkn LIKE stas-stlkn,
            stasz LIKE stas-stasz,
            datuv LIKE stas-datuv,
            stvkn LIKE stas-stvkn,
           END OF it_stas.
    DATA : BEGIN OF it_stpo OCCURS 0,
            stlty LIKE stpo-stlty,
            stlnr LIKE stpo-stlnr,
            stlkn LIKE stpo-stlkn,
            stpoz LIKE stpo-stpoz,
            idnrk LIKE stpo-idnrk,
            meins LIKE stpo-meins,
            menge LIKE stpo-menge,
           END OF it_stpo.
    DATA : BEGIN OF t_stpo OCCURS 0,
            stlty LIKE stpo-stlty,
            stlnr LIKE stpo-stlnr,
            stlkn LIKE stpo-stlkn,
            stpoz LIKE stpo-stpoz,
            idnrk LIKE stpo-idnrk,
            meins LIKE stpo-meins,
            menge LIKE stpo-menge,
           END OF t_stpo.
    DATA : BEGIN OF wa_stpo1 OCCURS 0,
            stlty LIKE stpo-stlty,
            stlnr LIKE stpo-stlnr,
            stlkn LIKE stpo-stlkn,
            stpoz LIKE stpo-stpoz,
            idnrk LIKE stpo-idnrk,
            meins LIKE stpo-meins,
            menge LIKE stpo-menge,
           END OF wa_stpo1.
    data: begin of it_final occurs 0,
          stlnr like stpo-stlnr,
          matnr like mast-matnr,
          menge like stpo-menge,
    end of it_final.
    data: begin of it_final1 occurs 0,
          stlnr like stpo-stlnr,
          matnr like mast-matnr,
          menge like stpo-menge,
    end of it_final1.
    data mult_par type c.
    -- END OF BOM--
    data: WA_TOTSTK like mard-speme.
    data G_Matno like mara-matnr.
    data bom_req_qty like mard-speme.
    data WA_AVLSTUS like mard-speme.
    select-options: S_Matno FOR mara-matnr.
    parameterS     : P_plant like t001w-werks,
                     P_BOM like mara-matnr.
    perform validation.
    perform Inputdata.
    perform Calcdata.
    form validation.
    if S_Matno is initial.
    message e001 with text-001.
    ENDIF.
    if P_plant is initial.
    message e001 with text-002.
    endif.
    if P_BOM is initial.
    message e001 with text-003.
    endif.
    select matnr from mara INTO table t_mara
                      where matnr in S_Matno.
    if sy-subrc <> 0.
    message e001 with text-004.
    endif.
    select single * from t001w where werks = P_plant.
    if sy-subrc <> 0.
    message e001 with text-005.
    endif.
    select single * from mara where matnr = P_BOM.
    if sy-subrc <> 0.
    message e001 with text-004.
    endif.
    endform.
    form Inputdata.
    select matnr from mara into table t_mara
                    where matnr in S_Matno.
    if sy-subrc = 0.
    select matnr werks labst insme speme from
                          mard into table t_mard
                          for all entries in t_mara
                          where matnr = t_mara-matnr and
                                werks = P_plant.
    endif.
    endform.
    form Calcdata.
    loop at t_mara.
    select single * from makt where matnr = t_mara-matnr.
    if sy-subrc = 0.
    G_Matno = t_mara-matnr.
    *WRITE:/ SY-ULINE(164).
    WRITE:1 sy-vline.
    write:2 t_mara-matnr.
    write:19 sy-vline.
    write:20 makt-maktx.
    write:56 sy-vline.
    endif.
    loop at t_mard.
    if t_mard-matnr = t_mara-matnr.
    l_stk1 = l_stk1 + t_mard-labst.
    l_stk2 = l_stk2 + t_mard-insme.
    l_stk3 = l_stk3 + t_mard-speme.
    endif.
    endloop.
    write:57 l_stk1.
    write:74 sy-vline.
    write:75 l_stk2.
    write:92 sy-vline.
    write:93 l_stk3.
    write:110 sy-vline.
    WA_TOTSTK = l_stk1 + l_stk2 + l_stk3.
    write:111 WA_TOTSTK.
    WRITE:128 SY-VLINE.
    perform BOMDATA.
    write:129 bom_req_qty.
    write:146 sy-vline.
    if bom_req_qty >= 1.
    WA_AVLSTUS = ( ( 1 / bom_req_qty ) * WA_TOTSTK ).
    else.
    WA_AVLSTUS = '0.00'.
    ENDIF.
    write:147 WA_AVLSTUS.
    write:164 sy-vline.
    write:sy-uline(164).
    clear l_stk1.
    clear l_stk2.
    clear l_stk3.
    clear bom_req_qty.
    clear WA_TOTSTK.
    endloop.
    endform.
    FORM BOMDATA.
    select matnr werks stlan stlnr stlal from mast into
                                    table it_mast
                             where matnr = P_BOM and stlal = '01' and stlan = '1'
                                   and werks = P_plant.
    if sy-subrc = 0.
      select stlty stlnr stlal stlkn stasz datuv stvkn from stas
                                   into table it_stas
                                 for all entries in it_mast
                                 where stlnr = it_mast-stlnr and
                                       stlal = it_mast-stlal and
                                       stlty = 'M'.
      if sy-subrc = 0.
        SELECT stlty stlnr stlkn stpoz idnrk meins menge from stpo into table it_stpo
                                  for all entries in it_stas
                                  where stlty = 'M' and
                                        stlnr = it_stas-stlnr and
                                        stlkn = it_stas-stlkn.
    endif.
    endif.
    perform get_data.
    perform process_data.
    perform display_data.
    ENDFORM.
    form process_data.
      if mult_par = 'Y'.
        refresh it_stpo.
        loop at wa_mast.
          select matnr werks stlan stlnr stlal from mast into table it_mast
                                      where matnr = wa_mast-matnr
                                      and stlal = '01' and stlan = '1'.
          if sy-subrc = 0.
            loop at it_mast.
              SELECT stlty stlnr stlkn stpoz idnrk meins menge from stpo into table wa_stpo1
                                               where stlnr = it_mast-stlnr.
              if sy-subrc = 0.
              clear wa_stpo1.
                loop at wa_stpo1.
                  read table t_stpo with key idnrk = wa_mast-matnr.
                  if t_stpo-menge > 1.
                  it_stpo-stlty = wa_stpo1-stlty.
                  it_stpo-stlnr = wa_stpo1-stlnr.
                  it_stpo-stlkn = wa_stpo1-stlkn.
                  it_stpo-idnrk = wa_stpo1-idnrk.
                  it_stpo-meins = wa_stpo1-meins.
                  it_stpo-menge = wa_stpo1-menge * 2.
                  else.
                  move-corresponding wa_stpo1 to it_stpo.
                  endif.
                  append it_stpo.
                  clear wa_stpo1.
                  clear it_stpo.
                endloop.
                refresh wa_stpo1.
                clear wa_mast.
              endif.
            endloop.
          endif.
        endloop.
        refresh wa_mast.
        perform get_data.
      ELSE.
        perform display_data.
      endif.
    endform.                    "process_data
    form get_data.
      loop at it_stpo.
        select matnr werks stlan stlnr stlal from mast into
                                      table it_mast
                               where matnr = it_stpo-idnrk
                                     and stlal = '01' and stlan = '1'.
        if not it_mast[] is initial.
          loop at it_mast.
            move-corresponding it_mast to wa_mast.
            append wa_mast.
            move-corresponding it_stpo to t_stpo.
            append t_stpo.
          endloop.
          clear t_stpo.
        else.
          it_final-stlnr = it_stpo-stlnr.
          it_final-matnr = it_stpo-idnrk.
          it_final-menge = it_stpo-menge.
          append it_final.
        endif.
      endloop.
      if not wa_mast[] is initial.
        mult_par = 'Y'.
        clear it_stpo.
      else.
        mult_par = ''.
      endif.
      loop at it_final.
        move-corresponding it_final to it_final1.
        append it_final1.
      endloop.
      refresh it_final.
      refresh it_mast.
      perform process_data.
    endform.                    "get_data
    form display_data.
      sort it_final1 by matnr.
      loop at it_final1.
        if it_final1-matnr = G_Matno.
          bom_req_qty = bom_req_qty + it_final1-menge.
        endif.
      endloop.
      refresh it_stpo.
      refresh it_mast.
      clear it_final1.
      REFRESH it_final1.
    endform.                    "display_data
    TOP-OF-PAGE.
    WRITE:/ SY-ULINE(164).
    WRITE:/1 SY-VLINE,
           2 'Part Number',
           19 sy-vline,
           20 'Description',
           56 sy-vline,
           57 'Unrestricted Qty',
           74 sy-vline,
           75 'Quality Qty',
           92 sy-vline,
           93 'Blocked Qty',
           110 sy-vline,
           111 'Tot. Avl. Stk',
           128 sy-vline,
           129 '   Q/E   ',
           146 SY-VLINE,
           147 'Avl Status',
           164 sy-vline.
    WRITE:SY-ULINE(164).
    Regards,
    Bikash

  • How to retrieve DELTA for Particular date for FIGL(ECC) into BI

    Hi,
    Model of this ODS is in BW3.5.  (DS --> ODS --> Infocube)
    My loads are daily from 0FI_GL_4 (line Items) into ODS. There was from error in the load, so I deleted the request (manage & and made QM status RED in monitor also) from ODS and also from PSA for a particular date(xx.xx.xxxx).
    Now I tried loading the Infopackage, but the data is not coming for that date (xx.xx.xxxx) into ODS.
    I have set to DELTA REPEAT in RSA7(ECC) , but after saving, it is again coming back to DELTA UPDATE.
    All the Previous and Next day load was fine,but i did not get the data for xx.xx.xxxx.
    In Selection screen for DS and Infopackage does not have 0CALDAY or 0PSTNG_DATE.
    Can you please help me out in telling how to get the data for that particular date (xx.xx.xxxx) into BI.
    DOES REPAIR FULL REQUEST SOLVE MY PROBLEM?
    Full Points will be assigned.
    Regards,
    Bindu.

    Hi Viren,
    Initially I have tried what you have said, but ERROR is coming as AS YOUR PREVIOUS DELTA IS INCORRECT, YOU CANNOT LOAD THIS DELTA. I am not getting any option of REPEAT DELTA.
    "I have set to DELTA REPEAT in RSA7(ECC) , but after saving, it is again coming back to DELTA UPDATE."
    As I am not getting REPEAT DELTA, to get that I tried saving the 0FI_GL_4 as DELTA REPEAT in RSA7 (ECC).
    Please let me know any more information required.
    Thanks,
    Bindu.

  • Closing Stock on Particular Date(MB5B Tcode)

    Hi Experts,
    I need closing stock as on some particular date. For e.g. closing stock as on 28.02.2014.
    In my requirement i have to use that closing stock value for further calculations in a new customized report.I can see closing stock value by using MB5B tcode.
    Please suggest some way to get closing stock as on some date so that i can use that in my Report.
    Can i directly call MB5B transaction in my Report and get closing stock value?
    Thanks & Regards,
    Pankaj

    Hello Pankaj,
    In your Customised Report use MKPF and MSEG table
    MKPF ----->  Material and date range as the input
    Then Pass Material document number from MKPF to MSEG table
    MSEG ----->  based on material document number from mkpf
    Create Temporary  variable
    values comes from the mseg where have credit and debit entries
    if debit entry "S" then subtract the values of the Mseg table from the temporary variable1
    if credit entry "H" then Add the values of the mseg table to the temporary variable2
    finally Add the temporary variable1 and temporary variable 2 and get the total stock.

  • Functional Specification For Opening And closing stock On Particular Date

    Dear Gurus,
    I am creating report for opening and closing stock on particular date in which batch and storage location should also be included. I want to know the tables and fields for the same.I have searched the forum and got report on month basis but I want this report on posting day basis.kindly suggest tables and fields. Thanks in Advance

    Dear sir,
    There are many other colums that client wants to add which are not present in MB5B transaction.columns which client wants to add are as follows...
    Material Number                                                   
    Material Description                                       
    Material Type                                                                        
    Material Group                                                                     
    External material Group                                                            
    Movement Type     
    Plant     
    Storage Location     
    Customer Number     
    Customer Name     
    Vendor Number     
    Vendor Name     
    Posting Date     Receipt Doc. Number
    Issue Doc. Number     
    Reference Issue Document Number     
    Opening Stock Quanity     
    Material Receipt Quantity     
    Material Issue Quantity     
    Material Closing Stock Quantity      
    Value Of Closing Stock
    And for this I want  tables and logic for the same. kindly provide the solution for the same.

  • Closing stock of a particular date

    how to get plant wise material closing stock on any particular date. say previous months end date. I am calculating that from MSEG table with the help of MSEGINSMK and MSEGSHKZG field. (with date filtaration by joining MBLNR of MKPF table) But stock is showing different with the closing stock showing in MB5B report for that date. I don't know which BWART of MSEG table to be excluded. My email id is [email protected]

    Hi,
    This is a stock aging report, you can use this for reference.
    Logic: Based on current stock and value from MBEW table. The latest receipt dates were taken till the qty tallies off.Rejections and reversals are considered.
    The movement types considered are ('101','102','105','106','122','123','131','132','301','302','309','310','501','502','531','532','561','562','701','702').
    *& Report  ZMM03_TRY                                                 *
    REPORT  ZMM03 LINE-SIZE 226
                   LINE-COUNT 35(2)
                    NO STANDARD PAGE HEADING..
    TABLES : S032,  "Current Stock And Grouping Terms
             MBEW,  "Material Valuation
             T023T, "Material Group Desc.
             MAKT,  "Material Description
             EKPO.  "Purchasing Document Item.
    DATA : BEGIN OF T_HEADER OCCURS 0,
           MTART LIKE MARA-MTART,
           MATNR LIKE MBEW-MATNR,
           BWKEY LIKE MBEW-BWKEY,
           MATKL LIKE MARA-MATKL,
           MAKTX LIKE MAKT-MAKTX,
           MEINS LIKE MARA-MEINS,
           LBKUM LIKE MBEW-LBKUM,
           SALK3 LIKE MBEW-SALK3,
           VERPR LIKE MBEW-VERPR,
           CLSTK LIKE MBEW-LBKUM,
           CLVAL LIKE CKMLCR-SALK3,
           UNIT LIKE CKMLCR-PVPRS,
           END OF T_HEADER.
    DATA : BEGIN OF T_MSEG OCCURS 0,
           MATNR LIKE MSEG-MATNR,
           WERKS LIKE MSEG-WERKS,
           BUDAT LIKE MKPF-BUDAT,
           MBLNR LIKE MKPF-MBLNR,
           MJAHR LIKE MKPF-MJAHR,
           ZEILE LIKE MSEG-ZEILE,
           LFBNR LIKE MSEG-LFBNR,
           LFBJA LIKE MSEG-LFBJA,
           LFPOS LIKE MSEG-LFPOS,
           BWART LIKE MSEG-BWART,
           MENGE LIKE MSEG-MENGE,
           EBELN LIKE MSEG-EBELN,
           EBELP LIKE MSEG-EBELP,
           XAUTO LIKE MSEG-XAUTO,
           UMMAT LIKE MSEG-UMMAT,
           UMWRK LIKE MSEG-UMWRK,
           MARK(1),
           END OF T_MSEG.
    TYPE-POOLS : SLIS.
    DATA : L_STOCK TYPE MSEG-MENGE.
    DATA : WA_MSEG LIKE T_MSEG.
    DATA : WA_MSEG1 LIKE T_MSEG.
    DATA : T_ITEMS LIKE T_MSEG OCCURS 0 WITH HEADER LINE.
    DATA : T_CUR_STOCK LIKE T_MSEG OCCURS 0 WITH HEADER LINE.
    DATA : L_LBKUM TYPE MBEW-LBKUM.
    DATA : BEGIN OF T_OUTPUT OCCURS 0,
             WERKS LIKE MSEG-WERKS,
             MATNR LIKE MSEG-MATNR,
             BUDAT LIKE MKPF-BUDAT,
             MENGE LIKE MSEG-MENGE,
             PDAYS TYPE I,
             PVAL  TYPE MSEG-MENGE,
             MAKTX LIKE MAKT-MAKTX,
             CQTY  LIKE MSEG-MENGE,
             CPRC  LIKE MBEW-SALK3,
           END OF T_OUTPUT.
    DATA: GRID_TAB TYPE SLIS_T_FIELDCAT_ALV  WITH HEADER LINE.
    DATA : T_SORT TYPE SLIS_T_SORTINFO_ALV,
           WA_SORT TYPE SLIS_SORTINFO_ALV.
    *AT SELECTION-SCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-014.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : P_DATE LIKE S032-LETZTABG OBLIGATORY DEFAULT SY-DATUM.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN END OF BLOCK 1.
    SELECTION-SCREEN BEGIN OF BLOCK 2 WITH FRAME TITLE TEXT-015.
    PARAMETERS     : P_WERKS    TYPE S032-WERKS OBLIGATORY.
    SELECT-OPTIONS : S_LGORT    FOR S032-LGORT,
                     S_MATNR    FOR S032-MATNR.
    SELECTION-SCREEN END OF BLOCK 2.
    SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-016.
    SELECT-OPTIONS : S_MTART    FOR S032-MTART,
                     S_MATKL    FOR S032-MATKL.
    SELECTION-SCREEN END OF BLOCK 3.
    IF  P_DATE IS INITIAL AND
        P_WERKS IS INITIAL AND
        S_LGORT IS INITIAL AND
        S_MATNR IS INITIAL AND
        S_MTART IS INITIAL AND
        S_MATKL  IS INITIAL.
      MESSAGE I398(00) WITH 'Enter Selection Critirea'(019).
      SY-SUBRC = '1'.
    ELSE.
      SELECT AMATNR ABWKEY BMATKL BMTART CMAKTX BMEINS A~LBKUM
             A~SALK3
           INTO CORRESPONDING FIELDS OF TABLE T_HEADER
           FROM MBEW AS A INNER JOIN MARA AS B ON AMATNR = BMATNR
                          INNER JOIN MAKT AS C ON AMATNR = CMATNR
                                            WHERE A~MATNR IN S_MATNR
                                              AND A~BWKEY EQ P_WERKS
                                              AND MATKL IN S_MATKL
                                              AND MTART IN S_MTART
                                              AND BWTAR EQ ' '
                                              AND C~SPRAS = SY-LANGU.
      IF SY-SUBRC EQ 0.
        SELECT ABUDAT AMBLNR AMJAHR BZEILE BMATNR BWERKS B~BWART
               BMENGE BLFBNR BLFBJA BLFPOS BEBELN BEBELP B~XAUTO
               BUMMAT BUMWRK
            INTO CORRESPONDING FIELDS OF TABLE T_MSEG
            FROM MKPF AS A INNER JOIN MSEG AS B ON AMBLNR = BMBLNR
                                               AND AMJAHR = BMJAHR
             FOR ALL ENTRIES IN T_HEADER
                                             WHERE A~BUDAT <= P_DATE
                                               AND B~MATNR = T_HEADER-MATNR
                                               AND B~WERKS = T_HEADER-BWKEY
                                               AND B~BWART IN ('101',
                                                               '102',
                                                               '105',
                                                               '106',
                                                               '122',
                                                               '123',
                                                               '301',
                                                               '302',
                                                               '701',
                                                               '702',
                                                               '131',
                                                               '132',
                                                               '309',
                                                               '310',
                                                               '501',
                                                               '502',
                                                               '531',
                                                               '532',
                                                               '561',
                                                               '562').
        PERFORM GET_DEAD_STOCK.
        PERFORM DISPLAY_OUTPUT.
      ELSE.
        MESSAGE S398(00) WITH 'No Data found for'(013)
        'Given Selection Critirea'(017).
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDIF.
    *&      Form  get_dead_stock
          text
    FORM GET_DEAD_STOCK .
      LOOP AT T_HEADER.
        SORT T_MSEG BY MATNR WERKS BUDAT DESCENDING MBLNR DESCENDING.
        LOOP AT T_MSEG WHERE MATNR = T_HEADER-MATNR
                         AND WERKS = T_HEADER-BWKEY
                         AND ( BWART = '101' OR
                               BWART = '105' OR
                               BWART = '501' OR
                               BWART = '531' OR
                               BWART = '561' OR
                               BWART = '701' OR
                               BWART = '309' OR
                               BWART = '301' OR
                               BWART = '131' ).
          IF T_MSEG-BWART = 101.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 102.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
            READ TABLE T_MSEG INTO WA_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 122.
            IF SY-SUBRC = 0.
              READ TABLE T_MSEG INTO WA_MSEG1 WITH KEY LFBNR = WA_MSEG-MBLNR
                                         LFBJA = WA_MSEG-MJAHR
                                         LFPOS = WA_MSEG-ZEILE
                                         BWART = 123.
              IF SY-SUBRC EQ 0.
                WA_MSEG-MARK = 'X'.
                MODIFY T_MSEG FROM WA_MSEG.
                CONTINUE.
              ELSE.
                IF T_MSEG-MENGE EQ WA_MSEG-MENGE.
                  T_MSEG-MARK = 'X'.
                  MODIFY T_MSEG.
                  CONTINUE.
                ELSE.
                  T_MSEG-MENGE = T_MSEG-MENGE - WA_MSEG-MENGE.
                  MODIFY T_MSEG.
                ENDIF.
              ENDIF.
            ENDIF.
          ELSEIF T_MSEG-BWART = 105.
            READ TABLE T_MSEG INTO WA_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 106.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 131.
            READ TABLE T_MSEG INTO WA_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 132.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 501.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 502.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 301.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 302.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 531.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 532.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 561.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 562.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 701.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 702.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ELSEIF T_MSEG-BWART = 309.
            READ TABLE T_MSEG WITH KEY LFBNR = T_MSEG-MBLNR
                                       LFBJA = T_MSEG-MJAHR
                                       LFPOS = T_MSEG-ZEILE
                                       BWART = 310.
            IF SY-SUBRC = 0.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ELSEIF T_MSEG-XAUTO = ' '.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ELSEIF T_MSEG-MATNR EQ T_MSEG-UMMAT.
              T_MSEG-MARK = 'X'.
              MODIFY T_MSEG.
              CONTINUE.
            ENDIF.
          ENDIF.
          SELECT SINGLE EBELN INTO EKPO-EBELN FROM EKPO
                             WHERE EBELN = T_MSEG-EBELN
                               AND EBELP = T_MSEG-EBELP
                               AND KNTTP = 'K'.
          IF SY-SUBRC = 0.
            T_MSEG-MARK = 'X'.
            MODIFY T_MSEG.
            CONTINUE.
          ENDIF.
         TMENGE = TMENGE - t_mseg-MENGE.
        ENDLOOP.
      ENDLOOP.
      DELETE T_MSEG WHERE MARK = 'X'.
      DELETE T_MSEG WHERE ( BWART = '102' OR
                            BWART = '106' OR
                            BWART = '502' OR
                            BWART = '532' OR
                            BWART = '562' OR
                            BWART = '702' OR
                            BWART = '310' OR
                            BWART = '302' OR
                            BWART = '123' OR
                            BWART = '122' OR
                            BWART = '132' ).
      SORT T_HEADER BY MATNR BWKEY.
      DELETE ADJACENT DUPLICATES FROM T_HEADER COMPARING MATNR BWKEY.
      T_CUR_STOCK[] = T_MSEG[].
      SORT T_CUR_STOCK BY MATNR WERKS.
      LOOP AT T_CUR_STOCK.
        WA_MSEG = T_CUR_STOCK.
        AT END OF WERKS.
        ENDAT.
      ENDLOOP.
      LOOP AT T_HEADER.
        CLEAR L_LBKUM.
        L_LBKUM = T_HEADER-LBKUM.
        REFRESH T_ITEMS.
        CLEAR T_ITEMS.
        LOOP AT T_MSEG WHERE MATNR EQ T_HEADER-MATNR
                         AND WERKS EQ T_HEADER-BWKEY.
          T_ITEMS = T_MSEG.
          APPEND T_ITEMS.
          CLEAR T_ITEMS.
        ENDLOOP.
        SORT T_ITEMS BY BUDAT DESCENDING
                        MBLNR DESCENDING.
        CLEAR L_LBKUM.
        LOOP AT T_ITEMS.
          L_LBKUM = T_ITEMS-MENGE - T_HEADER-LBKUM.
          IF L_LBKUM GE 0.
            T_OUTPUT-MATNR = T_HEADER-MATNR.
            T_OUTPUT-WERKS = T_HEADER-BWKEY.
            T_OUTPUT-BUDAT = T_ITEMS-BUDAT.
            T_OUTPUT-MENGE = T_HEADER-LBKUM.
            APPEND T_OUTPUT.
            CLEAR T_OUTPUT.
            EXIT.
          ELSE.
            T_HEADER-LBKUM = T_HEADER-LBKUM - T_ITEMS-MENGE.
            T_OUTPUT-MATNR = T_HEADER-MATNR.
            T_OUTPUT-WERKS = T_HEADER-BWKEY.
            T_OUTPUT-BUDAT = T_ITEMS-BUDAT.
            T_OUTPUT-MENGE = T_ITEMS-MENGE.
            APPEND T_OUTPUT.
            CLEAR T_OUTPUT.
            CONTINUE.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " get_dead_stock
    *&      Form  DISPLAY_OUTPUT
          text
    FORM DISPLAY_OUTPUT .
      DATA: L_DAYS TYPE I.
      DATA : WA_OUTPUT LIKE T_OUTPUT.
      DATA : T_FINAL LIKE T_OUTPUT OCCURS 0 WITH HEADER LINE.
      DATA : WA_FINAL LIKE T_OUTPUT.
      DATA : L_CQTY TYPE MSEG-MENGE,
             L_CPRC TYPE MBEW-SALK3.
      DATA : L_TITLE TYPE LVC_TITLE.
      DATA : L_NAME1 TYPE T001W-NAME1.
    *C-- Not to output when the quantity is zero.
      DELETE T_OUTPUT WHERE MENGE EQ 0.
      SORT T_OUTPUT BY WERKS MATNR BUDAT.
      LOOP AT T_OUTPUT.
        T_FINAL = T_OUTPUT.
        AT NEW MATNR.
          CLEAR T_HEADER.
          READ TABLE T_HEADER WITH KEY MATNR = T_OUTPUT-MATNR
                                       BWKEY = T_OUTPUT-WERKS.
        ENDAT.
        T_FINAL-MAKTX = T_HEADER-MAKTX.
        IF T_HEADER-LBKUM GT 0.
          T_FINAL-PVAL = ( T_OUTPUT-MENGE * T_HEADER-SALK3 / T_HEADER-LBKUM ).
        ELSE.
          CLEAR T_FINAL-PVAL.
        ENDIF.
        L_CQTY = L_CQTY + T_OUTPUT-MENGE.
        IF T_HEADER-LBKUM GT 0.
          L_CPRC = L_CPRC + ( T_OUTPUT-MENGE * T_HEADER-SALK3 / T_HEADER-LBKUM ).
        ENDIF.
        CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
          EXPORTING
            BEG_DA        = T_OUTPUT-BUDAT
            END_DA        = P_DATE
          IMPORTING
            NO_CAL_DAY    = L_DAYS
          EXCEPTIONS
            DATEINT_ERROR = 1
            OTHERS        = 2.
        IF SY-SUBRC <> 0.
          WRITE : 70 'Error While Calculating days'(018) .
        ELSE.
          T_FINAL-PDAYS = L_DAYS.
        ENDIF.
        T_FINAL-CQTY = L_CQTY.
        T_FINAL-CPRC = L_CPRC.
        APPEND T_FINAL.
        AT END OF MATNR.
          CLEAR : L_CPRC, L_CQTY.
        ENDAT.
      ENDLOOP.
      PERFORM BUILD_FIELD_CATALOG.
      WA_SORT-FIELDNAME = 'MATNR'.
      WA_SORT-SPOS = '1'.
      APPEND WA_SORT TO T_SORT.
      SELECT SINGLE NAME1 FROM T001W INTO L_NAME1
      WHERE WERKS = P_WERKS.
      CONCATENATE 'Plant: ' P_WERKS ',' L_NAME1 INTO L_TITLE.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = SY-CPROG
          I_GRID_TITLE       = L_TITLE
          IT_FIELDCAT        = GRID_TAB[]
          IT_SORT            = T_SORT
          I_SAVE             = 'A'
        TABLES
          T_OUTTAB           = T_FINAL[].
    SORT T_FINAL BY WERKS MATNR BUDAT.
    LOOP AT T_FINAL.
       WRITE : /10 T_FINAL-MATNR.
       WRITE : 30 T_FINAL-WERKS.
       WRITE : 40 T_FINAL-BUDAT.
       WRITE : 50 T_FINAL-MENGE.
    **C-- FM to find the number of days between
    **C-- todays date and the posting date
       CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
         EXPORTING
           BEG_DA        = T_FINAL-BUDAT
           END_DA        = P_DATE
         IMPORTING
           NO_CAL_DAY    = L_DAYS
         EXCEPTIONS
           DATEINT_ERROR = 1
           OTHERS        = 2.
       IF SY-SUBRC <> 0.
         WRITE : 70 'Error While Calculating days'(018) .
       ELSE.
         WRITE : 70 L_DAYS.
       ENDIF.
       AT END OF MATNR.
         ULINE.
         READ TABLE T_HEADER WITH KEY MATNR = T_FINAL-MATNR
                                      BWKEY = T_FINAL-WERKS.
         IF SY-SUBRC EQ 0.
           WRITE : /1 'Total Valuated Stock', T_HEADER-LBKUM.
           WRITE : /1 'Value of total valuated Stock', T_HEADER-SALK3.
           ULINE.
         ENDIF.
       ENDAT.
    ENDLOOP.
    ENDFORM.                    " DISPLAY_OUTPUT
    *&      Form  BUILD_FIELD_CATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_FIELD_CATALOG .
      DATA : CNT1 TYPE I.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Material'.
      GRID_TAB-FIELDNAME = 'MATNR'.
      GRID_TAB-KEY = 'X'.
      GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Material Description'.
      GRID_TAB-FIELDNAME = 'MAKTX'.
      GRID_TAB-OUTPUTLEN = '30'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Date of Reciept'.
      GRID_TAB-FIELDNAME = 'BUDAT'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Quantity'.
      GRID_TAB-FIELDNAME = 'MENGE'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Pending Days'.
      GRID_TAB-FIELDNAME = 'PDAYS'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Value'.
      GRID_TAB-FIELDNAME = 'PVAL'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Cumulative Quantity'.
      GRID_TAB-FIELDNAME = 'CQTY'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
      CLEAR GRID_TAB.
      CNT1 = CNT1 + 1.
      GRID_TAB-COL_POS = CNT1.
      GRID_TAB-SELTEXT_L = 'Value of Cumulative Quantity'.
      GRID_TAB-OUTPUTLEN = '30'.
      GRID_TAB-FIELDNAME = 'CPRC'.
    GRID_TAB-KEY = 'X'.
    GRID_TAB-NO_ZERO = 'X'.
      GRID_TAB-TABNAME = 'T_FINAL'.
      APPEND GRID_TAB.
    ENDFORM.                    " BUILD_FIELD_CATALOG

  • Stock on a particular date

    Dear All,
    I am creating a customised report for showing all the importatnt data (like stock, consumption, production, sale in one report) at client level.
    In this report I am required to show the stock of material on a particular date, entered by the user in the selection screen.
    (In stanard SAP, report MB5B servers the purpose.)
    Can you please suggest how can I get the same information in the customised report.?
    (I do not prefer using method: month opening stock + total receipts - total consumption)
    Is there any alternative way?
    Thanks and regards
    Sarang

    Hi
    The MB5B report gives you all the data, if you donot want some of the data, copy the Report, & from the Output Parameters remove the Fields which you dont want.
    if you want the ALV functionality add the same to that.
    Thanks & Regards
    Kishore

  • Stock on particular date (performance issue)

    Hi Folks,
    I m calculating stock at all vendor on a particular date.
    But it takes very long and time_out occurs.
    I m calculating opening closing provided return and rejection based on movement types.
    The report hangs up at following particular Join.
    SELECT MKPFBUDAT MSEGBWART MSEGMATNR MSEGLIFNR SUM( MSEG~MENGE )
                  AS MENGE
                      INTO CORRESPONDING FIELDS OF TABLE IT_OPEN
                      FROM
                         MKPF INNER JOIN MSEG ON
                               MKPFMBLNR = MSEGMBLNR AND
                               MKPFMJAHR = MSEGMJAHR
                       WHERE MKPF~MJAHR = D_YEAR AND
                             MKPF~BUDAT GE D_DATE AND
                             MKPF~BUDAT LT S_BUDAT-LOW AND
                    MSEG~BWART IN ('541','542','543','544','551','702') AND
                             MSEG~XAUTO NE 'X' AND
                             MSEG~MATNR IN S_MATNR AND
                             MSEG~WERKS IN P_WERKS AND
                             MSEG~LIFNR IN P_LIFNR
                  GROUP BY LIFNR MATNR BUDAT BWART.
    Is there any way to increase performance by breaking this inner join into select statements or anyhow.
    Regards
    Sachin

    HI,
    On seeing your code, it seems like,
    SELECT MKPFBUDAT MSEGBWART MSEGMATNR MSEGLIFNR SUM( MSEG~MENGE )
    AS MENGE
    INTO CORRESPONDING FIELDS OF TABLE IT_OPEN
    FROM
    MKPF INNER JOIN MSEG ON
    MKPFMBLNR = MSEGMBLNR AND
    MKPFMJAHR = MSEGMJAHR
    WHERE MKPF~MJAHR = D_YEAR AND
    MKPF~BUDAT GE D_DATE AND
    MKPF~BUDAT LT S_BUDAT-LOW AND
    MSEG~BWART IN ('541','542','543','544','551','702') AND
    MSEG~XAUTO NE 'X' AND
    MSEG~MATNR IN S_MATNR AND
    <b>MSEG~WERKS EQ P_WERKS</b> AND
    <b>MSEG~LIFNR EQ P_LIFNR</b>
    GROUP BY LIFNR MATNR BUDAT BWART.
    Please see the code marked with bold as parameter passing in the select statement must be EQ and not IN.
    Secondly, remove the aggregate function SUM from the select. First select all the records into an internal table and either use control break statements or Collect to sum up the entries.
    Next, while selecting from the database use INTO TABLE IT_OPEN rather than into corresponding fields of table.
    Also remove the movement types from the select and restrict it inside the Loop and Endloop.
    Lakshminarayanan
    Please mark all helpful answers for points

  • Particular data in a report, on the basis of the values (0, 1) of a dashboa

    hi
    User should be able to see the particular data in a report, on the basis of the values (0, 1) of a dashboard prompt.
    For e.g. if the user selects 0 then current years data should be filtered out
    and if the user selects 1 then rest all years data should be displayed in a request.
    give me hint regarding this question

    Hi,
    I hope this will help you
    http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-selecting-reports-from-dashboard-prompts-and-guided-navigation-sections/
    In this example he used prompt for selecting Region sales and Brand sales which you can replace with 0 and 1
    Phani.

  • OPEN PO QTY IN PARTICULAR DATE

    Hi Experts
    I need to check the open qty of purchase order bcoz i have to upload the PO from old system to new system.
    so i want to get the Open Purchase order qty from particular date say 1st april .
    so that i can upload the same into new System with upload programme.
    Thanks
    Pankaj Agarwal

    Hi
    check following link
    [Report including open purchase order quantity for one storage location;
    [http://wiki.sdn.sap.com/wiki/display/sandbox/OPENPOQTYREPORT-CODE]
    Regards
    Kailas Ugale

  • Stock Value on a Particular Date

    Dear Sir,
    As a part of our Inventory Monitoring , we need to have a list showing Item wise Stock Value on a particular date (or end of any month date) .
    Kindly guide us as what Tcode is available in SAP for getting such a list .
    Kindly help us pl .
    Rgds
    B Mittal

    Hi
    In MB5B report please select the Stock type as valuated stock, this will give you the Stock Value also.
    Thanks & Regards
    Kishore

  • Closing stock as off a particular date

    How to write a query for closing stock (in quantity) for all items by group by warehouse for a particular date?
    Thank you.

    the standard stock count in SAP B1 (Inventory>> Inventory Transaction >> Initital Quantity, Inventory Tracking, Stock Posting) is "real time" and not back-dated and the screen will display all items irrespective whether there is stock balance in the system.   Anyone has a query where able to have the stock balance generated at any cut-off date, i.e. the stock count can be back-dated and only display those items with quantity (in the system) as at that cut-off date .
    Thank you.

Maybe you are looking for