CREATION OF CUSTOM BAPI

How to update the Return table while creating a custom bapi.

Hi,
1st Check for the return value ( Sy-subrc). You can check as shown below
* select plant and its description
  select werks from t001w into t_plant where werks = t_werks.
  IF sy-subrc <> 0.
* if the details is not found pass return value
    CALL FUNCTION 'BALW_BAPIRETURN_GET2'
      EXPORTING
        type   = 'S'
        cl     = 'ZMSG'
        number = '001'
      IMPORTING
        return = return.
    APPEND return.
  ENDIF.
Goto TCode- SE91 & create own msg class (here ZMSG) & populate.
Regards.
Nikhil.

Similar Messages

  • Creation of custom BAPI for FB02

    Hi Guys,
    I want to create custom BAPI to update FB02 and for my requirement i found there is no standard BAPI available since i need to update lot of other fields in FB02 that is the reason, i want to use CALL TRANSACTION inside the BAPI to update FB02 but i found its not working.
    Is it really possible to use BDC( Call Transaction ) inside the BAPI??? if it is possible any reason why its not working for me and if it dont work, how do u think i should update FB02 - plss dont mention standard BAPI's or FM.
    Note: I have seen some Standard BAPI's using CALL Transaction inside them but in my case its not working.
    Thanks & Regards,
    Pavan

    Your question is to create custom BAPI
    Follow these steps.
    1. Find the fields you are giving values on the screen and create a structure. you should only use structure and must not use that structure in other ways.If you use it in other objects BAPI will be frozen.
    2.After you create Structure you create function module and mention that structure in that.Later release the function module
    3.Later you go to SWO1 and add that method in that and realese that also
    4.Finally you can find your BAPI in BOR
    You can also find solution to your question in the following link
    http://www.****************/Tutorials/BAPI/CustomBAPICreation/page1.htm

  • Error while creating a Custom BAPI?

    Hi Guys,
                  I created Custom BAPI thru SWO1 tr code and API method also.AFter API methos creation i went to GOTO->ERRORLIST then i got these errors
    "Field SAPB -SAPFILES is too long to be included in the container
    Field BAPICONTEN -LINE is too large to be included in container"
    so what shall i do to overcome thiese errors
    Thanks,
    Gopi.

    Hi Gopi,
    Check this link
    [http://www.erpgenie.com/sap/abap/bapi/example.htm]

  • Creation of customer using BAPI_CUSTOMER_CREATEFROMDATA1

    hi Techies..
    i want to create customer in effects in KNA1.
    iam using FM "BAPI_CUSTOMER_CREATEFROMDATA1".
    first is it correct one to create customer.
    nxt is the mandat fields given in documentation and mandat fields while we create through XD01 are different.
    plz list out mandat fields i need to pass...
    plz anyone help me out wts process of creation of customer through this bapi..
    Thanks in Adv..
    Raju Mummidi

    HI
    Re: BAPI function create Customer master(T-code XD01)??
    For XD01-- account group and customer number are mandatory.
    Re: BAPI for creating customers
    Regards
    Pavan

  • Customer BAPI can't be viewed from BAPI explorer

    I have tested my customer BAPI in SE80 and SWO1 to be implementable, but not released, can we see it in BAPI explorer?

    Hello Jolin,
    Check this wiki to know about required steps to make available the customer BAPI in BAPI explorer.
    A step by step guide for beginners on user defined BAPI creation - ABAP Development - SCN Wiki

  • How to create custom BAPI for a project on Agentry?

    As I am very new to BAPI creation, I would like to get some helpful pdf documents or links for creating custom BAPIs, which would fetch data for an Agentry Project to be build.
    Tags edited by: Michael Appleby

    Rajkamal,
    I would recommend you work through the following tutorial on how to build an Agentry application from scratch.  It covers creating a BAPI to retrieve data from the SAP backend to Agentry.
    Part 1 - http://scn.sap.com/docs/DOC-47550
    Part 2 - http://scn.sap.com/docs/DOC-47651
    --Bill

  • Problem in  creation of Customer Master

    Hi gurus,
    I am facing problem in creation of customer master.
    I have created a account group zz01 copying from 0001.which has internal no. assignement for the customer.
    Now i am trying to create a customer master, at partner functions level under sales area data...  the system is asking for the no. for each partner functions.. when i tried to manually enter, the system is not taking any number nor it is letting me save the data.
    Please help me out in acertaining,  what could be the issue.
    regards
    Gupta
    [email protected]

    its due to the number ranges that is specified in the partner determination ... chech what is the number range assigned in the parner determination ,,, so once u check that u have to manually enter the number between that range only .. this should solve ur problem...
    path to check the number range is as below :
    spro-img-logistic generalbusiness partner-customers---define account groups and field selection ---    
    at this point click position button at the bottom and give ur account group .. select ur account group and click detail button .. now inside that u can see the specified number range .. dafault is 08 ( means u can specify between 400000 to 499999)..
    and some times  u may not have defined number range... check urs and create accordingly ... this should solve ur problem...
    rewards if solved ..
      thank you
    madhan

  • How to transport a custom bapi (written by me) to another server

    Hello friends,
    We have a software that is integrated with SAP. To make our software work with SAP, we have some custom bapis created on SAP side. We would like to transfer them to another server that is on a different network. After reading many documents and forums here is the what I have done and the problem that I am facing. Your help will be highly appreciated.
    1.Started Transaction 'SE80'.
    2.Created a test package called 'ZTRANSPORTTEST'.
    3.Created a function group called 'ZTRANSPORTTESTFN' under that package.
    4.Created a function module under the group called 'ZTRANSFUNCTION'
      NOTE: Just saved and activated without adding any code since I won't be using this function
                 for anything other than to test the Transport Feature.
    5. Clicked on the button that said 'Transport Organizer' and saw the list of requests including the
        EC1K900083one that I just created.
    6. I tried to release it by 'RIGHT CLICKING'
       It waited for few seconds with the message....."code inspector checks running.".
       Then it failed with an error message as follows
       Error in pre-export methods for request EC1K900083
      NOTE: I have made sure that everything is activated properly, since I read on a forum that this
                 error may occur if something is not activated properly. So I have done this step over
                 and over again making sure that everything is activated properly.
    7. I then started Transaction 'SE09' and saw the request 'EC1K900083' under the released tree with a 'CHECK' Mark.
    However, when I sent to /usr/SAP/trans/data and /usr/SAP/trans/Cofiles, I didn't find the transport data there.
    Has anyone done this before and if so what am I doing wrong? Your suggestions or feedback will be highly appreciated.
    Thanks
    Ram

    Hello Friends,
    Thanks for all the responses. I got the following response from SAP TECH SUPPORT which is not very encouraging and so I am just closing this.
    Thanks
    Ram
    ===========================================================================
    30.04.2009 - 11:40:29 EST - Reply by SAP
    Dear Mr Ram,
    Thanks for explaining it once again.
    The package is just container for development objects that belong together, in that they share the same system, transport layer, and
    customer delivery status. Please check the below link http://help.sap.com/saphelp_nw70/helpdata/en/ea/c05da3f01011d3964000a0c94260a5/frameset.htm
    As I understand correctly you want to 'export' your development outside of your SAP system domain. For that either you can do it using 'Externalsystems'. 'External systems' are a special form of virtual systems. A real SAP System is used in their place to perform actions on the transport directory. They are different from virtual systems in that they have their own transport directory that you can freely choose, you can use external systems to:
    -Write transport requests to exchangeable data media
    -Read transport requests from exchangeable data media
    -Send transports to other transport domains using an intermediate directory
    -Send transports to other transport domains using an intermediate directory
    If you want to transport between systems in different domains, we recommend that you link domains with 'domain links'. There must be a
    permanent network connection between the systems in the two domains, similar to the connection between systems within the same domain.
    I would recommend to take a look in the documentation available in SAP Online help for further information on how to setup this
    complex transport landscape. I hope this information helps you to setup the transport system.
    Or you simply create a transport request of type 'transport of copy' and input target system and client (which you should know) system as
    target system include the objects (bapi) in the request. This ensure that requests will only be imported into that system. Other systems willnot be touched.
    'Transport of copies' type transports do not get automatically added to the next buffer after they have been imported into a system. When creating a 'Transport of copies' transport the target system must be specified as this type of transport does not respect the defined transport routes outlined in TMS.
    You can use this request type to transport objects to a specified SAP System using Transports of copies. The objects are transported with the version they have in the current SAP System. The original location of the objects remains unchanged. There is no delivery to another SAP System.
    But we at AGS we cannot suggest, as the nature of your request indicates this is a consulting issue rather than a software error.
    Customer Support's charter, under the SAP maintenance agreement, is to handle software or system defects in the standard delivered R/3 product. Please refer the note 1054121.
    So you have to seek assistance from SAP's Remote Consulting Service which is billable.
    I am sorry that I could not give you more positive reply in this case.
    With warm regards,
    Sajiv
    Active Global Support - Technology
    =========================================================================

  • Error during create CR for MDGC "Enter a relevant role for creation of customer master data"

    Hello Experts,
    I am unable to create a Customer CR in 'MDG 6.1 Customer UI' , the UI throws an error saying "Enter a relevant role for creation of customer master data".It looks like it is expecting me to mention the BP role ( like FLCU01 Customer or FLCU00 FI Customer ) , but I don't see that BP role section in the Customer UI to mention .
    While creating the vendor CR  , I am able to enter the BP role ( like FLVN01 vendor or FLVN00 FI Vendor ) in the UI BP Role section.
    Following are the UI's for Customer and Vendor
    Customers BS_OVP_BP: BS_OVP_CU > OVP: BS_CU_OVP - I do not see BP role section here.
    Vendors BS_OVP_BP: BS_OVP_SP > OVP: BS_SP_OVP - This is working fine  , I see BP role section here.
    Please advice what I am missing here , what should I do for the successful CR creation . Should I change the UI for Customers or do I need to do anything in CVI configuration.
    Thanks,

    Hi Abdullah,
    You were right in the first place the UIBB is missing  , the UIBB 'Role' was present in the 'Search Customer' page but not available in the 'Create Customer CR' page , so I created the 'Role' UIBB again and was able to create the CR now . Not sure how it got deleted in the first place , is there any options where we reset the UI screen to the default initial configuration
    But after approving the CR , only the Business Partner BP is getting created and the Customer is not getting created . Not sure what might be the issue now. Is there any config that tells to automatically create customer when BP is created. I was able to create Vendor using the create Vendor CR before.
    Thanks

  • Issue in custom BAPi

    Hi,
    We had created a custom BAPI.
    This BAPI is having a method, which in turn calls a custom FM (RFC enabled).
    This was working fine but due to some requirement we had to change the structure of one of the parameter used in the interface of the FM. This parameter was in 'Tables'.
    Now we require to change this structure again and have to delete some of the fields, but when we try to do the same we get an error message :
    "BAPI-structure:  invalid change: position field <F1> should be deleted"
    here <F1> is the field that we deleted.
    Has anyone seen such an error and knows the Correction.
    Please help.
    Thanks,
    Ad.

    Hello,
    You can not change the structure of the BAPI parameters, once it is released..!
    So, try to create a new structure with your necessary fields, replace it in your existing structure and again release the BAPI.
    Regards,
    Naimesh
    Reward points, if it is helpful..!

  • Issue in Program for mass creation of customer plans.

    Hello all,
    I am working on a program which helps mass creation of customer plans. My code works well, when no planning account is assigned,  but when I pass the planning account value into the Function module, it gives me an error saying ' Account cannot be displayed, please check your authorizations'. I donot have this problem, when I manually createthe customer plan in the CRM_UI.
    Please let me know the possible cause for this kind of message.
    Thanks,
    Disha.

    Hi Dishaa,
    I'm afraid that I don't have any other clues. Most often it is a difference in user. If you are absolutely sure that you are using the same user at the exact moment the authorization is checked it cannot be that.
    Kinda curious now what the solution to your problem is....
    Best regards,
    Guus
    Edited by: Guus Jansen on Feb 14, 2011 1:32 PM

  • R12 Creation of Custom Responsibilities

    Hi,
    We are currently on R12 with a single org setup and and have a requirement to create custom resp. to control user access.
    Pls. let me know if creation of custom menus, sub menus, request groups is the right option OR menu, function exclusions a better option.
    When compared to 11i does R12 require any additional setups apart from New Resp, Menu, Submenu, Functions, Request Groups, Profile Options..?
    Any metalink note Id which discusses detail of creation of custom resp. in R12 will be of great help.
    Thanks

    Hi,
    The only way you can restrict an user to do certain activities only by defining multiple custom responsibilities... e.g.. A user should not have the privilege to do setups in the system.. He is authorised to do trxs only.. for that you define a Responsibility like "Inventory User" and exclude "setup" function/menu while defining the Responsibility... Now assign this resp to the user..By using this he will be able to do trxs only but he can't do setup or setup changes in Inventory module...
    Your question:  Pls. let me know if creation of custom menus, sub menus, request groups is the right option OR menu, function exclusions a better option.
    To my know knowledge menu, function exclusion is a better option….
    Inventory Responsibilities (e.g.)
    ==============================================================
    Name: Application: Responsibility Key: Description: Effective Start date: Data Group Name: Data Group Application: Menu: Request Group Name: Request Group Application: Read Only Access Exclusions: (Menu) Exclusions: (Menu) Exclusions: (Function) Exclusions: (Function) Exclusions: (Function)
    ==============================================================
    EU_INV_CZE_CLERK_1 Inventory EU_INV_CZE_C1 EU_INV_CZE_CLERK_1 1-Jan-90 Standard Inventory INV_CLERK_1 All Inclusive GUI Inventory Manage Shipments Corrections
    EU_INV_CZE_CLERK_2 Inventory EU_INV_CZE_C2 EU_INV_CZE_CLERK_2 1-Jan-90 Standard Inventory INV_CLERK_2 All Inclusive GUI Inventory INV_CYCLE_COUNTING Manage Shipments Corrections
    EU_INV_CZE_CLERK_3 Inventory EU_INV_CZE_C3 EU_INV_CZE_CLERK_3 1-Jan-90 Standard Inventory INV_CLERK_3 All Inclusive GUI Inventory Miscellaneous Transaction
    EU_INV_CZE_SUPERVISOR Inventory EU_INV_CZE_SUPV EU_INV_CZE_SUPERVISOR 1-Jan-90 Standard Inventory INV_NAVIGATE All Inclusive GUI Inventory INV_SETUP INV_KANBAN Launch Cost Update Standard Cost Update
    Above supervisor resp will restrict user not do setups and he can't do cost update
    **EU_INV_CZE_Super User* Inventory EU_INV_CZE_SU EU_INV_CZE_ Super User 1-Jan-90 Standard Inventory INV_NAVIGATE All Inclusive GUI Inventory Launch Cost Update Standard Cost Update_
    Above super User resp will allow user do setups in Inventory but he can't do cost update as Supervisor resp
    EU_INV_CZE_Setup View Inventory EU_INV_CZE_SUVO EU_INV_CZE_ Setup View 1-Jan-90 Standard Inventory INV_SETUP All Inclusive GUI Inventory Yes
    Question-2_
    When compared to 11i does R12 require any additional setups apart from New Resp, Menu, Submenu, Functions, Request Groups, Profile Options..?
    Ans : No… since you are setting up resp for a single org now.
    Hope this will help.
    Thanks,
    S.P DASH
    Edited by: spdash12 on Oct 22, 2009 11:25 AM

  • "Customer" BAPI in Distribution Model for Training and Events

    We have an HR box with Training and Events - When booking an attendee on a course, you can select the "contact person" tab. Our SD box is separate from HR, so all the contact persons are maintained there. Is it possible to use the "Customer" BAPI in a distribution model so that when we search in the HR box for a contact person, it actually fetches the data from the SD box?
    I remember reading up on this a while back but I can't find the documentation I had back then...
    I know that in BD64 I can create a distribution model, and if I remember correctly, i should be able to "Add BAPI" and use object type "Customer" - Then add all the methods that I need... (like Find, List, Search etc) In essence, once this model has been distributed to the other system, if I go to transaction XD03 in the HR box, I should be able to display customer master details that only exist on the SD box - Is that correct?
    Please help as I am not able to get this to work...

    Ok I figured it out...
    I have created a distribution model with the HR system as the source, and the SD system as the target.
    In change mode, click the "Add BAPI" button and choose object BusPartnerEmployee, method CheckExistence
    Do the same for the following:
    BusPartnerEmployee.Display
    BusPartnerEmployee.GetList
    Customer.CheckExistence
    Customer.Display
    Customer.ExistenceCheck
    Customer.Find
    Customer.GetContactList
    Customer.GetDetail2
    Customer.GetInternalNumber
    Customer.GetList
    Customer.GetSalesAreas
    Customer.Search1
    Ok so I know that this might be a little over-kill, especially all the Customer methods that I added, but it works

  • Calling custom BAPI from VB/VBA

    Hello, all,
    I have written a custom business object and its associated function module.  I can single-test the business object inside native SAP, and it works successfully.  I can also establish a handle to the business object from VBA (using the .GetSAPObject method of the BAPI control object.)  I can't call the method of the custom BAPI, though--I get error message "UploadResults is not a BAPI method."  (UploadResults is the name of both my business object and the method of the business object.)  Here's my source code:
    Sub UploadChemToSAP()
    Dim gConnection As Object 'global connection object
    Dim oBAPICtrl As New SAPBAPIControl
    Dim oBAPIService As Object
    Dim boFunction As Object, boResults As Object, boReturn As Object
    'Set up connection object for SAP.  Note that the SAP BAPI ActiveX object must be available on the form or otherwise.
    Set gConnection = oBAPICtrl.Connection
    'Log in to SAP.  Seems like passwords must be in uppercase.  There are examples of people defaulting some (or all)
    'of the login values
    gConnection.logon
    Set boFunction = Nothing
    Set boResults = Nothing
    Set boReturn = Nothing
    Set oBAPIService = oBAPICtrl.GetSAPObject("UploadResults")
    Set boReturn = oBAPICtrl.DimAs(oBAPIService, "UploadResults", "Return")
    'Log out of SAP.
    gConnection.logoff
    End Sub
    To my knowledge, I have released both the business object and its associated method.  The function module has been released, too.  Any suggestions on where to go from here? 
    Thanks in advance,
    Eric

    Hey,
    Please check the "Processing Type" of the function module implementing the method. It should be a Remote-Enabled module.
    Kiran

  • Call Bundling for custom bapi for mass data processing

    Hi all,
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/4c/4c0e96725311d396a80004ac96334b/frameset.htm
    can i create a custom bapi where i can compress created update tasks. Not single inserts but a single sql insert with many records.
    Are there some SAP FM in order to do it? Documentation says, i must do "Operations in buffer" and "Update buffer data".
    Regards
    Paul

    Is ABAPFIELD an IMPORTING parameter?
    > Total Questions:  17 (15 unresolved) 
    Maybe you should consider cleaning up your old posts.
    Rob

Maybe you are looking for

  • How many devices can you install logic pro 9 on?

    When I'm buying Logic Pro 9 ($200), on how many devices can I install it on. Like games bought in the app store can be downloaded on several devices, but what about Logic. I'm going to install it on two macs when I buy it and soon an iMac. Thanks!

  • Cannot merge calendars in ical

    I am trying to merge several calendars into one in iCal and I understand that the first step to do this is to create a New Calendar Group and grag the calendars into it. I can't seem to drag any calendars (from under "icloud") into the New Calendar G

  • Best practice using regular properties

    What is considered best practice when it comes to using properties ? Example like hostname, port number when connecting towards an external resource. Should property files be used ? Is this considered a bad practice ? Should deployment descriptors be

  • GRC 5.3 CUP - Role level comment(Role approver comments)

    I have recently noticed that comments enterd by our role approvers are being cut short. Does anyone know if their is a character limit on this field?

  • Photoshop Elements 10 Backing up Catalog

    When I go into the Organizer, hit File Back Up Catalog to CD/DVD or Hard Drive my stsyem goes into a loop. How can i fix that?