Functionality for MMBE transaction

hi,
I need a functionality in which i need to simulate mmbe transaction with the plant and storage locations mentioned in selection parameters of a report program. All categories of stock are required except returns stock i.e. Unrestricted, Blocked, QI stock.
I need to sum up all the stocks  i.e. Unrestricted, Blocked, QI stock except returns stock and pass it to a variable in report program.
Is there any FM that exists that can return the value of all stocks or is there any other way I can implement this functionality.
Please do help.

Hi!
You have to use 2 tables for this:
- MARD - materal stock data
- MBEW - material values
And for the stock values you have to multiply the stock data with the values for each material.
For historical data, you have to use the MBEW_EXTEND and MARD_EXTEND function modules also, because these function modules are correcting the historical values (previous month and previous year).
Regards
Tamá

Similar Messages

  • Bapi or Function for CJ42 transaction - detail values

    We have the need to import values to plan the revenues of a WBS of a Project from an Excel spreadsheet to transaction CJ42.
    After searching on the forums, I've found a solution to load TOTAL values by using function KBPP_EXTERN_UPDATE_CO (OSS note 625613).
    But we need also to load DETAIL values, having the ability to choose the Cost Element and the Period where the value is stored.
    Exists any function or Bapi that can do this?

    With transaction BDBR/DX Tools I saw that your LSMW it's linked with Bapi BAPI_ACC_REVENUES_POST, which generates a CO document. That isn't what we need.
    Adding some info on the issue:
    We made a transaction to import costs for a given WBS and Version that loads values to CJ40; on this case, the detail values are loaded with bapi BAPI_COSTACTPLN_POSTACTINPUT and total values are loaded by a BDC.
    I would like to do a similar process for the revenue values on CJ42.

  • Mass Function for MC59 transaction

    Hi All,
    In transaction MC59 (Rvise Planning Hierarchy) we have the option to move the member from the planned characteristics to the non planned charateristics and vice versa. But this is done by selection one line item at a time.
    FYI... This is done when we execute the transaction by selecting the option Set Plannability in transaction MC59.
    Do you guys know if there is any mass function to move members from planned charateristics to unplanned characteristics and vice versa?
    Thanks

    As I know this is used to revise the ratio if you delete add a new member into hierachy...I am not getting your point of
    "converting planned characteristics to non planned characteristics?"
    SAP help on this is
    Set this indicator to do one of the following:
    Temporarily exclude a characteristic values combination from the planning process
    Reinclude a characteristic values combination in the planning process
    Characteristic values that you exclude from the planning process can be retrieved - that is, reincluded - at any time
    what you are asking is some thing different.
    try in MC8d.

  • Function Module to get the MMBE transaction Data

    Hi All,
    My requirement is to calculate the open stock of a given part number in all the plants. I was told that the MMBE transaction in SAP can give me the data. So, I was searching for a function module or Bapi which could get this data which I can call in my program. Can anyone help me out?? Thanks.

    Hi Mohan,
    You can try this code..with slight modifications.. (to work for all PLANTS)
    Regards,
    Raj
    FUNCTION ZMM_ISSUES_PER_YEAR_POWER.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(I_MATNR) LIKE  MARA-MATNR
    *"     REFERENCE(I_PLANT) LIKE  T001W-WERKS
    *"     REFERENCE(I_GJAHR) LIKE  MSEG-GJAHR
    *"  EXPORTING
    *"     REFERENCE(E_STK_OPBAL) LIKE  BSIM-MENGE
    *"     REFERENCE(E_STK_VAL) LIKE  BSIM-DMBTR
    DATA : V_STK_OPBAL LIKE BSIM-MENGE,
           V_STK_VAL   LIKE BSIM-DMBTR,
           V_GJAHR     LIKE MSEG-GJAHR.
    DATA : BEGIN OF IT_BSIM OCCURS 0,
              MATNR LIKE BSIM-MATNR,
              SHKZG LIKE BSIM-SHKZG,
              MENGE LIKE BSIM-MENGE,
              DMBTR LIKE BSIM-DMBTR,
           END OF IT_BSIM.
    TYPES: BEGIN OF ST_MSEG,
              MATNR LIKE MSEG-MATNR,
              SHKZG LIKE MSEG-SHKZG,
              MENGE LIKE MSEG-MENGE,
              DMBTR LIKE MSEG-DMBTR,
              BWART LIKE MSEG-BWART,
              LGORT LIKE MSEG-LGORT,
           END OF ST_MSEG.
    DATA : IT_MSEG  TYPE ST_MSEG OCCURS 0 WITH HEADER LINE,
           TMP_MSEG TYPE ST_MSEG OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF IT_MBEW OCCURS 0,
              MATNR LIKE MBEW-MATNR,
              LBKUM LIKE MBEW-LBKUM,
              SALK3 LIKE MBEW-SALK3,
           END OF IT_MBEW.
    *V_KEYDT = I_KEYDT + 1.
    SELECT MATNR
           SHKZG
           SUM( MENGE )
           SUM( DMBTR )
      INTO TABLE IT_BSIM
      FROM BSIM
    WHERE MATNR EQ I_MATNR
       AND BWKEY EQ I_PLANT
       AND GJAHR EQ I_GJAHR
       AND BLART IN ('RE','WE','WA','PR')
    GROUP BY MATNR SHKZG.
    *SELECT MATNR
          SUM( LBKUM )
          SUM( SALK3 )
    INTO TABLE IT_MBEW
    FROM MBEW
    WHERE MATNR EQ I_MATNR
      AND BWKEY EQ I_PLANT
      AND VPRSV EQ 'V'
      AND BWTAR EQ ''
    GROUP BY MATNR VPRSV.
    SELECT A~MATNR
           A~SHKZG
           SUM( A~MENGE )
           SUM( A~DMBTR )
           A~BWART
           A~LGORT
      INTO TABLE IT_MSEG
      FROM MKPF AS B
      JOIN MSEG AS A
        ON BMBLNR EQ AMBLNR
       AND BMJAHR EQ AMJAHR
    WHERE A~MATNR EQ I_MATNR
       AND A~WERKS EQ I_PLANT
       AND A~KZBEW IN (' ','B')
       AND A~BWART NOT IN ('541','542','321','322','121')
       AND A~KZVBR NOT IN ('A')
       AND A~GJAHR EQ I_GJAHR
    GROUP BY AMATNR ASHKZG ABWART ALGORT.
    LOOP AT IT_MSEG WHERE BWART EQ '544' AND LGORT EQ ''.
       TMP_MSEG = IT_MSEG.
       APPEND TMP_MSEG.
    ENDLOOP.
    DELETE IT_MSEG WHERE ( BWART EQ '309' AND DMBTR EQ 0  ).
    DELETE IT_MSEG WHERE ( BWART NE '543' AND LGORT EQ '' ).
    LOOP AT TMP_MSEG.
       IT_MSEG = TMP_MSEG.
       APPEND IT_MSEG.
    ENDLOOP.
    *READ TABLE IT_MBEW WITH KEY MATNR = I_MATNR.
    *V_STK_OPBAL = IT_MBEW-LBKUM.
    *V_STK_VAL   = IT_MBEW-SALK3.
    LOOP AT IT_MSEG.
       IF IT_MSEG-SHKZG EQ 'H'.
          V_STK_OPBAL = V_STK_OPBAL  - IT_MSEG-MENGE.
          V_STK_VAL   = V_STK_VAL    - IT_MSEG-DMBTR.
      ELSE.
         V_STK_OPBAL = V_STK_OPBAL  + IT_MSEG-MENGE.
       ENDIF.
    ENDLOOP.
    LOOP AT IT_BSIM.
       IF IT_BSIM-SHKZG EQ 'H'.
         V_STK_OPBAL = V_STK_OPBAL  - IT_BSIM-MENGE.
         V_STK_VAL   = V_STK_VAL    - IT_BSIM-DMBTR.
      ELSE.
         V_STK_OPBAL = V_STK_OPBAL  + IT_BSIM-MENGE.
         V_STK_VAL   = V_STK_VAL    + IT_BSIM-DMBTR.
       ENDIF.
    ENDLOOP.
    E_STK_OPBAL = V_STK_OPBAL.
    E_STK_VAL   = V_STK_VAL.
    ENDFUNCTION.

  • Bapi function module for ME32k Transaction

    Hi all,
            Can any one tell me what is the BAPI function module for ME32K transaction . I am trying to create service agreements in this transaction.
    Even you can tell me if any other alternative procedure is there to create the service agreements in ME32K.
    Bye
    Srinivas

    Hi srinivas p ,
    Do you find some solution for this?! I have the same problem...
    Can you help-me?
    Patrícia.

  • MMBE transaction fields for BATCH and ITS Quantity

    Hi Gurus,
               I am developing a report to get the details of material like Material code, Material type, Material Group, Material Group1, Special stock indicator, Special stock Numb, Batch and its quantity.
             Can any one suggest the table from where i cud fetch Special stock numb and its indicator , batch and relevant quantity of the material.
           My client is referring to standard transaction MMBE and wants me to get the details from there.
          I would like to take this opportunity to thank you in advance for your valuable suggestions.
    Thanking You,
    ZIa

    Hi,
    The following tables used for MMBE...Just identify your table & fields....
    TABLES: kna1,                     "Kundendaten auf MandEbene
            lfa1,                             "Lieferantendaten auf MandEb.
            lfm1,                             "Lief.daten auf EkOrgEb.
            tcurm,                            "Customizing (Bew.kreisebene)
            makt,                             "Material-Kurztexte
            mara,                             "Materialdaten auf MandEbene
            marav,                            "Materialdaten mit Kurztext
            marc,                             "Materialdaten auf Werksebene
            marcv,                            "Materialdaten auf Werksebene
            mard,                             "Materialdaten auf Lagerort
            marm,                             "Mengeneinheiten zum Material
            mchb,                             "Chargenbestaende
            mcha,                             "Chargen
            mch1,                             "Chargen
            mkol,                             "Lieferanten-Konsignation
                                              "Mehrwegtransportverpackungen
            msca,                             "K.Auftragsbest. beim Lief.
            mska,                             "Kundenauftragsbestand
            msku,                             "K.Lergut und K.Konsignation
            mslb,                             "Lieferantenbeistellung
            mspr,                             "Projektbestände
    *<<<    hier später weitere Bestandstabellen ergänzen
            ekbe,                             "enth. WE-Sperrbestand
            ekpo,                             "Bestellposition
            resb,                             "Reservierungsposition
            vbbe,                             "Bestände des Vertriebs
            t001,                             "Buchungskreistabelle
            t001l,                            "Lagertabelle
            t001w,                            "Werke
            t006a,                            "Zuo. externe - interne ME
            t134t,                            "Texte zur Materialart
            t148,                             "Sonderbestände
            t148k,                            "Sonderbestände Sicht MM_BD
            t136,                             "Bestandsfelder je Anz.Version
            t136a,                            "Bestandsfelder je Anz.Versio
            t136e,                            "max. Felder Einzelliste
            t136f,                            "max. Felder Grund/Aufrißliste
            t136v,                            "Anz.Version zur Einzelliste
            t157b,                            "Texte Bestandsfelder
            t320,                             "Lagernummer zu Werk/LgOrt
            t340d,                           "JH/13.05.98/4.0C
            rmmmb,                        "Hilfsfelder
            rmmme1,                      "Hilfsfelder für alt. MEs
            sscrfields.                      "Hilfsfeld Sel.bild SW/8.10.98

  • "distributions for this transaction are in the functional currency, but..."

    I have this error that I am getting when trying to interface my projects billing to AR. I can't seem to fix it.
    The error as shown: The distributions for this transaction are in the functional currency, but the
    entered amount does not equal the accounted amount. Please recalculate the
    accounted amount for this transaction and resubmit AutoInvoice.
    I have checked the currency in the projects and the functional currency and they all seem to match in CAD which is what I am trying to bill out at. I am unaware of any foreign exchanged workers or expenses related to these projects.
    Any clues?

    Hi Dina,
    Thank you for the answer.
    I thought also at "Bill be Transaction Currency" but this issue appears on the projects only for one organization, on other organization (same setup) it doesn't appear.
    Even more:
    - this issue doesn't appear on all the projects on the same organization (projects with the same characteristics);
    - on an earliear back-up instance (three month ago) the issue appear for project A and it doesn't appear on the production instance (same setup for project A for both instances).
    I don't know to be any patches differences between these two instances, I checked up the setup for PA ... what else should I look for to explain (or correct) the issue?
    Regards,
    tinar

  • CRM Search for business transactions, not functioning as expected

    Hello All:
    I am not sure if this is a authorization issue or something to do with config.
    Using transactions CRMD_BUS2000120 - Process Complaints and CRMD_BUS2000126 - Maintain Activities I am trying to perform an open/all search on documents the user has access to, but for some bizarre reason it only lists the documents to which the user is defined as 'own'. But, if I try to open a document for the transaction type the user is authorized to, it lets me open it.
    From a security settings perpective, i would think that the system would perform a check in the following order:
    1) Your own documents (authorization object CRM_ORD_OP)
    2)   a) Authorization objects CRM_ACT, CRM_OPP, CRM_SAO, CRM_SEO, CRM_CO_SE, CRM_CON_SE, CRM_LEAD, CRM_CMP, CRM_CO_SA, CRM_CO_SC
    b) Authorization object CRM_ORD_PR
    c) Authorization object CRM_ORD_OE
    any suggestions?
    Thanks
    KT

    Hi Ravindranath
    Check if your system time zone settings are correct:
    IMG>SAP Web Application Server>General Settings>Time Zones>Maintain System Settings
    IMG>SAP Web Application Server>General Settings>Time Zones>Maintain Time Zones
    Hope this helps
    Regards
    Pragasen

  • Getting Values of MMBE transaction

    Hello all,
         I need to get the Values of the MMBE transaction and use those values in my report for calculation. Can anybody suggest a way to execute the MMBE tranasaction from my report and get the values in a  table.
    Regards,
    Vijayakumar

    Vijay,
    Submit MMBE program in your zprogram by passing the values to the MMBE selection screen for ex
    SUBMIT MMBE Program WITH p_werks = p_werks
    EXPORTING LIST TO MEMORY AND RETURN.
    and then use
    LIST_FROM_MEMORY
    LIST_TO_ASCI
    LIST_FREE_MEMORY
    Or copy MMBE program as zmmbe and then use EXPORT IMPORT concept to get the final internal table values into your zprogram.
    K.Kiran.

  • Error "You cannot enter a partner function for output NEU"

    Hi Experts,
    I'm having these error "You cannot enter a partner function for output NEU" (message VN041) when I tried to assign a partner function (e.g OA)  in the conditions records for application "EV" (Purchase outline agreement). The system do not allow me to do this for any doc type (LP, LPA, MK, OA, etc). I'm using t-code NACE or MN08.
    I want to assign partner for key combination "Document Type". The conditions is already there but with no value, so I want to assign partner function "OA" or "VR".
    I already check all the configuration and looks fine. For example, define possible partner functions for output type "NEU" for application "EV" (Purc outline agree).
    Hope you can help me to find the problem.
    Thanks,
    Mairo.

    I have the error in NACE or using tcode MN08.
    As soon I executed those transaction the system shows the condition records created for varios Doc Type (e.g LP, LPA, MK, etc) but with no partner function assigned. For example:
    Doc. Type /  Name                     /             Funct  /   Partner     /            Medium  /  Date/time  /   Language
    LP        /       Scheduling Agreement     /  blank  / blank  /                                          2      /          3   /              EN
    LPA      /      Scheduling Agreement                              / blank    / blank   /                1        /       3         /        EN
    For example, I try to assign function "OA" for Doc. Type "LP", choose value from quickpick. Then when I press enter, the system give me the error "You cannot enter a partner function for output NEU", message no. VN041. Do not allow me to continue, so I have to leave this field blank, with no change.
    Thanks,

  • To Find Include for Enhancement for Particular Transaction

    Hi Friends,
    Could You Plz assist me...
    How to find out the User Exit for Particular Transaction.
    Like for ME23N, we have a Include RV64A701     OR       for VA01, we have the include MV45AFZZ and so on for every Transaction, which we believe as the User Exits.
    Plz let me know, How to find out these Includes apart knowing from Configuration Part.
    Thanks Alot

    Hi,
    1. In the transaction go to : system->status-> <PROG. NAME>
    2. after getting the program name go to SE37 , type EXIT<PROG NAME> and press F4 to get the list of function exits available.
    once you get the exit you should also be able to find the include name using the where used list, just select the exit and click where used list.
    rgds,
    venu.

  • Free Goods Determination for other transaction types

    Hi,
    Does anybody know of any Function Modules or Class names that determines Free Goods determination in a Sales Order? We are thinking if this functionality could be mimicked for other transaction types?
    Thanks!

    Hi,
    please consider the sap online help:
    http://help.sap.com/saphelp_crm700_ehp03/helpdata/en/b7/4a893a8729337be1
    0000000a11402f/frameset.htm
    Check the function moduls:
    Event CRM_FREE_GOODS_ADD_ITEM_EC
    CRM_FREE_GOODS_DETERMINE_EC  >
    CALL  FUNCTION CRM_FREE_GOODS_DETERMINATION
    Best regards
    Rene

  • Partner functions for a specific customer not seen in XD03 but appears in XD02

    Hello SAP Gurus,
    I have a situation where a partner functions for a specific customer not seen in XD03 but appears in XD02, In XD03 only one partner function (Ship to) appears but in XD02 (Sold to, Ship to, Bill to and payer appears), from the customer master I can see that account group for this customer has been changes to Sold to (Z001) from Ship to (Z002).
    I checked in settings for OB20 transaction for display customer centrally, it is in Display mode as required and not suprresed would like your inputs as to why this is happening and what can be done to fix this.
    Thanks and Regards
    Mohammed Roshan

    Hi ROshan,
      Open customer master in XD02  sales view and save it then check in XD03 it should display the partner functions.
    As you said the account group has been changed I think the records needs to be saved again.

  • Bapi for migo transaction

    i have created a bapi to upload data for MIGO transaction.. (GOODS RECEIPT-->PURCHASE ORDER)
    i am getting the error " stock posting is not possible for this material "'.
    when i create directly, it is posted.. while uploading through the program it shows the above error.
    please suggest if anyone knows....
    Thanks in advance,
    Dhivya N.

    *& Report  ZR_MIGO_UPLOAD
    *& package name : zabap
    *& transport request number : MIDK901443
    *& program to upload goods movement
    REPORT ZR_MIGO_UPLOAD.
    ***DATA DECLARATION***
    type-POOLs:  icon.
    TYPES: BEGIN OF TY_GR_PO,
            EBELN(10) TYPE c ,     "'PO NUMBEr
            EBELP(10) TYPE c,     "PO ITEM NUMBER
    *       LGOBE TYPE LGOBE,     "STORAGE LOCATION DESCRIPTION
            LGORT(10) TYPE c,     "STORAGE LOCATION
            XFELD TYPE c,     "ITEM OK
            GERNR(10) TYPE c,     "SERIALNUMBER
            END OF TY_GR_PO.
    DATA: TA_GR_PO TYPE TABLE OF TY_GR_PO,    "TABLE FOR GOODS RECEIPT PURCHASE ORDER
           WA_GR_PO TYPE TY_GR_PO.
    DATA: BLDAT TYPE BLDAT,     "DOCUMENT DATE
            BUDAT TYPE BUDAT,     "POSTING DATE
            WEVER TYPE WEVER.     "VERSION FOR PRINTING GR SLIP
    ***BAPI DECLARATION***
    DATA: BEGIN OF GM_HEAD OCCURS 0.                    "Material Document Header Data
             INCLUDE STRUCTURE BAPI2017_GM_HEAD_01.
    DATA: END OF GM_HEAD.
    DATA: BEGIN OF GM_CODE OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_CODE.          "Assign Code to Transaction for Goods Movement
    DATA: END OF GM_CODE.
    DATA: BEGIN OF GM_RET OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_HEAD_RET.       "Material Document Number/Material Document Year
    DATA: END OF GM_RET.
    DATA: BEGIN OF GM_ITEM OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_ITEM_CREATE.    "Material Document Items
    DATA: END OF GM_ITEM.
    DATA: BEGIN OF GM_SER OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_SERIALNUMBER.    "Serial Number
    DATA: END OF GM_SER.
    data: BEGIN OF ta_bapireturn OCCURS 0.
            INCLUDE STRUCTURE BAPIRET2.
    data: END OF ta_bapireturn.
    ***declaration of excel file handling table***
    FIELD-SYMBOLS: <fs> type any.    "field symbol for alsm_excel
    DATA: TA_EXCEL TYPE TABLE OF ALSMEX_TABLINE,  "table to contain excel sheet values
           WA_EXCEL TYPE ALSMEX_TABLINE.
    ***declaration of other parameters***
    data:       V_brow type i VALUE    2,    "BEGIN OF ROW
                 V_bcol type i value   1,     "BEGIN OF COL
                 V_erow type i value 65536,   "END OF ROW
                 V_ecol type i value 256.     "END OF COLUMN
    DATA:  V_sear type string,
            V_INDEX TYPE i,
            V_tabix type sy-tabix,     "current line.
            v_lines type i.          "total number of records
    DATA: DATE TYPE DATS.
    ***SELECTION SCREEN***
    ***SELECTION SCREEN DESIGN***
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 3.
    PARAMETERS: zCODE(2) TYPE C MATCHCODE OBJECT H_T158G,
                 zrefdoc type REFDOC,
                 version type WEVER.
    SELECTION-SCREEN skip 5.
    PARAMETERS: p_file type ibipparms-path.
    SELECTION-SCREEN SKIP 3.
    SELECTION-SCREEN END OF BLOCK b1.
    ***SELECTION SCREEN VALUE REQUEST***
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
       CALL FUNCTION 'F4_FILENAME'                                    "f4 help for file name
         EXPORTING
           PROGRAM_NAME  = SYST-CPROG
           DYNPRO_NUMBER = SYST-DYNNR
           FIELD_NAME    = 'P_FILE'
         IMPORTING
           FILE_NAME     = P_FILE.
    ***SELECTION SCREEN EVENT***
    AT SELECTION-SCREEN.                                 "validation
       if p_file <> ''.
         V_sear = p_file.
         SEARCH V_sear for '.xls'.
         if sy-subrc <> 0.
           message 'please provide excel file. it is not valid' type 'E'.
         ENDIF.
       ENDIF.
    INITIALIZATION.
    *   DATE = '17.04.14'.
       GM_HEAD-PSTNG_DATE = SY-DATUM.
       GM_HEAD-DOC_DATE   = SY-DATUM.
       gm_head-pr_uname = sy-uname.
    ***START OF SELECTION***
    START-OF-SELECTION.
       gm_head-REF_DOC_NO = zrefdoc.
       gm_head-VER_GR_GI_SLIP = version.
       GM_CODE-GM_CODE = zCODE.
       PERFORM EXCEL_UPLOAD.
       PERFORM EXCEL_CONVERSION.
       PERFORM NO_RECORDS.
    END-OF-SELECTION.
       PERFORM BAPI_ASSIGNMENT.
       PERFORM BAPI_FM.
    *&      Form  EXCEL_UPLOAD
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM EXCEL_UPLOAD .
       CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
         EXPORTING
           FILENAME                = P_FILE
           I_BEGIN_COL             = V_BCOL
           I_BEGIN_ROW             = V_BROW
           I_END_COL               = V_ECOL
           I_END_ROW               = V_EROW
         TABLES
           INTERN                  = TA_EXCEL
         EXCEPTIONS
           INCONSISTENT_PARAMETERS = 1
           UPLOAD_OLE              = 2
           OTHERS                  = 3.
    ENDFORM.                    " EXCEL_UPLOAD
    *&      Form  EXCEL_CONVERSION
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM EXCEL_CONVERSION .
       if ta_excel is NOT INITIAL.
         sort ta_excel by row col.
         clear wa_excel.
         clear wa_GR_PO.
         LOOP AT ta_excel INTO wa_excel.
           move wa_excel-col to v_index.
           ASSIGN COMPONENT v_index OF STRUCTURE wa_GR_PO to <fs>.
           if sy-subrc = 0.
             move wa_excel-value to <fs>.
           ENDIF.
           at END OF row.
             append wa_GR_PO to ta_GR_PO.
             clear wa_GR_PO.
           ENDAT.
         ENDLOOP.
       else.
         MESSAGE 'no data for conversion' type 'I'.
       ENDIF.
    ENDFORM.                    " EXCEL_CONVERSION
    *&      Form  NO_RECORDS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM NO_RECORDS .
       DESCRIBE TABLE ta_GR_PO LINES v_lines.
       if v_lines = 0.
         MESSAGE 'NO RECORDS TO UPLOAD' TYPE 'E'.
       ENDIF.
    ENDFORM.                    " NO_RECORDS
    *&      Form  BAPI_ASSIGNMENT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BAPI_ASSIGNMENT .
       IF TA_GR_PO IS NOT INITIAL.
         LOOP AT TA_GR_PO INTO WA_GR_PO.
           gm_item-PO_NUMBER = wa_gr_po-ebeln.
           GM_ITEM-STGE_LOC = WA_GR_PO-LGORT.
           GM_ITEM-PO_ITEM = WA_GR_PO-EBELP.
           GM_ITEM-NO_MORE_GR = 'X'."WA_GR_PO-XFELD'.
    *      GM_SER-SERIALNO = WA_GR_PO-GERNR.
           gm_item-NO_MORE_GR =  1.
           gm_item-ENTRY_QNT = 2.
           gm_item-MOVE_TYPE = 101.
    *      gm_item-MVT_IND = 'B'.
           gm_item-plant = 'P001'.
           gm_item-move_stloc = 'FG01'.
    *      GM_ITEM-SPEC_STOCK = 'K'.
           APPEND GM_ITEM.
           APPEND GM_SER.
         ENDLOOP.
        ELSE.
          MESSAGE 'DATA IS NOT UPLOADED' TYPE 'I'.
        ENDIF.
    ENDFORM.                    " BAPI_ASSIGNMENT
    *&      Form  BAPI_FM
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BAPI_FM .
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
       EXPORTING
         GOODSMVT_HEADER               = gm_head
         GOODSMVT_CODE                 = gm_code
    *   TESTRUN                       = ' '
    *   GOODSMVT_REF_EWM              =
      IMPORTING
        GOODSMVT_HEADRET              = gm_ret
    *   MATERIALDOCUMENT              =
    *   MATDOCUMENTYEAR               =
       TABLES
         GOODSMVT_ITEM                 = gm_item
        GOODSMVT_SERIALNUMBER         =  gm_ser
         RETURN                        = ta_bapireturn
    *   GOODSMVT_SERV_PART_DATA       =
    *   EXTENSIONIN                   =
    if ta_bapireturn-type = 'S'.
         write:/ icon_green_light as icon,
                 'success: Material document',gm_ret-mat_doc,  'is created for the GOODS RECEIPT- po number : ', wa_gr_po-ebeln,
               / 'reason:' , ta_bapireturn-message.
    ELSEIF ta_bapireturn-type = 'E'.
         write:/ icon_red_light as icon,
                 'error: Material document',gm_ret-mat_doc , 'is not created for the GOOD RECEIPT- po number : ', wa_gr_po-ebeln,
               / 'reason:' , ta_bapireturn-message.
    ENDIF.
    ENDFORM.                    " BAPI_FM

  • How to update a BP status Using CRMXIF_ORDER_SAVE for  any transaction .

    Hey i am able to perform deleting a transaction or inserting a BP for a transaction using CRMXIF_ORDER_SAVE .
    But i am not able to delete or update a BP for a transaction using my program .
    REPORT  ZCRMBUSIPART1.
    data : t_crm type CRMXIF_BUSTRANS_T ,
          wa_crm like line of t_crm ,
          wa type CRMXIF_PARTNER ,
          i_ret type BAPIRETM .
    *PARAMETER : p_input type CRMXIF_BUSTRANS-object_id .
    wa_crm-OBJECT_TASK = 'U' .
    wa_crm-object_guid = '220939E0B523274FB6C0E380766BCEEA' .
    wa_crm-partner-datax = 'X'.
    wa-partner_fct = '00000031'.
    wa-partner_no = '0000000025'.
    wa-object_task = 'U'.
    wa-kind_of_entry = 'A'.
    wa-addr_type = '2'.
    wa-display_type = 'BP'.
    wa-MAINPARTNER = ''.
    wa-input_fields-PARTNER_FCT = 'X'.
    wa-input_fields-partner_no = 'X'.
    wa-input_fields-kind_of_entry = 'X'.
    wa-input_fields-addr_type = 'X'.
    wa-input_fields-display_type = 'X'.
    wa-input_fields-MAINPARTNER = 'X' .
    append wa to wa_crm-partner-data .
    append wa_crm to t_crm  .
    CALL FUNCTION 'CRMXIF_ORDER_SAVE'
      EXPORTING
        data          = t_crm
    IMPORTING
       RETURN        =  i_ret
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
    write 'done'.
    IF any1 can please point out the reason , it wud be appreciated .
    THanks guyz

    Hi ,
    PUT a break point in CRM_ORDER_MAINTAIN and try to change the partner in order and you will come to know which values needs to be passed.
    example.
    REF_GUID                                                                  pass the ref guid
    REF_HANDLE                                               0000000000
    REF_KIND                                                                  pass the ref kind
    REF_PARTNER_HANDLE                                             0000
    REF_PARTNER_FCT                                             pass the old partner function
    REF_PARTNER_NO                                             pass the old partner no
    REF_NO_TYPE                                             BP
    REF_DISPLAY_TYPE                                             BP
    PARTNER_GUID                                             pass the guid
    KIND_OF_ENTRY                                             pass the kind of entry
    PARTNER_FCT                                             new partner function
    PARTNER_NO                                             new partner no
    DISPLAY_TYPE                                             BP
    NO_TYPE                                                                  BP
    Regards,
    Gangadhar.S
    Edited by: gangadhar rao on Mar 7, 2011 11:31 AM

Maybe you are looking for

  • Why won't my USB external keypad work?

    Hi there, I'm trying to set up my Targus Wireless Numeric Keypad (AKP11CA) to my MacBook (OS X). Nothing seems to work. I am supposed to plug in the USB receiver, then turn the keypad on. The first time I did this, the computer recognized that I was

  • LOOKUP OF beans between two jar files

    How to lookup beans between two jar file I have two jar files named as ejb1.jar , ejb2.jar . both the <ejb-name> are same.. InitialContext ctx = new InitialContext(); Object te = ctx.lookup("test"); if i want to lookup for 2nd jar (ejb2.jar)which has

  • MII Display

    Hi, I am creating the charts for usage material from ERP , I have extracted the usage details from the ERP and show up in the charts but I dont see the dates scroll below the charts. Can someone help me with this. P.S : I have even selected the Time

  • Linking a page as a browser window from a drop-down menu item

    I have tried to link from a drop-down menu item to link to a small browser window instead of a full page.  I tried using the "behaviors" but I got both the regular page and the browser window.  Is there a way to make it just the browser window. Thank

  • Metadata: DBA_* vs ALL_*

    Hi, Could any one clear me what is the difference between metadata tables DBA_* and ALL_* (For example difference between DBA_SEGMENTS and ALL_SEGMENTS). Regards, Nagarjun.