Error with BAPI:'BAPI _MATERIAL_SAVEDATA'.

Hi Guys,
I am getting error when creating extended views for newly created materials.I am taking a new material number with Function module :BAPI_MATERIAL_GETINTNUMBER, and it has been created new material with Basi view.When i try to create extended views for the same material,its giving the following error: Field MATNR has been transferred inconsistently or is blank.
Thanks in advance.
Regards,
Reddy

The BAPI 'BAPI_MATERIAL_GETINTNUMBER' should not be used to assign internal numbers to material types.
Documentation for 'BAPI_MATERIAL_GETINTNUMBER' says:
In future, this method will no longer be supported for the object type Material (BUS1001).
For standard materials you should use 'BAPI_STDMATERIAL_GETINTNUMBER' & for retail materials you should be using 'BAPI_MATERIAL_GETINTNUMBERRET'.
BR,
Suhas

Similar Messages

  • How to create a document with SRM BAPIS

    Dear colleagues,
    I have a problem with SRM BAPIs. I need to insert a pdf document into a record using SAP BAPIs, This document is already in a table in a binary format
    I am trying with these BAPIs:
        1.
              CALL FUNCTION 'BAPI_SRM_DOC_CREATE'
                  EXPORTING
                    rms_id                  = rms_id
                    sps_id                  = sps_id
                    documentid              = documentid
                    description             = 'DESCRIPTION'
                    do_commit               = 'X'
                    documentid_check_unique = 'X'
                  IMPORTING
                    return                  = return
                    objectid                = objectid
                    documentclass           = documentclass
                  TABLES
                    required_properties     = required_properties.
              This BAPI is working as expected. It returns objectid for the new document.
         2. Now I'm using BAPI_RECORD_ADDELEMENT:
                 ls_doc_id-objectid = objectid.
                CLEAR: ls_sp_poid. " clear weg und ls_sp_poid clearen
                ls_sp_poid-name  = 'DOC_ID'.
                ls_sp_poid-value = ls_doc_id.
                APPEND ls_sp_poid TO lt_sp_poid.
                CLEAR: ls_doc_id.
                ls_sp_poid-name  = 'VARIANT'.
                ls_sp_poid-value = '0'.
                APPEND ls_sp_poid TO lt_sp_poid.
                CLEAR: ls_doc_id.
                ls_sp_poid-name  = 'VERSION'.
                ls_sp_poid-value = '0'.
                APPEND ls_sp_poid TO lt_sp_poid.
                ls_insertion_by_anchor-anchor = 'DECRET'.
                ls_insertion_by_anchor-parent_node_id = '5'.
                ls_insertion_by_anchor-parent_node_attr_name = 'DECRETAT'.
                ls_insertion_by_anchor-parent_node_attr_value = '40'.
              CALL FUNCTION 'BAPI_RECORD_ADDELEMENT'
                  EXPORTING
                    objectid                    = zrm_attcab_scr-phio_id
                    documentclass               = documentclass
                    sps_id                      = 'ZRM_SPS_DOCVAR'
                    anchor                      = 'DECRETS'
                    description                 = 'Descripcion'
                    store_as_new_version        = 'X' "Si X se crea vacio
    *               STACKED                     = ''
    *               DOC_CONTEXT                 =
                    element_type                = 'I'
    *                 insertion_by_anchor         = ls_insertion_by_anchor
    *                insertion_by_modelid        = insertion_by_modelid
    *               INSERTION_BY_REFERENCE_NODE =
    *              ALL_SAME_NAME_ANCHOR        = 'X'
    *               SET_ELEM_DESCR_HARD         = ' '
    *                omit_authority_check        = 'X'
                  IMPORTING
                    return                      = ls_return
                  TABLES
                    element_sp_poid             = lt_sp_poid.
    *             ELEMENT_PROPERTIES                =
    *             ELEMENT_VISIBILITY                =
             This BAPI returns an internal error
    Am I following the correct steps or am I skipping anything?
    Could anyone help me?
    Thanks in advance!!

    I have the same problem!!!
    Anyone knows?
    Thanks!

  • Error message in BAPI call

    I have imported RFC Interfaces from SAP system. Each interfaces doesn't  have fault message.
    How to get error message in BAPI call when error occurs?
    I can catch an exception in BPM but I need to get error message and send it to another system.

    Hi Denis,
    >>>I have imported RFC Interfaces from SAP system. Each interfaces doesn't have fault message.
    if you want to use fault messages
    consider using ABAP Proxies
    >>>>How to get error message in BAPI call when error occurs?
    most bapis have return table in which they
    return error messages (you can do it either
    in a sync way or in an async way if the call is too long - with corrlelation of course)
    Regards,
    michal

  • Problem with mutiple BAPI calls during the commit

    Hi all,
    I am trying to create accounts for a given partner i the transaction F9K1 using the BAPI BAPI_BKK_ACCNT_CREATE. After calling the BAPI I am committing it too.
    The problem is if I try to create multiple accounts like RCA, ACA, MCA, IOE and so on, the first time the BAPI is called to create RCA account it is successful an it is even committing. When I call the BAPI to create the the ACA account the return table from the BAPI shows success message but the commit fails. If I restart the program and try creation of accounts now the RCA will throw a error msg saying account already exist, ACA account will be created and then the MCA account creation fails in the same manner explained above.
    I see the issue is with multiple BAPI calls and I tried using all sort of methods like clearing buffers, start new task in local and wait command and all.  But none of them seems to be working for me.
    Can anyone please guide me on how I can overcome this problem.
    Thanks.

    BAPI :
    BAPI BAPI_BKK_ACCNT_CREATE
    Functionality
    Use this method to create an account in Bank Customer Accounts. This method returns the following values:
    Identification details for the newly created account such as the internal and the external account number, and the bank area details
    A table containing error messages
    To create an account by using this method, you must specify values for the import parameters Bank Area (BANKAREA) and Product (PRODUCTNAME).
    Note: You must also specify a value in the External Account Number (EXTERNALACCOUNTNR) parameter if you have defined an external number range for the bank .
    REgards,
    Jayan.

  • Error Handling for BAPI MB_COUNT_POST_WITHOUT_INV_DOC for MI10 Transaction

    Hi,
    Can any one suggest me, how to handle the errors for the BAPI MB_COUNT_POST_WITHOUT_INV_DOC, because this bapi does not have any return table for errors handling? And also suggest any other BAPI which fits for MI10 transaction.
    <removed by moderator>
    Thanks&Regards,
    Damuan.
    Edited by: Thomas Zloch on Feb 2, 2012

    Hi Dear,
    Your answer is very helpful, thanks..!!
    But when  i am testing with the EIKPF structure, neither error is populating in EIKPF  nor the records are  posting in MI10. Could you please guess what would be the problem?
    Below are the fields that i am passing through this BAPI
    1)Document date 2)count date 3)plant 4)storage location 5)item number 6)material code 7) entry quantity
    Thanks&Regards,
    Damuan.

  • Error handling in bapi

    hi all,
          how to handle errors in bapis,and also can anyone send faqs on bapis.

    Hi
    A BAPI should be able to record and classify all possible errors that may occur a function Module BAPI_MESSAGE_GETDETAIL is used to Handle the Error Messages..
    You have to create a parameter named Return for every BAPI. This parameter returns exception messages or success messages to the calling program.
    BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in the coding. In particular they must not generate terminations or display dialog boxes. Instead, all messages must be intercepted internally and reported back to the calling program in the Return parameter. Otherwise the BAPI will not be processed correctly and control may not be given back to the calling program.
    All error messages or indeed any message that may be returned by the BAPI, must be defined in message table (Tools ® ABAP Workbench ® Development ® Programming environment ® Messages) and described in the documentation for the return parameter. This also applies to the most important or most likely error messages generated by other programs that can be indirectly passed via the BAPI to the application program.
    You must not use exceptions in BAPI interfaces.
    When a termination message (message type A) is triggered, a database rollback is executed in the standard programming model, that is, all tasks performed since the last COMMIT WORK are canceled. When you program BAPIs, we recommend that you also execute a database rollback in the return parameter for termination messages. You must describe this process in the documentation for the Return parameter. For messages of type E (error), the calling program performs the error handling.
    Application developers are provided with two service BAPIs to diagnose and process error messages from BAPI calls:
    BapiService.MessageGetDetail() displays the short and long texts of BAPI error messages.
    BapiService.ApplicationLogGetDetail(), with which information in application logs can be displayed.
    Features
    The export parameter Return can be implemented as follows:
    As a structure, whereby it must be defined in the function module as an export parameter, as well as in the method in the BOR.
    As a table, whereby it must be defined in the function module as a table parameter, as well as in the method in the BOR as an export parameter.
    Before filling the Return parameter you should either initialize the structure with CLEAR or the table with REFRESH and CLEAR.
    If the return parameter is not set or is set to an initial value this means that no error has occurred.
    The Return parameter may be based on the following reference structures:
    BAPIRET2
    You must use this reference structure when developing new BAPIS.
    BAPIRET1, BAPIRETURN
    These reference structures are still partly used in old BAPIs.
    Both structures must be filled in the logon language.
    Reward if Helpfull,
    Naresh.

  • Getting error while Using BAPI Interface in VB

    Hi,
    I m getting error message while creating object of SAP.BAPI.1
    Error message is "out of memory : run time error 7".
    do I need to install any patch to my local PC? If yes then from where could i get that patch.
    Plz help me out.
    Thanks & Regards,
    Sagar

    Hi Sagar,
    Please varify the version of SAP client you use. I have noticed that this error with SAP Frontend Package 6.20, and was able to over come the follwing issue by upgrading to the SAP Frontend Package 6.40.
    Regards,
    Randima

  • Passing Error message to BAPI Structure in RFC

    Hi Experts,
    I would like to know how we pass error message to BAPI structurre in RFC?
    Plz some one give the details about how we handle the errors.
    Thanks in advance.

    Like already mentioned before, every Standard SAP BAPI, has an export or tables parameter which is called something like RETURN with structure BAPIRET2. In here, you can store all the messages that are generated during the BAPI Call.
    However, if you also want to catch errors like system exceptions and communication errors, you will have to add these exceptions manually:
    EXCEPTIONS
         SYSTEM_FAILURE        = 1 MESSAGE RFC_MESS
         COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
    However, not sure if this addition works when calling BAPI from NON-sap application.
    Declaration:
    DATA: RFC_MESS(128).

  • Getting the error while using bapi 'BAPI_PROJECTDEF_UPDATE'.

    Hi,
    All
    To fulfill a requirement of project definition update in PS module, I have been trying with bapi 'BAPI_PROJECTDEF_UPDATE' , but I am getting the error like 'The external key is not compatible with the internal key'.
    Following are the details of my source code:
    CALL FUNCTION 'BAPI_PS_INITIALIZATION'
       data: ls_def_strucure LIKE BAPI_PROJECT_DEFINITION,
           ls_def_update LIKE BAPI_PROJECT_DEFINITION_UP,
           ls_error like bapireturn1.
    ls_def_strucure-PROJECT_DEFINITION = '11011'.
    ls_def_strucure-DESCRIPTION = 'Indian Metro Updated by BAPI'.
    ls_def_update-DESCRIPTION = 'X'.
    CALL FUNCTION 'BAPI_PROJECTDEF_UPDATE'
       EXPORTING
         currentexternalproje          = '11011'       " Project Definition
         currentinternalproje          = '11011'
         project_definition_stru       = ls_def_strucure
         project_definition_up         = ls_def_update
      IMPORTING
        RETURN                        = ls_error
    * TABLES
    *   E_MESSAGE_TABLE               =
    CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    I have tried with 'BAPI_PROJECT_MAINTAIN' ,but there I am not getting any idea to usage of this bapi.
    please help me if you have any solution for this problem.
    Thanks in advanced.

    Thanks for your quick reply
    Actually i have a requirement to update the Project definition and other Project elements like WBS, Network , Activities and Milestone. I referred several documents and came to know that 'BAPI_PROJECT_MAINTAIN' can perform these all update tasks. But tried with that bapi but got the error. First help me please if you have any idea about this BAPI .
    Coming to BAPI_PROJECTDEF_UPDATE I got the error like Internal and exrternal keys  are not type compatible with each other.
    So , do you have any idea what would be the exact value of these two parameters.

  • Error while calling BAPI in BLS(Logic Editor)

    Hi all,
    I am using a RFC(BAPI_OBJCL_CHANGE) in XMLL logic editor. I have configured in SAP JCO interface. While executing that transaction, it shows error like ACTION FAILED: End Action SAPJCOInterface_0 : (SAP JCO Interface).  But, when I try with other BAPI's its working fine. At the same time when I execute the RFC(BAPI_OBJCL_CHANGE) in SAP logon its working fine. What could be the problem?
    Help in this regard, it's urgent.
    Thanks & Regards,
    Hemalatha

    Did you try to execute the BAPI from SAP in BAPI Explorer?  If you are not familiar with the behavior of a particular BAPI, that is a good place to do testing.  By using BAPI Explorer, you have bypassed any impact xMII may have on the execution of the BAPI. 
    Once you have the parameters set correctly there and the BAPI executes without error, then try it in xMII.  A couple of other things to keep in mind.  SAP often adds leading zeroes to various ID's (material, production order, batch, etc.).  BAPI's often do not.  So make sure you know the configuration of the object and check to make sure you have leading zeroes where appropriate.
    Hope this helps,
    Mike
    Also make sure you check the Automatically Commit Transaction since you are performing an action upon SAP rather than simply retrieving information.
    Edited by: Michael Appleby on Feb 11, 2008 4:17 PM

  • Runtime error while testing BAPI using Webservice Navigator

    Hi all,
    I created a webservice to a BAPI and tested in Webservice Navigator, while testing it is throwing the below error:
    Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC
    Exception              CX_SY_OPEN_SQL_DB
    Termination occurred in the ABAP program "SAPLCRM_LINK_DU" - in
    "CRM_LINK_SAVE_DU".
    The main program was "RSM13000 ".
    In the source code you have the termination point in line 15
    of the (Include) program "LCRM_LINK_DUU01".
    The program "SAPLCRM_LINK_DU" was started in the update system.
    The termination is caused because exception "CX_SY_OPEN_SQL_DB" occurred in
    procedure "CRM_LINK_SAVE_DU" "(FUNCTION)", but it was neither handled locally
    nor declared
    in the RAISING clause of its signature.
    The procedure is in program "SAPLCRM_LINK_DU "; its source code begins in line
    1 of the (Include program "LCRM_LINK_DUU01 ".
    Thanks,
    Sanjani

    I have created customized teh bapi BAPI_ACTIVITYCRM_CREATEMULTI and created a webservice for it.
    I called BAPI_TRANSACTION_COMMIT in the Customized BAPI.
    I tested it in webservice navigator and could see the that OBJECT_ID was generated, but it is not getting updated in database table eventhough i called the Commit fm in my customized BAPI, it is showing an error with a popup as EXPRESS DOCUMENT "UPDATE WAS TERMINATED" received from author "xyz".
    Suggest me with some solution.
    Regards,
    Sanjani
    Edited by: Sanjani on Dec 2, 2010 2:26 PM
    Edited by: Sanjani on Dec 2, 2010 2:29 PM

  • Error while defining BAPI method in the BOR

    Hi all,
    I am following a document and trying to learn BAPIs. Now, after an object type is created through SWO1, from Utilities -> API Methods -> Add Method, I am asked to enter a function module name. Shouldthis FM be already existing one? When I gave some name there and entered, it's giving an error
    BAPI : BAPI function module ZBAPI_GET_BILL_ITEMS has no return parameter
    Diagnosis
    The system checks that the RETURN parameter has been defined in both the BOR and in the function module. The parameter must refer to one of the BAPI return structures (all planned reference structures can be used for BAPIs up to and including Release 4.6B; but from Release 4.6C only BAPIRET2 can be used).
    The BOR parameter must be type EXPORT (one line or multi-line) and the function module parameter must be type EXPORT (if one line) or type TABLE (if multi-line).
    Procedure
    Create a RETURN parameter for the function module. Also define the reference of the BOR parameters to the function module parameter in the BOR ("Name in function module").
    Note that only incompatible changes can be made to BAPIs already released and delivered.
    Find out about enhancing or modifying BAPIs that have already been delivered by calling the BAPI Explorer (Tools -> BusinessFramework -> BAPI Explorer) and reading the project form "Project to change an existing BAPI".
    Can anybody help me out, please?

    Hi ,
    In the export of that fm u have to give this.
    parameter name typing   associated type
    RETURN        TYPE            BAPIRETURN      
    Regards

  • How to create a Contract with reference to a Sales-Order(VA01) with a BAPI

    Hi,
    my name is Wadim and i need help.
    My problem:
    I am creating a sales-order(VA01) with the BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.
    After that i have to create a contract(VA41) with reference to this order. I found the BAPI "BAPI_CONTRACT_CREATEFROMDATA" and it has the same interfaceparameters like the salesorder-bapi. but there are no parameters to get a connection to the sales-order.
    Is it even possible to get a connection to a sales-order with a bapi???
    thanks for help
    regards mark
    Edited by: Krapp Wadim on May 20, 2010 9:19 PM

    Hi Wadim,
    I have a similar requirement to create order lines in an existing contract with reference using  BAPI_CUSTOMERCONTRACT_CHANGE.  The order lines get created in the contract. However, the condition types from the order line which i'm referencing are not getting referenced and are not getting added in the Contract's line after referencing.
    Did you come across any such issue ? If yes , could you suggest the solution ?
    Regards,
    Venkat.

  • How to create an uwl with a BAPI

    Hi Experts!!!
    I need someone that say me, how to create a task in the uwl with a bapi or program.
    Thanks in advanced,
    Regards,

    Hi Carlos,
    Do you have the javadocs?  It contains information in regards to the UWL API.
    http://help.sap.com/javadocs/NW04S/current/uw/overview-summary.html#Service Component Collaboration
    What is the necessity to create a task from a BAPI or from a program?  If the task is in the backend inbox (SBWP) once UWL is configured properly it will also be created in the worklist. 
    We use SWK_LOCAL_INBOX_GET to pull back the list of tasks
    We use the following wapis for the following purposes:
    SAP_WAPI_GET_HEADER to retrieve the from value
    SAP_WAPI_GET_OBJECTS to retrieve the attachment information
    SAP_WAPI_WORKITEM_DESCRIPTION to retrieve the task description text
    Have a look at the page that I sent you above.  This gives great information on the UWL structure and how it works.
    Please let me know if you require any additional documentation.
    Beth Maben
    EP - Senior Support Consultant
    AGS Primary Support, Business Suite & Technology
    Please see the UWL Wiki @
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/bpx/uwl+faq  ***

  • Filling partners in ps with a bapi

    I am using BAPI_PROJECTDEF_CREATE for creating a new project, but i need to fill the partners to, i have seen the  BAPI_PROJECT_MAINTAIN, but i can´t find any table for the partners in this bapi, can anybody tell me if it is possible to fill the partners with a bapi?,
    Thanks in advance

    BAPI_BUS2001_PARTNER_CREATE_M
    BAPI_BUS2001_PARTNER_CHANGE_M
    Thanks

  • Error messages for BAPI

    Hello,
    Is there any way to get list of all possible error messages in BAPI for BAPI_PO_CREATE1 and BAPI_SAG_CREATE?
    I need to prepare check list of all possible error messages BAPI can return while creating PO and Schedulling agreement using BAPI.
    Thanks in advance.
    Madhura

    Try checking the message class used inside BAPI_PO_Create and all the messages in ME21n .
    Then you will need to go to this message class and find out al the messages.
    But this can go for a long list from 'error for valid vendor numbers, materials , and all the fields etc
    Mathews

Maybe you are looking for

  • Seeking to fetch thcorrect  sales text and comment for a material number

    Ladys and Gents, Currently I have the problem to fetch correct sales text and comment text on the data base for a certain material. For this purpose I’ll  can use the CALL FUNCTION 'READ_TEXT' as bellow which works quite good. I just have to call it

  • Win 8.1 stutter issue with Flash 15.0.0.189

    Greetings - I am having stuttering issues with 2 brand new 8.1 computers running flash. I've done a fair amount of troubleshooting and I believe it's an issue with Win 8.1 and Flash 15.0.0.189 (I don't know about previous versions. Running this versi

  • Creating Wizard

    Hello Experts,                                 How to Create own Wizard Like MRP Wizard, Document Wizard Quick Reply will be helpful. Please Suggest

  • PLZ Urgent: my PC or my itunes won't detect my iphone 6 anymore!!

    Hello Dears, please any one can support me here coz i'm in **** since two weeks reading many solutionsand tutorials, uninstalling/installing iTunes and USB drivers, but the result is nothing but more anger and depress that make me crazy FYI: before u

  • I purchased a book through iBooks and  it's a bad download

    I purchased 50 shades of grey and there are many repeat pages (5-6) in a row. Then it goes to the next chapter never finishing the sentence/ paragraph.How do I contact the proper people so that it does not continue with other people.