Create a Custom BAPI with inputs as Decimal values

Hello Experts,
I am new to BAPI creation, my requirment has two decimal inputs(as import parameters) and out output can be a simple add of these two numbers.
Decimal Input has 9 characters with 7 decimals Ex: 10.0000000. How to create a structure or data type and use the same back in my BAPI.
What is the ABAP code that, I should write to add these two inputs and export them.
Please help ASAP, I am in a critcal position.
Thanks,
Suma

Hello Suma,
This error is caused because you are trying to use a data type rather a data element, it better if you follow the below process
Start with creating a Structure with ZBAPI name, from SE11
give a component name with Z and component type with Z and then double click on new component type and this will ask what to generate click on dataelement and enter discription then enter a Z new name in the Domain and double click on it, click on data type and enter DEC, no char 9 and decimal 7 then save activate, clikc on back save activate and again click on back and save activate now your sturcture will be saved. Follow the proces if have new data type or else the same for your next entres.
For your Req....
take component ZINPUT1 compenent type ZINPUT with domain as ZZINPUT...
use the sam for ZINPUT2 and ZOUTPUT and then save activate. Now the structure is created.
SE37 create new BAPI, In import parameters take parameters as T_INPUT1 and T_INPUT2 with ZBAPI_SUM-ZINPUT1 and ZBAPI_SUM-ZINPUT2.Then in export  if you wnat inputs also in there just give some export names and give the assoated type as what you have used in import, also add OUTPUT and RETURN with ZBAPI_SUM-ZOUTPUT and BAPIRETURN.Now write the source code as follows
FUNCTION ZBAPI_TESTDEC1.
""Local Interface:
*"  IMPORTING
*"     VALUE(T_INPUT1) TYPE  ZBAPI_SUM-ZINPUT OPTIONAL
*"     VALUE(T_INPUT2) TYPE  ZBAPI_SUM-ZINPUT1 OPTIONAL
*"  EXPORTING
*"     VALUE(INPUT1) TYPE  ZBAPI_SUM-ZINPUT
*"     VALUE(INPUT2) TYPE  ZBAPI_SUM-ZINPUT1
*"     VALUE(OUTPUT) TYPE  ZBAPI_SUM-ZOUTPUT
*"     VALUE(RETURN) TYPE  BAPIRETURN
INPUT1 = T_INPUT1.
INPUT2 = T_INPUT2.
OUTPUT = T_INPUT1 + T_INPUT2.
ENDFUNCTION.
Now save it and then activate and then clikc on tables tab then functional module on main menu and then relase.
Go to T-code SWO1 create new Obj with ZBAPI name and then clikc create enter Obj name,Name,Des,Program,and Application has to be * then enter.
Click on methods,Utilites, API Methods, Add method, Select BAPI Name then contine for 3 times then click BAPI Added in the methods then on edit change relase status- object type To modeled, To impimented and To relased at 3 diff times then follow the same for Object Type component.
Now click on red and white round button which is similar to BMW symbol. This will generate the BAPI and now you see it in BAPI T-Code.
Hope this helps you ...
Reward if helpfull....
Thanks,
Srikanth

Similar Messages

  • Error while adding a custom field with Input help via AET

    Hi All,
    I need to add two custom field under Service orders at Item level in component BT140I_SRVP.
    One field is required to have the input search help f4 and autopopulates the second field
    I am able to add one field(not requiring help) successfully through AET .
    I have created one Zsearch_help in se11 and its successfully running  and Autopopulating seocnd field while I am testing it
    While adding second field through AET,I need to enter following details as -
    field label,search relevant ,serach help etc.
    When I type the name of my 'Zsearch_help' against field search help it gives me following error
    'Search help is not compatible'.
    Secondly,not getting getter and setter methods for the attrributes in BTAdminI.
    Last,please tell me if i create zhelp and activate it,would it automatically appear in the list on AETwhile assiging it to input field?
    Please help me out.Kindly be detailed as I am new to SAP CRM.
    Thanks,
    Shivani

    The question is answered in CRM 7.0 forum:
    Getting error while adding a custom field (with input help) through AET

  • Custom BAPI with BDC

    hi guys
    i have a custom BAPI with a BDC within it..however im getting an error on process screen saying input value is longer than screen field. i added the code below to go around that error but now again another error occurs
      DATA: BEGIN OF itab_amount OCCURS 0,
            turnover_local(29)   TYPE c,
            turnover_export(29)  TYPE c,
            interest(29)         TYPE c,
            other_income(29)     TYPE c,
            tax(29)              TYPE c,
            trading_acc_exp(29)  TYPE c,
            opening_v_assets(29) TYPE c,
            expenses(29)         TYPE c,
            closing_v_assets(29) TYPE c,
            capital_employed(29) TYPE c,
            non_ded_exp(29)      TYPE c,
            penalty(29)          TYPE c,
            cap_allowances(29)   TYPE c,
            withholding_tax(29)  TYPE c,
            non_taxable_inc(29)  TYPE c,
            directors_wh_tax(29) TYPE c,
            other_all_ded(29)    TYPE c,
            other_tax_paid1(29)  TYPE c,
            assessed_loss_bf(29) TYPE c,
            other_tax_paid2(29)  TYPE c,
            other_tax_paid3(29)  TYPE c,
            tax_on_taxable(29)   TYPE c,
            credits(29)          TYPE c,
            provisional_tax(29)  TYPE c,
            history(1),
      END OF itab_amount.
      MOVE-CORRESPONDING assessment_import TO itab_amount.
    the fields have he same definition data element which is a currency field of 21.2
    now i get the error that i shud enter values in the format __,___,___,___,___,___,___.__ since the output length is 29 for the domain of the data element.
    please can i have some ideas on how to go around this error??
    regards
    prince

    Hie gurus,
    i have made some progress regarding my issue however i am experiencing another error. the requirement for the data is that i moved data to an internal table with data type with equivalent length however wen i pass that value which is coming from data type C i get the error that values shud be in currecy format...how can i solve this????

  • Is there a way to create a custom screensaver with pics/slides that display for different amounts of time?

    Is there a way to create a custom screensaver with pics/slides that display for different amounts of time? Or even add a "video slide" into the screensaver?
    My business has 3 TVs displayed in our lobby, each with its own apple TV and they are all linked to the same photo stream. Currently the Atv screensaver displays the photostream pictures of our products for the default 3 seconds. We just added pics/slides that now display messages and useful info for our customers but I want that info to be displayed for a longer period of time than the pictures to give people a chance to read it.
    I tried using flickr and powerpoint as a work around but no luck.  I created a slide in powerpoint with play length of 15 secs and saved it as a wmv file.  I added that file to a "screensaver" set in flickr and pointed the Atv screensaver to that flickr set.  It still displays everything, pics and the wmv file at the default 3 sec.
    I know I can increase the duration of all pics in the screensaver to display for longer but the goal is to have the pics display at 3 secs and the info slides to display at 15 secs.

    Welcome to the Apple Community.
    No that's not possible.
    If you have any suggestions that you think might enhance the Apple TV you can send Apple your feedback here 

  • I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    The template is a document in itself, it is not applied to an existing document whether it is a Pages document or a Word document converted to a Pages document.
    You would need to either copy and paste content, using existing styles, or apply the styles to the converted Word document.
    You can Import the Styles from an existing document and those imported Styles can be used to override the current document's styles:
    Menu > Format > Import Styles
    The process is simplified if the styles use the same names, otherwise you will need to delete the style you don't want and replace it with the one that you do want when asked, then the substitution is pretty straightforward.
    Peter

  • Is it possible to create a customized survey with our organizations logo at the top?

    Is it possible to create a customized survey with our organizations logo at the top? I'm trying to create a survey for our members but instead of using a template we would like to use something simple with our logo included at the top.

    Just create a blank form and click Add Header at the top of the form page:

  • Is it possible to create a customer master with different address

    Hi Gurus,
    Is it possible to create a customer master with different address as we maintain in SAP CRM.
    Kindly help me onthis issue \
    Regards
    Kannan

    Hi Kannan,
    There are no multiple addresses but you can use multiple unloading ponts for the same address for the ship to Party.
    So when you create a Sales order the system will give a pop up with the unloading points allowing you to select the desired one.
    I hope I understand your query correctly.
    Regards
    Yogesh

  • Why do u need a custom structure for creating a custom bapi

    Hi ,
    why do u need a custom structure for creating a custom bapi.

    Hi,
        Once any Bapi realeased the structures it is using freezed to this bapi, the structure becomes specific to this Bapi, we can not make any changes over there. That is why we need custom structure for creating a custom bapi.

  • How Can I Create a Custom Panel With the InDesign ToolBar's Look and Feel

    I am trying to create a custom panel that looks as close as possible to InDesign's native floating menu bar (with the Frame, Text, etc, icons on it). ToggleBarButtons doesn't look like, although it does contain the functinoality of the button which is pressed stayting pressed.
    Any ideas?
    TIA,
    mlavie

    Hi mlavie,
    I found a nice post on this topic at:
    http://blog.flexexamples.com/2007/08/20/creating-toggle-and-emphasized-button-controls-in- flex/
    Hope this helps!
    Thanks,
    Ole

  • 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]

  • Internal Error when trying to create a custom controller with execute comma

    Hi,
    I have got the following problem. I created a new web dynpro project and added an existing RFC model. But when I try to create a custom controller by applying a service controller including an execute command, I only get an internal error message. The message shows the following information:
    Plugin name:
    Web Dynpro Controller Editor Services
    Plugin ID:
    com.sap.ide.webdynpro.service.controllereditor
    Class:
    com.sap.ide.webdynpro.service.controllereditor.implementation.ImplementationService
    Method:
    getJDTMethod(Controller, String, IProgressMonitor)
    Message:
    Source controller implementation file is not accessible (Path to workspace folder: P:/.../gen_wdp/packages/com/clariant/ml5/types/ML5Cust.java)
    Exception:
    java.lang.Exception: 0
    Maybe someone could help me to fix this problem.
    Thanks Andy
    Ok... I found a way to fix by myself. All I have to do is to create a controller first and after this I have to apply the service controller. I don´t know why but it works. Both steps together doesn´t.
    Bye
    Andy
    Message was edited by: Andreas Choma

    I e-mailed tech support and got my answer.
    I should have been using /dev/rdsk and not /dev/dsk when specifying the disk slice to put the file system on.

  • Writeback with 'NA'  and decimal values

    Hi All!!!
    We are making some tests on the writeback with the BIBeans; we migrated a db from express to 10gR2 and converted it in
    standard form and we try the writeback on this aw.
    We found some problems when in the worksheet there are one or more 'NA' values to writeback.
    In particular when we call the submitChanges method on the crosstab object (like in the BI sample) if there are one or more
    'NA' values the submitChanges fails and return false.
    We solve this problem implementing the cellSubmitting method and catching the cellSubmittingEvent; in this method we
    substitute the values 'null' for the QDR with an "NA" string.
    We also found that the decimal values (like 180.4) make the writeback to fail; we think it is due to the fact that the
    writeback engine add a '.0' to all the values that we try to writeback so for decimal values we have two character '.'; we
    solve this problem with a support's variable for converting the value to a string and pass it to the set data to the QDR to
    writeback.
    Is this the rigth way?
    Is this a bug?
    Following We report the code we implementing for this method
    public void cellsSubmitting(CellsSubmittingEvent e)
    String app;
    ArrayList qdrCollection = (ArrayList)e.getQDROverrides();
    if (qdrCollection != null)
    int iSize = qdrCollection.size();
    for (int i =0; i < iSize; i++)
    QDRoverride qdrOverride = (QDRoverride)qdrCollection.get(i);
    if(qdrOverride.getData()==null)
    qdrOverride.setData("NA"); //for the problem with 'NA' values
    else
    app=qdrOverride.getData().toString(); //for the problem with decimal values
    qdrOverride.setData(app);
    Hi!
    Daniele De Faveri

    Thanks for your post, it is great solution and it's work for me. I'm supprised that those oversights are still in bibeans and nobody from Oracle havent answered your question.
    Message was edited by:
    Moks

  • Excise Amount with three Digit decimal value

    Dear All,
    I enabled three digit decimal values for sales.
    When I am raising a Excise Invoice through J1I3, two digit only appearing?
    For Ex: Excise amount in sale order is 6897.525 where as in J1I3 transaction, it's showing as 68975.25.
    How to correct this issue?
    Rgds,
    Senni.B

    Dear GSL,
    For Import purchase purpose, client is asking for three digit decimal values. But when we go for excise related transactions, it's taking only two digits of the actual value.
    Is there any settings in CIN to activate three digit decimal?
    Rgds,
    Senni.B

  • Getting error while adding a custom field (with input help) through AET

    Hi All,
    I need to add two custom field under Service orders at Item level in component BT140I_SRVP.
    One field is required to have the input search help f4 and autopopulates the second field
    I am able to add one field(not requiring help) successfully through AET .
    I have created one Zsearch_help in se11 and its successfully running while I am testing it
    While adding fsecond field through AET,I need to enter following details as -
    field label,search relevant ,serach help etc.
    When I type the name of my 'Zsearch_help' against field search help it gives me following error
    'Search help is not compatible'.
    Please help me out.Kindly be detailed as I am new to SAP CRM.

    Thanks for very helpful reply. After implementing the suggested SAP note, I am able to see the getter and setter methods.
    So one of my problem has got solved with your kind help:)
    As per your another suggestion,I have created the enhanced fields without the search help from AET in the node BTAdminI with names Plant(ZZPLANT) and Storage Location(ZZStoarge_Loc).
    Now I am facing below problem:
    Since Plant needs to autopopulated by Storage Location (search Help ZOFI_SHLP_STORAGE_LOC),So I need to Implement Getter setter method.
    I have written below code into Get_V_ZZStorage_Loc Method:
    method GET_V_ZZSTORAGE_LOC.
      DATA:
        ls_map    TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
        lt_inmap  TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
        lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab.
        ls_map-context_attr = 'ZZSTORAGE_LOC'.
        ls_map-f4_attr      = 'STORAGE_LOC'. (Storage_loc is the parameter defined in search help)
        APPEND ls_map TO: lt_inmap, lt_outmap.
      CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr
        EXPORTING
          iv_help_id        = 'ZOFI_SHLP_STORAGE_LOC1'
          iv_help_id_kind   = if_bsp_wd_valuehelp_f4descr=>help_id_kind_callback
          iv_input_mapping  = lt_inmap
          iv_output_mapping = lt_outmap.
    endmethod.
    But its not working.Should I write some code in Get_P_XX or some other method also?
    Kindly suggest .

  • OIM: How to create a custom Resource with Form

    Hi -
    I'm integrating OIM and OAM and am trying to create a process through which users can request access to different Applications protected by OAM. Some of these apps require capture additional information from the user.
    I was thinking I would create a Resource for each application so the user could be provisioned or request access and the process form for each resource would contain whatever custom fields that app needed.
    So while I'm quite familiar with the built in things such as AD process forms, and resources, etc... I've never created something like this from scratch. I'm guessing each resource need to do 2 things:
    - Put the user in a group in whatever ldap directory (OAM would look at this group for access policies for the respective application)
    - Gather some required fields
    Here's what I tried so far:
    - Create Resource Object for My App
    - Create Process Definition , type Provisioning, Object Name=My App
    - Create Form in Form Designer UD_MYAPP, set Object Name = My App
    - Set Process Definition's table name = "UD_MYAPP"
    When I try to provision it fails in a Pending System validation. When I click on View or Edit on the Process Form, I get a page saying "A system error encountered, contact your admin...."
    Can someone give me a high level overview of what I need to do? Any key fields I should pay attention to?
    What's best practice with something like this, it's got to be a pretty common thing, right?
    Thanks much
    Alex

    I seem to remember that you get that error when you don't have any fields on your process form.
    I wrote up a high level list of tasks for this on my blog a while ago: http://iamreflections.blogspot.com/2010/08/oim-howto-leverage-standard-connector.html
    You will also need to add a non conditional task to your provisioning process that sets the object status to "provisioned".
    Hope this helps
    /Maritn

Maybe you are looking for

  • Transfer of open POs or SCs?

    Hi all. When a purchaser is leaving the company and still has a lot of purchase orders or shopping carts in the system that are still open - is there some way to transfer these to another colleague? What have you guys done when a person leaves the co

  • Export Data to Excel sheet

    Hi Friends, Can anyone please let me know how to insert value into particular cell of Excel sheet.I can identify particular cell by column number AA,AB etc) and row number(98,99,100 etc). I am using sql developer.Is there any built in functions?

  • Spec-version:2.5]] Root cause of ServletException. error

    Hi team , I am getting following error while executing the the code <[ServletContext@1805526421[app:TPortal_D module:/ path: spec-version:2.5]] Root cause of ServletException. java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.<init>

  • PI_Basis Upgrade

    We are going to upgrade stack level from 13 to 16. Current SP level for PI_Basis is Release 2005_1_620 Patch 13. I see Releases 2003_1_620, 2005_1_720 and 2006_1_620 in stack queue for 16 ( In service market place ). My Question is : Is it 2005_1_620

  • Help with a pong game please

    I bought the book Java (all in one for dummies) and I tried writing up a code to start a pong like game and I keep on receiving this error : --------------------Configuration: Pong - jre1.6.0_07 <Default> - <Default>-------------------- C:\Users\Adri