Amount in MB5B

hI,
Can any one tell me in MB5B( stock on posting date) . at the time of posting stock
system increasing amount in local currency. I want to know that how & from where
system this value is picking?
regards
Manoj..

Dear Manoj
when u r receiving the goods,U must have maintain the material price indicator as V that is Moving average price...So the price of the Amount will definately increase in any reports
Whereas for MB5B
IN list Scope--Categry
If you have you must have unticked "Without opening stock-without closing stk"
So system must be considering Opeining stk also..Just check that
Let us know what is happening exactly and why amount is shown more in MB5b
Regds
shailesh

Similar Messages

  • Difference in amount(value) when i made copy of MB5B transaction

    Hi All
         I made copy (ZMB5B_COPY) of std.transaction MB5B (RM07MLBD) when i select STOCK TYPE-Valuated stock radio button &
    enter date (for eg.01.04.2013 to 01.04.2013) i get the amount of closeing value when i click for total it display the total value.but i
    get difference in value like in std tranaction i got 31 crore & in my ZMB5B program i am getting 3012 cr.
    First one showing o/p of my ZMB5B program (3012 Cr.)& second showing o/p of std.transaction MB5B( 31 Cr.)
    Kindly help me in this case.

    Hi Dev,
        I have created Z program (i.e copy of std program) of RM07MLBD & Z program name is ZMB5B_COPY & i assigned tcode for that is ZMB5B. Closing stock quantity is also not
    showing same.
    First closing stock is my Z program & second is of std.program
    Thanks & Regards,
    Samadhan.

  • MB5B: Amount in LC not selectable from the Layout

    dear sap mm gurus,
    i'd like to ask how to make "Amount in LC" appear in the MB5B layout.
    some users have the column while others don't.
    i'm trying to change the layout but it is not available as column content. is this an authorization issue?
    would appreaciate your prompt response. thanks a lot.
    best regards,
    albert

    Hi
    When you run this report with the option *totals only - hierarchial representation * then you can see amount in local currency option (after running the report click on current display version CTRL+F8 and then click position tab). This is not an authorization issue.
    Thanks

  • Modification in MB5B prg...material stock between a date range

    Hi experts
    I have to modify mb5b tranx prg . presently we are using date as selection criteria..but now onwards user wants G/L account along with date as selection criteria. I created one selec-option for field HKONT type hkont-bseg. Now in select queries i need ur help ..Kindly tell me where i need to use this field in my select queries to fetch RELEVANT data.
    Regards
    Anu
    CODE:
    REPORT ZRM07MLBD NO STANDARD PAGE HEADING MESSAGE-ID M7 LINE-SIZE 280.
    ********my change*******
    tables : BSEG.
    TYPE-POOLS:  IMREP,                   " Typen Bestandsführungsreporting
                 SLIS.                    " Typen Listviewer
    INCLUDE ZRM07MLDD.
    DATA FLAG(1) TYPE C VALUE ' '.
    DATA BAL_QTY TYPE P DECIMALS 2.
    DATA BAL_AMT TYPE P DECIMALS 2.
    *include:  rm07mldd.     " reportspezifische Datendefinitionen
    "n571473
    define the selection screen here                          "n571473
    "n571473
    SELECTION-SCREEN BEGIN OF BLOCK DATABASE-SELECTION
              WITH FRAME TITLE TEXT-001.
    Text-001: Datenbankabgrenzungen
    SELECT-OPTIONS: MATNR FOR MARD-MATNR MEMORY ID MAT
                                         MATCHCODE OBJECT MAT1,
                    BUKRS FOR T001-BUKRS  MEMORY ID BUK,
                    WERKS FOR T001W-WERKS MEMORY ID WRK,
                    LGORT FOR T001L-LGORT,
                    CHARG FOR MCHB-CHARG,
                    BWTAR FOR MBEW-BWTAR,
                    BWART FOR MSEG-BWART.
    PARAMETERS SOBKZ LIKE MSEG-SOBKZ.
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS: DATUM FOR MKPF-BUDAT NO-EXTENSION,
    **********my change**************
              HKONT FOR BSEG-HKONT.
    ********END CHANGE************
    SELECTION-SCREEN END OF BLOCK DATABASE-SELECTION.
    SELECTION-SCREEN BEGIN OF BLOCK BESTANDSART
    WITH FRAME TITLE TEXT-002.
    Text-002: Bestandsart
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS LGBST LIKE AM07M-LGBST RADIOBUTTON GROUP BART DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 4(50) TEXT-010 FOR FIELD LGBST.
    Text-010: Lagerort-/Chargenbestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS BWBST LIKE AM07M-BWBST RADIOBUTTON GROUP BART.
    SELECTION-SCREEN COMMENT 4(50) TEXT-011 FOR FIELD BWBST.
    Text-011: bewerteter Bestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS SBBST LIKE AM07M-SBBST RADIOBUTTON GROUP BART.
    SELECTION-SCREEN COMMENT 4(50) TEXT-012 FOR FIELD SBBST.
    Text-012: Sonderbestand
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BESTANDSART.
    Commented By Rachit Material group Not Required
    improved definition of parameters for scope of list       "n599218
    *SELECTION-SCREEN BEGIN OF BLOCK MARA WITH FRAME TITLE TEXT-040.
    **selection-screen begin of line.
    *PARAMETERS P_MATKL LIKE MARA-MATKL.
    **selection-screen end of line.
    **SELECTION-SCREEN COMMENT 4(50) TEXT-030 for fieLD s_matkl.
    *SELECTION-SCREEN END OF BLOCK MARA.
    SELECTION-SCREEN BEGIN OF BLOCK LISTUMFANG
      WITH FRAME TITLE TEXT-003.  "Listumfang
    the following 3 parameters became obsolete do not use     "n599218
    anymor. They are still here to inform the user about      "n599218
    that he is using old variants or SUBMIT commands          "n599218
    PARAMETERS :                                                "n599218
      XONUL  LIKE AM07M-XONUL            NO-DISPLAY,            "n599218
      XVBST  LIKE AM07M-XVBST            NO-DISPLAY,            "n599218
      XNVBST LIKE AM07M-XNVBS            NO-DISPLAY.            "n599218
    7 new categories for the scope of list                    "n599218
                                                              "n599218
    cat. I docs I stock on   I    I stock on I Parameter      "n599218
         I      I start date I    I end date I                "n599218
    ---+--+--------++------+--------      "n599218
    1   I yes  I =  zero    I =  I =  zero  I pa_wdzer       "n599218
    2   I yes  I =  zero    I <> I <> zero  I pa_wdzew       "n599218
    3   I yes  I <> zero    I <> I =  zero  I pa_wdwiz       "n599218
    4   I yes  I <> zero    I <> I <> zero  I pa_wdwuw       "n599218
    5   I yes  I <> zero    I =  I <> zero  I pa_wdwew       "n599218
         I      I            I    I          I                "n599218
    6   I no   I =  zero    I =  I =  zero  I pa_ndzer       "n599218
    7   I no   I <> zero    I =  I <> zero  I pa_ndsto       "n599218
                                                              "n599218
    definition of the pushbutton : show or hide the following "n599218
    parameters for the scope of list                          "n599218
    SELECTION-SCREEN PUSHBUTTON /1(20) PB_LIU                   "n599218
                               USER-COMMAND LIU.                "n599218
                                                                "n599218
    text line : materials with movements                      "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN COMMENT 1(55) TEXT-072                     "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    with movements / start = zero  =  end = zero              "n599218
    1   I yes  I =  zero    I =  I =  zero  I pa_wdzer       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_WDZER    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      text-083 : no opening stock ; no closing stock          "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-083                     "n599218
                             FOR FIELD PA_WDZER                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    with movements / start = zero  =  end <> zero             "n599218
    2   I yes  I =  zero    I <> I <> zero  I pa_wdzew       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_WDZEW    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      text-084 : no opening stock ; with closing stock        "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-084                     "n599218
                             FOR FIELD PA_WDZEW                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    with movements / start stock <> 0 / end stock = 0         "n599218
    3   I yes  I <> zero    I <> I =  zero  I pa_wdwiz       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_WDWIZ    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      text-085 : with opening stock ; no closing stock        "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-085                     "n599218
                             FOR FIELD PA_WDWIZ                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    with movements / with start and end stocks / different    "n599218
    4   I yes  I <> zero    I <> I <> zero  I pa_wdwuw       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_WDWUW    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      with opening stock ; with closing stock ; changed       "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-086                     "n599218
                             FOR FIELD PA_WDWUW                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    with movements / with start and end stock / equal         "n599218
    5   I yes  I <> zero    I =  I <> zero  I pa_wdwew       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_WDWEW    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      with opening stock ; with closing stock ; non-changed   "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-087                     "n599218
                             FOR FIELD PA_WDWEW                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    text line : materials without movements                   "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN COMMENT 1(55) TEXT-073                     "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    materials without movements / stocks = zero               "n599218
    6   I no   I =  zero    I =  I =  zero  I pa_ndzer       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_NDZER    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      text-083 : no opening stock ; no closing stock          "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-083                     "n599218
                             FOR FIELD PA_NDZER                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    materials without movements / with start or end stock     "n599218
    7   I no   I <> zero    I =  I <> zero  I pa_ndsto       "n599218
    SELECTION-SCREEN BEGIN OF LINE.                             "n599218
    SELECTION-SCREEN POSITION 2.                                "n599218
    PARAMETERS : PA_NDSTO    LIKE AM07M-MB5B_XONUL              "n599218
                             MODIF ID LIU.                      "n599218
      with opening stock ; with closing stock ; non-changed   "n599218
    SELECTION-SCREEN COMMENT 5(70) TEXT-087                     "n599218
                             FOR FIELD PA_NDSTO                 "n599218
                             MODIF ID LIU.                      "n599218
    SELECTION-SCREEN END OF LINE.                               "n599218
                                                                "n599218
    SELECTION-SCREEN END OF BLOCK LISTUMFANG.
    SELECTION-SCREEN BEGIN OF BLOCK EINSTELLUNGEN
       WITH FRAME TITLE TEXT-068.  "Settings
    parameter for totals only - hierseq. list
    corresponding display variant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS XSUM          LIKE AM07M-XSUM.
    SELECTION-SCREEN COMMENT 4(60) TEXT-090 FOR FIELD XSUM.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(30) TEXT-091 FOR FIELD PA_SUVAR.
    *Commented by Rachit
    SELECTION-SCREEN POSITION 40.
    PARAMETERS: PA_SUVAR LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF LINE.
    parameter for totals only - flat list + corresponding display variant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS PA_SUMFL LIKE AM07M-XSUM.
    SELECTION-SCREEN COMMENT 4(60) TEXT-092 FOR FIELD PA_SUMFL.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(30) TEXT-091 FOR FIELD PA_SFLVA.
    SELECTION-SCREEN POSITION 40.
    PARAMETERS: PA_SFLVA LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS XCHAR LIKE AM07M-XCHRG.
    SELECTION-SCREEN COMMENT 4(50) TEXT-015 FOR FIELD XCHAR.
    Text-015: nur chargenpflichtige Materialien
    Das Kennzeichen 'xchar' bestimmt die Art der Listausgabe entweder
    auf Material- oder Chargenebene.
    SELECTION-SCREEN END OF LINE.
    the function "No reversal movements" is only         "n571473
    available from relaese 4.5B and higher               "n571473
    ( TEXT-026 : No reversal movements )                 "n571473
    SELECTION-SCREEN BEGIN OF LINE.                             "n571473
    SELECTION-SCREEN POSITION 1.                                "n571473
    PARAMETERS NOSTO LIKE AM07M-NOSTO.                          "n571473
    SELECTION-SCREEN COMMENT 4(50) TEXT-026                     "n571473
                           FOR FIELD NOSTO.                     "n571473
    SELECTION-SCREEN END OF LINE.                               "n571473
    SELECTION-SCREEN END OF BLOCK EINSTELLUNGEN.
    *Rachit
    SELECTION-SCREEN BEGIN OF BLOCK LISTE WITH FRAME TITLE TEXT-040.
    PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF BLOCK LISTE.
    HAUPTPROGRAMM *********************************
    F4-Hilfe für Reportvariante -
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
      PERFORM F4_FOR_VARIANT.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_SFLVA.
      PERFORM                    VARIANT_VALUE_REQUEST_F4
                                 USING  PA_SFLVA  G_S_VARI_SUMFL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PA_SUVAR.
      PERFORM                    VARIANT_VALUE_REQUEST_F4
                                 USING  PA_SUVAR G_S_VARI_SUMHQ.
    "n599218
    INITIALIZATION                                            "n599218
    "n599218
                                                                "n599218
    INITIALIZATION.
      CLEAR : G_S_VARI_SUMHQ, G_S_VARI_SUMFL.
      REPID = SY-REPID.
      VARIANT_SAVE = 'A'.
    preprae the working areas for the variants
      MOVE  : REPID              TO  G_S_VARI_SUMHQ-REPORT,
              'SUHQ'             TO  G_S_VARI_SUMHQ-HANDLE,
              REPID              TO  G_S_VARI_SUMFL-REPORT,
              'SUFL'             TO  G_S_VARI_SUMFL-HANDLE.
      MOVE-CORRESPONDING : G_S_VARI_SUMHQ  TO  G_S_VARI_SUMHQ_DEF,
                           G_S_VARI_SUMFL  TO  G_S_VARI_SUMFL_DEF.
      PERFORM  GET_THE_DEFAULT_VARIANT
                                 USING  PA_SFLVA
                                        G_S_VARI_SUMFL
                                        G_S_VARI_SUMFL_DEF.
      PERFORM  GET_THE_DEFAULT_VARIANT
                                 USING  PA_SUVAR
                                        G_S_VARI_SUMHQ
                                        G_S_VARI_SUMHQ_DEF.
      PERFORM INITIALISIERUNG.
    get the parameters from the last run                      "n547170
      PERFORM                    ESDUS_GET_PARAMETERS.          "n547170
    set flag when INITILIZATION is processed
      MOVE  'X'        TO  G_FLAG_INITIALIZATION.
    "n599218
    AT SELECTION-SCREEN                                       "n599218
    "n599218
    Prüfung der eingegebenen Selektionsparameter, -
    Berechtigungsprüfung -
    AT SELECTION-SCREEN.
    the following 3 parameters XONUL, XVBST, and XNVBST       "n599218
    became obsolete; send error when they should be filled.   "n599218
    This could be possible if the user works with old         "n599218
    selection variants or this report is launched by a        "n599218
    SUBMIT command                                            "n599218
      IF  XONUL  IS INITIAL  AND                                "n599218
          XVBST  IS INITIAL  AND                                "n599218
          XNVBST IS INITIAL.                                    "n599218
    ok, the old parameters are empty                         "n599218
      ELSE.                                                     "n599218
      text-088 : note 599218 : obsolete parameter used        "n599218
        MESSAGE E895             WITH  TEXT-088.                "n599218
      ENDIF.
    did the user hit the pushbutton "Category" ?              "n599218
      CASE     SSCRFIELDS-UCOMM.                                "n599218
        WHEN  'LIU '.                                           "n599218
        yes, the pushbutton "Category" was hit                "n599218
          IF  G_FLAG_STATUS_LIU  =  C_HIDE.                     "n599218
          show the 7 parameters on the selection srceen       "n599218
            MOVE  C_SHOW         TO  G_FLAG_STATUS_LIU.         "n599218
          ELSE.                                                 "n599218
          hide the 7 paramaters                               "n599218
            MOVE  C_HIDE         TO  G_FLAG_STATUS_LIU.         "n599218
          ENDIF.                                                "n599218
      ENDCASE.                                                  "n599218
                                                                "n599218
    go on only if the user wants to launch this report        "n599218
      CHECK : SY-UCOMM = 'ONLI'  OR                             "n599218
              SY-UCOMM = 'PRIN'  OR                             "n599218
              SY-UCOMM = 'SJOB'.                                "n599218
    only one sum function can be processed
      IF  XSUM     = 'X' AND
          PA_SUMFL = 'X'.
        SET CURSOR               FIELD 'XSUM'.
      select one sum list only
        MESSAGE  E895            WITH  TEXT-093.
      ENDIF.
      PERFORM EINGABEN_PRUEFEN.
      SET CURSOR                 FIELD 'PA_SFLVA'.
      PERFORM  VARIANT_CHECK_EXISTENCE
                                 USING     PA_SFLVA
                                           G_S_VARI_SUMFL
                                           G_S_VARI_SUMFL_DEF.
      SET CURSOR                 FIELD 'PA_SUVAR'.
      PERFORM  VARIANT_CHECK_EXISTENCE
                                 USING     PA_SUVAR
                                           G_S_VARI_SUMHQ
                                           G_S_VARI_SUMHQ_DEF.
    check whether FI summarization is active and other        "n547170
    restrictions could deliver wrong results                  "n547170
      PERFORM                    F0800_CHECK_RESTRICTIONS.      "n547170
    - the user wants to surpress the reversal movements :     "n497992
      process warning M7 392                                  "n497992
      IF NOT NOSTO IS INITIAL.                                  "n497992
      emerge warning ?                                        "n497992
        CALL FUNCTION            'ME_CHECK_T160M'               "n497992
            EXPORTING                                           "n497992
              I_ARBGB          = 'M7'                           "n497992
              I_MSGNR          = '392'                          "n497992
            EXCEPTIONS                                          "n497992
              NOTHING          = 0                              "n497992
              OTHERS           = 1.                             "n497992
                                                                "n497992
        IF SY-SUBRC <> 0.                                       "n497992
          SET CURSOR               FIELD  'NOSTO'.              "n497992
          to surpress the reversal movements could cause ...  "n497992
          MESSAGE                  W392.                        "n497992
        ENDIF.                                                  "n497992
      ENDIF.                                                    "n497992
    carry out special authotity check for the tax auditor     "n547170
      PERFORM                    TPC_CHECK_TAX_AUDITOR.         "n547170
    does the user wants a selection via company code or a plant ?
    fill range table g_ra_werks
      REFRESH : G_RA_BWKEY,  G_RA_WERKS, G_T_ORGAN.
      CLEAR   : G_RA_BWKEY,  G_RA_WERKS, G_T_ORGAN, G_S_ORGAN.
      REFRESH : G_0000_RA_BWKEY,  G_0000_RA_WERKS,  G_0000_RA_BUKRS.
      CLEAR   : G_0000_RA_BWKEY,  G_0000_RA_WERKS,  G_0000_RA_BUKRS.
      DESCRIBE TABLE  BUKRS      LINES  G_F_CNT_LINES_BUKRS.
      DESCRIBE TABLE  WERKS      LINES  G_F_CNT_LINES_WERKS.
      IF  G_F_CNT_LINES_BUKRS  > 0  OR
          G_F_CNT_LINES_WERKS  > 0.
      fill range tables for the CREATION OF TABLE G_T_ORGAN
        MOVE : WERKS[]           TO  G_0000_RA_WERKS[],
               BUKRS[]           TO  G_0000_RA_BUKRS[].
        PERFORM  F0000_CREATE_TABLE_G_T_ORGAN
                                 USING  C_ERROR.
      ENDIF.
    save the parameters of this run                           "n547170
      PERFORM                    ESDUS_SAVE_PARAMETERS.         "n547170
    "n599218
    AT SELECTION-SCREEN OUTPUT                                "n599218
    "n599218
                                                                "n599218
    AT SELECTION-SCREEN OUTPUT.                                 "n599218
                                                                "n599218
      IF  G_FLAG_INITIALIZATION IS INITIAL.                     "n599218
      the process time INITIALIZATION was not done, so        "n599218
      carry out the functions here                            "n599218
        MOVE  'X'                TO G_FLAG_INITIALIZATION.      "n599218
                                                                "n599218
        PERFORM                  INITIALISIERUNG.               "n599218
                                                                "n599218
      get the parameters from the last run                    "n599218
        PERFORM                  ESDUS_GET_PARAMETERS.          "n599218
      ENDIF.                                                    "n599218
                                                                "n599218
    how to handle the 7 paramaters for the scope of list ?    "n599218
      LOOP AT SCREEN.                                           "n599218
      modify the selection screen                             "n599218
        CASE    SCREEN-GROUP1.                                  "n599218
          WHEN  'LIU'.                                          "n599218
            IF  G_FLAG_STATUS_LIU  = C_SHOW.                    "n599218
              SCREEN-ACTIVE = '1'.         "show parameters     "n599218
            ELSE.                                               "n599218
              SCREEN-ACTIVE = '0'.         "Hide parameters     "n599218
            ENDIF.                                              "n599218
                                                                "n599218
            MODIFY SCREEN.                                      "n599218
        ENDCASE.                                                "n599218
      ENDLOOP.                                                  "n599218
                                                                "n599218
    adapt the icon on the pushbutton depending on the status  "n599218
      CASE    G_FLAG_STATUS_LIU.                                "n599218
        WHEN  C_HIDE.                                           "n599218
          MOVE  TEXT-081         TO  PB_LIU.  "@0EQ@ Scope ... "n599218
        WHEN  C_SHOW.                                           "n599218
          MOVE  TEXT-082         TO  PB_LIU.  "@0HQ@ Scope ... "n599218
        WHEN  OTHERS.                                           "n599218
      ENDCASE.                                                  "n599218
                                                                "n599218
    "n599218
    START-OF-SELECTION
    START-OF-SELECTION.
    *SET PF-STATUS 'TEST'.
    create the title line
    If no date is given at all, the range is set to the maximum
    extend (1.1.0000 - 31.12.9999).
    If only datum-low is set, it is interpreted as the day for
    which the analysis is wanted --> datum-high is filled up.
      IF DATUM-LOW IS INITIAL.
        DATUM-LOW = '00000101'.
        IF DATUM-HIGH IS INITIAL.
          DATUM-HIGH = '99991231'.
        ENDIF.
      ELSE.
        IF DATUM-HIGH IS INITIAL.
          DATUM-HIGH = DATUM-LOW.
        ENDIF.
      ENDIF.
      MOVE: DATUM-LOW(4)    TO JAHRLOW,
            DATUM-LOW+4(2)  TO MONATLOW,
            DATUM-LOW+6(2)  TO TAGLOW,
            DATUM-HIGH(4)   TO JAHRHIGH,
            DATUM-HIGH+4(2) TO MONATHIGH,
            DATUM-HIGH+6(2) TO TAGHIGH.
      SET TITLEBAR 'MAN'
      WITH TAGLOW MONATLOW JAHRLOW TAGHIGH MONATHIGH JAHRHIGH.
    create the headlines using the titelbar                   "n599218
      PERFORM                    CREATE_HEADLINE.               "n599218
    calculate the offsets for the list header
      PERFORM                    CALCULATE_OFFSETS.
    for the representation of tied empties                    "n547170
      PERFORM                    F0700_PREPARE_TIED_EMPTIES.    "n547170
    create table g_t_mseg_fields with the names of all
    wanted fields from MSEG and MKPF
      PERFORM                    F0300_GET_FIELDS.
    set a break-point : is IS-OIL active ?                    "n599218 A
                                                                "n599218 A
    check whether this is a IS-OIL system                     "n599218 A
      PERFORM                    CHECK_IS_OIL_SYSTEM.           "n599218 A
                                                                "n599218 A
      IF  G_FLAG_IS_OIL_ACTIVE = 'X'.           "IS-OIL ?       "n599218 A
      the 2 IS-OIL specific data fields will be inserted into "n599218 A
      working table G_T_MSEG_FIELDS. Then these fields will   "n599218 A
      transported from database table MSEG, too               "n599218 A
        APPEND  'MSEG~OIGLCALC'  TO  G_T_MSEG_FIELDS.           "n599218 A
        APPEND  'MSEG~OIGLSKU'   TO  G_T_MSEG_FIELDS.           "n599218 A
      ENDIF.                                                    "n599218 A
    create the ALV fieldcatalog for the main list always
      MOVE  'G_T_BELEGE'         TO  G_F_TABNAME.
      PERFORM                    F0400_CREATE_FIELDCAT.
    do not print the ALV-statistics and selection criteria
      CLEAR                      G_S_PRINT.
      G_S_PRINT-NO_PRINT_SELINFOS   = 'X'.
      G_S_PRINT-NO_PRINT_LISTINFOS = 'X'."
    create the range table for the storage location
      PERFORM                    F0600_CREATE_RANGE_LGORT.
    - show the current activity and the progress              "n599218
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'                 "n599218
        EXPORTING                                               "n599218
          TEXT = TEXT-063.       "Reading current stocks        "n599218
    get the stock tables
      PERFORM                    AKTUELLE_BESTAENDE.
      PERFORM TABELLEN_LESEN.
    - show the current activity and the progress              "n599218
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'                 "n599218
        EXPORTING                                               "n599218
          TEXT = TEXT-064.       "Reading MM documents          "n599218
      PERFORM                    F1000_SELECT_MSEG_MKPF.
      PERFORM                    BELEGSELEKTION.
    END-OF-SELECTION
    END-OF-SELECTION.
    results of all the autority checks
      PERFORM                    F9100_AUTH_PLANT_RESULT.
    - show the current activity and the progress              "n599218
      IF BWBST = 'X'.                                           "n599218
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'               "n599218
          EXPORTING                                             "n599218
            TEXT = TEXT-066.     "Calculating Stocks and Values "n599218
      ELSE.                                                     "n599218
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'               "n599218
          EXPORTING                                             "n599218
            TEXT = TEXT-067.     "Calculating Stocks            "n599218
      ENDIF.                                                    "n599218
      PERFORM SUMMEN_BILDEN.
      PERFORM BESTAENDE_BERECHNEN.
      PERFORM LISTUMFANG.
    - show the current activity and the progress              "n599218
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'                 "n599218
        EXPORTING                                               "n599218
          TEXT = TEXT-065.       "Preparing list output         "n599218
    stop if table bestand is empty
      LOOP AT BESTAND.
        SELECT SINGLE MATKL FROM MARA INTO CORRESPONDING FIELDS OF BESTAND
        WHERE
         MATNR = BESTAND-MATNR.
        MODIFY BESTAND INDEX SY-TABIX.
      ENDLOOP.
      DESCRIBE TABLE BESTAND     LINES G_F_CNT_LINES.
      IF  G_F_CNT_LINES IS INITIAL.
      Keinen Eintrag zu den Suchbegriffen gefunden/selektiert
        MESSAGE                  S083.
      perform                  anforderungsbild.
      ELSE.
      process log function if the use is a tax auditor        "n555246
      and the database selection was successful               "n555246
        IF  G_FLAG_TPCUSER = '1'.                               "n555246
          PERFORM                TPC_WRITE_LOG.                 "n555246
        ENDIF.                                                  "n555246
        PERFORM FELDGRUPPEN_AUFBAUEN.
      sort table with header data per material
        IF BWBST IS INITIAL.
          SORT BESTAND BY MATNR WERKS CHARG.
        ELSE.
          SORT BESTAND BY MATNR BWKEY.
        ENDIF.
      which function does the user want ?
        IF      XSUM = 'X'.
        hierseq. alv with sums
          PERFORM                CREATE_TABLE_TOTALS_HQ.
          PERFORM                CREATE_FIELDCAT_TOTALS_HQ.
          PERFORM                ALV_HIERSEQ_LIST_TOTALS.
        ENDIF.
        IF FLAG NE 'X'.
          IF PA_SUMFL = 'X'.
       elseif  pa_sumfl = 'X'.
        show the sums only in a flat ALV
            PERFORM                CREATE_TABLE_TOTALS_FLAT.
            PERFORM                CREATE_FIELDCAT_TOTALS_FLAT.
            PERFORM                ALV_FLAT_LIST_SUMS_ONLY.
          ELSE.
        display the full list using the APPEND ALV
         PERFORM                BESTAENDE_AUSGEBEN.
          ENDIF.
        ENDIF.
        FLAG = ' '.
      ENDIF.
      CLEAR: G_T_MSEG_LEAN, G_T_BSIM_LEAN, BESTAND.             "n443935
    *&   PF_STATUS_SET_TOTALS
    FORM PF_STATUS_SET_TOTALS                                   "#EC CALLED
                       USING     EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD'   EXCLUDING EXTAB.
    ENDFORM.                     "PF_STATUS_SET_TOTALS
       user_parameters_save
    FORM USER_PARAMETERS_SAVE.
      GET PARAMETER ID 'BUK'     FIELD  G_SAVE_PARAMS-BUKRS.
      GET PARAMETER ID 'WRK'     FIELD  G_SAVE_PARAMS-WERKS.
      GET PARAMETER ID 'MAT'     FIELD  G_SAVE_PARAMS-MATNR.
      GET PARAMETER ID 'CHA'     FIELD  G_SAVE_PARAMS-CHARG.
      GET PARAMETER ID 'BLN'     FIELD  G_SAVE_PARAMS-BELNR.
      GET PARAMETER ID 'BUK'     FIELD  G_SAVE_PARAMS-BUKRS.
      GET PARAMETER ID 'GJR'     FIELD  G_SAVE_PARAMS-GJAHR.
    ENDFORM.                     "user_parameters_save
       user_parameters_restore
    FORM USER_PARAMETERS_RESTORE.
      SET PARAMETER ID 'BUK'     FIELD  G_SAVE_PARAMS-BUKRS.
      SET PARAMETER ID 'WRK'     FIELD  G_SAVE_PARAMS-WERKS.
      SET PARAMETER ID 'MAT'     FIELD  G_SAVE_PARAMS-MATNR.
      SET PARAMETER ID 'CHA'     FIELD  G_SAVE_PARAMS-CHARG.
      GET PARAMETER ID 'BLN'     FIELD  G_SAVE_PARAMS-BELNR.
      GET PARAMETER ID 'BUK'     FIELD  G_SAVE_PARAMS-BUKRS.
      GET PARAMETER ID 'GJR'     FIELD  G_SAVE_PARAMS-GJAHR.
    ENDFORM.                     "user_parameters_restore
    *&   USER_COMMAND_TOTALS
    FORM USER_COMMAND_TOTALS                                    "#EC CALLED
                       USING     R_UCOMM     LIKE  SY-UCOMM
                                 RS_SELFIELD TYPE  SLIS_SELFIELD.
      CLEAR                      G_S_BESTAND_KEY.
      CASE R_UCOMM.
        WHEN '&GRPT'.
          SORT BESTAND BY BWKEY MATKL.
          FLAG = 'X'.
          PERFORM GRP_TOTAL(ZGRP_TOTAL) TABLES BESTAND.
          IF FLAG = 'X'.
            EXIT.
          ENDIF.
        WHEN '&STR'.
          IF BWBST = 'X'.
            IF FLAG = 'X'.
        clear: LGBST,BWBST ,SBBST.
          PERFORM GRP_TOTAL(ZGRP_TOTAL1) TABLES BESTAND.
              SUBMIT ZRM07MLBD2 WITH  LGBST = 'X'
                               WITH WERKS = '1000'
                               WITH BUKRS = '1001'
                               WITH XSUM = 'X'
                               WITH PA_WDZER =  PA_WDZER
                               WITH PA_WDZEW = PA_WDZEW
                               WITH PA_WDWIZ = PA_WDWIZ
                               WITH PA_WDWUW = PA_WDWUW
                               WITH PA_WDWEW = PA_WDWEW
                               WITH PA_NDZER = PA_NDZER
                               WITH PA_NDSTO = PA_NDSTO
                               WITH LGORT IN LGORT
                               WITH DATUM IN DATUM
                               WITH MATNR IN MATNR VIA SELECTION-SCREEN
                                                       AND RETURN.
              CLEAR:      LGBST.
            ELSE.
              MESSAGE E345(0) WITH 'First see the grp total'.
            ENDIF.
          ELSE.
            MESSAGE E345(0) WITH 'Stock type chosen was not valuated'.
          ENDIF.
    Quarter Ending----
        WHEN '&QTRE'.
          TYPES: BEGIN OF TY_MTART,
                  MATNR LIKE MARA-MATNR,
                  MTART LIKE MARA-MTART,
                 END OF TY_MTART.
          DATA: L_REC_QTY TYPE P DECIMALS 3,
                L_ISS_QTY TYPE P DECIMALS 3,
                L_REC_AMT TYPE P DECIMALS 3,
                L_ISS_AMT TYPE P DECIMALS 3,
                L_OTHERS_QTY TYPE P DECIMALS 3,
                L_SALE_QTY TYPE P DECIMALS 3,
                L_SALE_AMT TYPE P DECIMALS 3,
                L_OTHERS_AMT TYPE P DECIMALS 3.
          DATA: IT_MAKT TYPE STANDARD TABLE OF MAKT WITH HEADER LINE,
                IT_T023T TYPE STANDARD TABLE OF T023T WITH HEADER LINE,
                IT_T134 TYPE STANDARD TABLE OF T134T WITH HEADER LINE.
          DATA: IT_MTART TYPE STANDARD TABLE OF TY_MTART WITH HEADER LINE.

    Dear Experts,
    Thanks all for the reply.
    I have followed the OSS notes 194788
    Only enter the selection criteria which are required for the selection of the stock management unit for which the opening stock balance and closing stock should be determined.
    In MB5B I key in selection criteria which are :
    material number : xxxxxx
    company code : 1000
    plant : 1500
    batch : xxxxxx
    special stock indicator : orders on hand
    selection date : 01.08.2009 to current date
    stock type :special stock
    and the result comes out :
    there is initial balance of 3000 kg on 01.08.2009 - INCORRECT ( our team never enter this initial balance but still came out )
    therefore the stock of current date also WRONG
    if the total stock is adjusted using stock take , the accounting journal will be created, and reduce the financial asset with the same amount of 3000 kg (WRONG EFFECT)
    how to solve this issue without affecting the accounting journal ?
    Thanks
    Pauline

  • Do we have standard report to show sale order stock with amount?

    Do we have standard report to show sale order stock with amount?
    I try to use MB5B and MBBS but they don't show value.
    MB5B show only qty
    MBBS no any report.
    Please kindly help.
    Thank you very much.

    Okay Thank you very much for your suggestion.
    I think I have to create a new ZProgram. T_T

  • MB5B views material stock

    Dear Expert,
    When I display MB5B for material xxxx with criteria :
    - it's a special stock
    - has batch number
    - special stock indicator : orders on hand
    - posting date : blank
    MB5B shows the date of 01.01.0000 with the stock 3000 kg.
    it is impossible because in our plant initial balance is done on 2005-2006
    Why it can happen?
    anyone experience this problem?
    thanks
    pauline

    Dear Experts,
    Thanks all for the reply.
    I have followed the OSS notes 194788
    Only enter the selection criteria which are required for the selection of the stock management unit for which the opening stock balance and closing stock should be determined.
    In MB5B I key in selection criteria which are :
    material number : xxxxxx
    company code : 1000
    plant : 1500
    batch : xxxxxx
    special stock indicator : orders on hand
    selection date : 01.08.2009 to current date
    stock type :special stock
    and the result comes out :
    there is initial balance of 3000 kg on 01.08.2009 - INCORRECT ( our team never enter this initial balance but still came out )
    therefore the stock of current date also WRONG
    if the total stock is adjusted using stock take , the accounting journal will be created, and reduce the financial asset with the same amount of 3000 kg (WRONG EFFECT)
    how to solve this issue without affecting the accounting journal ?
    Thanks
    Pauline

  • In MB5B report  having minus value

    Dear exports
    In MB5B report the opening (amount in LC) stock value in the minus value for zero quantity for some material.
    why it is?
    how can i balanced?
    Regards
    amsi

    check if anwer to question 5 can help you :
    OSS  Note 690027 - FAQ: Reporting IM (no LIS)

  • Time_out & TSV_TNEW_PAGE_ALLOC_FAILED Run time error on MB5B

    Hi expert,
    Time_out & TSV_TNEW_PAGE_ALLOC_FAILED Run time error getting while executing Tx-MB5B.
    ECC 6.0
    oracle 10g
    HPux
    Regards,

    Runtime Errors         TSV_TNEW_PAGE_ALLOC_FAILED
    Date and Time          08.02.2012 14:50:11
    Short text
    No more storage space available for extending an internal table.
    What happened?
    You attempted to extend an internal table, but the required space was
    not available.
    What can you do?
    Note which actions and input led to the error.
    For further help in handling the problem, contact your SAP administrator
    You can use the ABAP dump analysis transaction ST22 to view and manage
    termination messages, in particular for long term reference.
    Try to find out (e.g. by targetted data selection) whether the
    transaction will run with less main memory.
    If there is a temporary bottleneck, execute the transaction again.
    If the error persists, ask your system administrator to check the
    following profile parameters:
    o  ztta/roll_area            (1.000.000 - 15.000.000)
    Classic roll area per user and internal mode
    usual amount of roll area per user and internal mode
    o  ztta/roll_extension       (10.000.000 - 500.000.000)
    Amount of memory per user in extended memory (EM)
    o  abap/heap_area_total      (100.000.000 - 1.500.000.000)
    Amount of memory (malloc) for all users of an application
    server. If several background processes are running on
    one server, temporary bottlenecks may occur.
    Of course, the amount of memory (in bytes) must also be
    available on the machine (main memory or file system swap).
    Caution:
    The operating system must be set up so that there is also
    enough memory for each process. Usually, the maximum address
    space is too small.
    Ask your hardware manufacturer or your competence center
    about this.
    In this case, consult your hardware vendor
    abap/heap_area_dia:        (10.000.000 - 1.000.000.000)
    Restriction of memory allocated to the heap with malloc
    for each dialog process.
    Parameters for background processes:
    abap/heap_area_nondia:        (10.000.000 - 1.000.000.000)
    Restriction of memory allocated to the heap with malloc
    for each background process.
    Other memory-relevant parameters are:
    em/initial_size_MB:         (35-1200)
    Extended memory area from which all users of an
    application server can satisfy their memory requirement.
    Error analysis
    The internal table "\PROGRAM=RM07MLBD\DATA=G_T_COLOR" could not be further
    extended. To enable
    error handling, the table had to be delete before this log was written.
    As a result, the table is displayed further down or, if you branch to
    the ABAP Debugger, with 0 rows.
    At the time of the termination, the following data was determined for
    the relevant internal table:
    Memory location: "Session memory"
    Row width: 76
    Number of rows: 3
    Allocated rows: 3
    Newly requested rows: 128 (in 1 blocks)
    How to correct the error
    The amount of storage space (in bytes) filled at termination time was:
    Roll area...................... 5720752
    Extended memory (EM)........... 502807584
    Assigned memory (HEAP)......... 1842267952
    Short area..................... " "
    Paging area.................... 40960
    Maximum address space.......... 4294967295
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "TSV_TNEW_PAGE_ALLOC_FAILED" " "
    "RM07MLBD" or "RM07MLBD"
    "COLORIZE_TOTALS_FLAT"
    If you cannot solve the problem yourself and want to send an error
    notification to SAP, include the following information:
    1. The description of the current problem (short dump)
    To save the description, choose "System->List->Save->Local File
    (Unconverted)".
    2. Corresponding system log
    Display the system log by calling transaction SM21.
    Restrict the time interval to 10 minutes before and five minutes
    after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
    In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.

  • Difference in Invoice Amounts in MC$I

    Hi Experts,
    While using MC$I, I wanted to know the difference between the two Invoice amounts - one GLamount and the other amount as on posting date in this report. I find that for certain material these Invoice Amount vary. Could anyone explain why these differences occur and when compared to MB5B how can this be justified. I need to explain it to one of the end users.
    Thanks and regards,
    BP

    Hi
    If MR8M is not possible, then you can post a credit note using the same T.code MIRO for the difference for the excess quantity and later later post an invoice for the short posted quantity.
    Regards

  • MB5B Report table for Open and Closing stock on date wise

    Hi Frds,
    I am trying get values of Open and Closing stock on date wise form the Table MARD and MBEW -Material Valuation but it does not match with MB5B reports,
    Could anyone suggest correct table to fetch the values Open and Closing stock on date wise for MB5B reports.
    Thanks
    Mohan M

    Hi,
    Please check the below links...
    Query for Opening And  Closing Stock
    Inventory Opening and Closing Stock
    open stock and closing stock
    Kuber

  • Amount not getting displayed in the cube

    Hi,
    I have a ZTable which has got an Amount field declared like this.
    AMOUNT     WAERS     CUKY     5     0     Currency Key
    And I declared a ZAMOUNT as Amount in the cube and provided 0CURRENCY.
    Initially there was no value in the Amount column in the Ztable and hence could not see any value of Amount in the cube.But after entering values in the ZTable, I deleted the replicated the DS, create TR, UR and then create an InfoPckg and then created the Data Transfer Process. But still I am not able to see the Amount Value in the cube.
    Kindly Help
    Sam..

    > hi Sam,
    >
    > did you assign AMOUNT field from ztable to infoobject
    > ZAMOUNT in transfer rules ? move AMOUNT from left to
    > right in tab 'datasource./transf.rules ?
    > and ZAMOUNT mapped ? (with ZAMOUNT)
    >
    > hope this helps.
    Hi Edwin,
    Assigning and mapping which you mentioned is just pulling an arrow from the left Amount to right ZAmount, right? I did that. But there is an additional 0Currency on the right side without getting mapped? Should I map that also to Amount? Any issue with Rules.
    Regards,
    Sam...

  • Report for open orders and amount of product confirmed

    Hi All,
    Can some one give me an idea on a report which shows open orders and also shows amount of product confirmed against these open orders?
    Thanks,
    Neelima.

    Hi Veni,
    Incomplete order are the order's in which some data is missing so that particular order can't be further processed, that is what you could check through "Incompletion Log". Whereas Open orders are the orders which are open for further processing viz. deliver billing(but open order is a complete order i.e. no data missing).
    Check this program:
    *& Report ZGM_OPENPO *
    REPORT ZGM_OPENPO NO STANDARD PAGE HEADING LINE-SIZE 132 LINE-COUNT 36(2).
    TABLES: t001w, "Plants/Branches
    ekko, "Purchasing Document Header
    ekpo, "Purchasing Document Item
    marc, "Plant Data for Material
    mara. "General Material Data
    DATA:
    BEGIN OF itab OCCURS 0,
    matnr LIKE marc-matnr,
    werks LIKE marc-werks,
    beskz LIKE marc-beskz,
    mmsta LIKE marc-mmsta,
    END OF itab.
    DATA: BEGIN OF iekpo OCCURS 0,
    ebeln LIKE ekpo-ebeln,
    menge LIKE ekpo-menge,
    aedat LIKE ekpo-aedat,
    wemng LIKE eket-wemng,
    END OF iekpo.
    DATA: BEGIN OF iekko OCCURS 0,
    ebeln LIKE ekko-ebeln,
    lifnr LIKE ekko-lifnr,
    bedat LIKE ekko-bedat,
    ekgrp LIKE ekko-ekgrp,
    END OF iekko.
    selection-screen:begin of block b1 with frame title text001.
    SELECT-OPTIONS werks FOR ekpo-werks OBLIGATORY.
    SELECT-OPTIONS matnr FOR ekpo-matnr.
    SELECT-OPTIONS beskz FOR marc-beskz.
    SELECT-OPTIONS bsart FOR ekko-bsart.
    selection-screen:end of block b1.
    INITIALIZATION.
    AT SELECTION-SCREEN ON werks. "Validate for werks
    SELECT SINGLE * FROM t001w WHERE werks IN werks.
    IF sy-subrc 0. MESSAGE e429(mo). ENDIF.
    AT SELECTION-SCREEN ON matnr.
    SELECT SINGLE * FROM mara WHERE matnr IN matnr.
    IF sy-subrc 0. MESSAGE e429(mo).ENDIF.
    START-OF-SELECTION.
    SELECT * FROM marc INTO CORRESPONDING FIELDS OF TABLE itab WHERE werks IN werks AND beskz IN beskz AND
    matnr IN matnr.
    SELECT ebeln FROM ekpo INTO CORRESPONDING FIELDS OF TABLE iekpo
    FOR ALL ENTRIES IN itab WHERE matnr = itab-matnr AND loekz EQ space.
    SELECT ebeln lifnr bedat ekgrp FROM ekko INTO CORRESPONDING FIELDS OF
    TABLE iekko
    FOR ALL ENTRIES IN iekpo WHERE ebeln = iekpo-ebeln AND bsart IN bsart.
    SELECT ebeln menge aedat FROM ekpo INTO CORRESPONDING FIELDS OF iekpo
    FOR ALL ENTRIES IN iekpo WHERE ebeln = iekpo-ebeln. MODIFY iekpo INDEX sy-dbcnt.
    ENDSELECT.
    SORT iekpo BY aedat.
    DELETE ADJACENT DUPLICATES FROM iekpo COMPARING ebeln.
    SELECT wemng FROM eket INTO CORRESPONDING FIELDS OF iekpo FOR ALL ENTRIES IN iekpo WHERE ebeln = iekpo-ebeln.
    MODIFY iekpo INDEX sy-dbcnt.
    ENDSELECT.
    END-OF-SELECTION.
    DATA : file_name TYPE string.
    file_name = 'c:\pay_det\open_po1.xls'.
    DATA : BEGIN OF it_join_fields OCCURS 0,
    field_name(20),
    END OF it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'ebeln'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'menge'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'aedat'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'wemng'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    filename = file_name
    filetype = 'ASC'
    APPEND = 'X'
    write_field_separator = 'X'
    TABLES
    data_tab = iekpo
    FIELDNAMES = it_join_fields
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT iekpo.
    IF iekpo-menge NE iekpo-wemng.
    WRITE:/4 iekpo-ebeln,21 iekpo-menge ,46 iekpo-aedat, 56 iekpo-wemng.
    ENDIF.
    ENDLOOP.
    if sy-subrc 0. write / 'no data exist for this plant'. endif.
    TOP-OF-PAGE.
    uline 1(80).
    WRITE :/ sy-vline, 20 ' OPEN purchase ORDERs report' color 5,
    80 sy-vline.
    uline 1(80).
    WRITE:/ sy-vline , 4 'PURSCHASE ORDER' COLOR COL_HEADING,
    20 sy-vline, 21 'ORDER QUANTITY' COLOR COL_HEADING,
    45 sy-vline, 46 'item change' color col_heading, 55 sy-vline,
    56 'RECIEVED QUANTITY' COLOR COL_HEADING, 80 sy-vline.
    uline 1(80).
    END-OF-PAGE.
    WRITE :/ 'PAGE NUMBER' ,SY-PAGNO.
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • Open amount of Invoices.

    Hi Experts:
    I am using 0FI_GL_14 to extract data for Invoice payments. My requirement is that I have to show Open amount for the invoices.
    For example:
    - Invoice Amount: $ 100
    - Already Paid: $ 40
    - Open Amt: $ 60
    Is there any combination of fields in 0FI_GL_14, that can bring me the open amount for the inovice (i.e. $60)..?
    Any light would be helpful.
    Kind regards,

    Instead of attempting to calculate Customer Balances in Accounts Receivable by calculating the General Ledger line items, you could instead use the 0FI_AR_20 DataSource which shows the total debit postings (invoices and debits for items such as unauthorized/unearned discounts) and total credit postings (payments and credit memos).
    This data could then be updated to the 0FIAR_C20 InfoCube and for reporting you could use standard content query 0FIAR_M20_Q0001 - Customer Balances.
    Since you're already using 0FI_GL_14, I'm assuming that your source environment is at a minimum ECC6 EHP3 and that the New GL Reporting has been configured.

  • Restriction on amount on Open items query (FI-CA)

    Hello,
    we are trying to implement the queries 0FC_C07_Q0001 and 0FC_C07_Q0002 for reporting on open and cleared items from FI-CA to BW.
    From the open items report on FI-CA (transaction FPO4) it is possible to select based on the amount, and also to relate this balance at BP, CA... level.
    From BW team they say it is not possible to do the same with the open items queries in BW. They say the amount is not even available as a parameter. Is it like this? Can't we select only the open items for CA with more than a specific amount?
    Many thanks in advance,
    Montserrat

    Hi,
    It is possible if you are using conditions, like if the reqt is to show amounts greater than X (entered by user), then a Condition can be created on the amount key figure and use the condition type Greater Than and supply a variable which will be used by the user during run time. See here for full details:
    http://help.sap.com/saphelp_nw04/helpdata/en/73/702e39074dc93de10000000a114084/content.htm
    Hope this helps...

  • GR/IR A/c Amount and Amount in local Curreny values are not matching

    Hello Gurus
    When we are doing MIGO for some Scheduling Agreement PO's the Amount and Amount in local currency columns are mismatching with  paise (+/-), eventhough PO belongs to Local Currency (INR). Because of this GR/IR account is not cleared after MIRO through F.13. Both MIGO and MIRO amount are showing as Open items.
    Why it is happening and what is the way to clear GR/IR A/C. (F.13 with Tolerance limit is also not workout).
    Thanks & Regards
    Venkat.P

    Hi sridhar
    Thanks for reply
    Through MR11 also these values are not cleared.
    Regards
    Venkat.P

Maybe you are looking for