Creating GRN by the use of BAPI

Dear All,
I want to create, GRN by the use of BAPI.
For this i am using BAPI  BAPI_GOODSMVT_CREATE
I have passed all the required field in this BAPI.
System without any error generating GRN Number,
When i am looking this GRN NUmber in MB03 Transaction of material document display. The system showing the error that this grn number does not exist.
Please provide solution.
With Regards
Shantanu Modi

use BAPI_TRANSACTION_COMMIT after calling the BAPI.
or simply use COMMIT WORK
http://www.sap-img.com/fu018.htm
http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
Cheers
VJ
Message was edited by: Vijayendra  Rao

Similar Messages

  • Problem in creating and updating of  material by the use of bapi and bdc

    Hello All,
    I am using bapi (BAPI_MATERIAL_SAVEDATA ) and than bdc to create and update classification data of material.
    I am facing a problem.
    1) firstly I am creating material by the use of bapi and than after creation i want to update classification data for taht perticular material .
    2) To update classification data i am using bdc . while at the time of updating material through bdc system showing me error that material is currently locked by user (my login name ).
    Please suggest what to do.
    Tkank you
    With Regards
    Shantanu Modi

    When u update/create data it takes sometime to commit. So after using BAPI
    give 10 minutes wait in ur program before updating classification data.
    you can write like
    wait up to 20 seconds.
    and update the classification.

  • How to create a new material using a BAPI?

    Dear friends,
    How to create a new material using a BAPI? I mean without knowing the material no., how to just create a new one using function modules(BAPI)?
    Thanks a lot!

    Dear,
    New material can be created by using a BAPI_MATERIAL_SAVEDATA.
    More over their are lots of threads available on SDN on the question you raised so kindly search the SDN before posting any thread .
    Cheers
    fareed

  • FM/BAPI to creating billi and the use of pos_sa_get_document_st?

    Hi all,
    I can found a function called in one of my reference program, it's purpose is for creating billing. However, I cannot find any any BAPI/FM which is used for creating the billing document, but here is a function named: "pos_sa_get_document_status".
    What's the use of this function?
    and also what function/bapi should I use when I creating the billing record?
    Please Note there will be no Sales Order.
    Regards,
    Mandy

    Have you looked at BAPIACCBILLINGPOST (Please search with this string).
    Thanks,
    Srihari

  • How to Create an FI document using a BAPI

    Hi,
    I have a requirement as under(for a report creation):
    I need get all the Account numbers(from table BSIS) depending on the Posting date(BUDAT) and the Price difference accounts(HKONT) for the previous month(say 1/1 to 31/1).
    After I get all the details from BSIS, I will have to get the Material Number(MATNR), Plant(WERKS), Local Currency, Foreign Currency, Material Quantity and etc., from BSEG(by comparing the Accounting Document Number) which is common in both the tables BSIS and BSEG.
    Now, for all these docs, I need to create a single FI document(that has to cover all these documents) by using the Document type,Posting date and Reclassed Account number and some text has to be inserted into the Item text field.
    I came to know that, we have to use a BAPI inorder for this purpose, I could not get the exact one.
    Please help me in this regard by giving your valuable inputs.
    Regards,
    Vishnu.

    Continue..........
      accountgl-itemno_acc = '2'.
          accountgl-gl_account = 'WRITE UR GL NO'.
          accountgl-comp_code = '1000'.
          accountgl-pstng_date = itab-budat.
          accountgl-doc_type = 'SA'.
          accountgl-profit_ctr = itab-prctr.
          accountgl-alloc_nmbr = itab-zuonr.
          accountgl-po_number  = itab-ebeln.
          accountgl-po_item = itab-ebelp.
    *    accountgL-DE_CRE_IND = 'S'.
          APPEND accountgl.
          currencyamount-itemno_acc = '2'.
          currencyamount-currency = 'USD'.
          currencyamount-amt_doccur = itab-grval.
          APPEND currencyamount.
    *    zsched_line = zsched_line + 1.
    ***line itme 2
          accountgl-itemno_acc = '1'.
          accountgl-gl_account = 'YOUR GL NO'.
          accountgl-comp_code = '1000'.
          accountgl-pstng_date = itab-budat.
          accountgl-doc_type = 'SA'.
          accountgl-profit_ctr = itab-prctr.
          accountgl-alloc_nmbr = itab-zuonr.
    *    accountgl-po_number  = itab-ebeln.
          accountgl-po_item = itab-ebelp.
    *    accountgL-DE_CRE_IND = 'H'.
          APPEND accountgl.
          currencyamount-itemno_acc = '1'.
          currencyamount-currency = 'USD'.
          itab-grval = itab-grval * -1.
          currencyamount-amt_doccur = itab-grval.
          APPEND currencyamount.
    ELSE.
          documentheader-username = sy-uname.
          CONCATENATE itab-mblnr itab-mjahr INTO documentheader-header_txt.
          documentheader-comp_code = '1000'.
          documentheader-doc_date = itab-bldat.
          documentheader-pstng_date = itab-budat.
          documentheader-doc_type = 'SA'.
          documentheader-ref_doc_no = itab-xblnr.
    *    documentheader-BUS_ACT = 'F-02'.

  • Which FM to use while creating a Profit Center using LSMW BAPI

    Which FM to use while creating a Profit Center using LSMW using BAPI: BUS0015

    Hi,
    For creating Profit centre using LSMW bapi method.
    You need to give this values in the 1st step of LSMW.
    Business Object       BUS0015
    Method                    CREATE                                    Create
    Message Type         PROFITCENTER_CREATE          Create profit center
    Basic Type              PROFITCENTER_CREATE01      Create Profit Center
    In We20 port creation use process code as BAPI
    Regards,
    Shan

  • Why the every time Empty view is created. what is the  use of Empty view?

    Hai Experts,
                         im working  on Web Dynpro ABAP i have doubt when ever we create the component One window and
                         one View created by default.but logicaly one empty view also created (not physically).
                         can u please explain me why the empty view is created what is the usde of it.
                           this is not a interview question .i searched the forums i cant get answer.
    Thanks in adv.

    hi ,
    empty is not a mandatory thing in webdynpro component ..  but to get the perfect picture about  the importance and usage of this  Empty views and Empty windows. * i suggest you to check the statefull stateless webdynpro componet and relate the same*
    pl find the same in below URL:
    [http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/e0/202d4108f08739e10000000a1550b0/content.htm]
    hope it helps you,
    Regards,
    Kranthi.

  • Pbm in creating a personnel number using 'HR_MAINTAIN_MASTERDATA'  Bapi

    HI experts,
    I have a Z FM which is used to create a new employee personnel number.  Im getting the following details as input to this FM and these are passed to the 'HR_MAINTAIN_MASTERDATA' which is called inside the Z FM.
    Infotype 0000 - Begda
    Infotype 0001 - position,  personnel area,  emp group,  emp subgroup,  personnel sub area
    Infotype 0002 - last name,  name prefix, first name,  nick name,  initials, forms-of-adress key, date of birth
    All these input values are passed in the relevant input parameters as well as to the input table 'PROPOSED_VALUES parameter of the 'HR_MAINTAIN_MASTERDATA' FM.
    But this FM is not generating a personnel number. It returns the following error.
    T ID                   NUM MESSAGE
    E 00                   058 Entry 10 0  does not exist in  (check entry)
    What is the reason for this error?.  can the experts help me out to overcome this issue?
    Regards,
    Shanthi

    Hi,
    When i executed the same FM in one of my client's system, it generates a personnel number.
    My requirement is to try the same in my IDES. So i used the same FM in my IDES. But it generates this error in my IDES. I have given the values from IT 0000, 0001 and 0002.
    Regards,
    Shanthi
    Edited by: Shanthi on Oct 23, 2009 2:11 PM

  • Need to create Idoc using with BAPI in BP

    Hi Experts,
    Business Partners are created/changed in SAP either directly by using transaction BP or indirectly created from DTI or using the BAPIBUSISM007_CREATEFROMDATA BAPI for new customers and BAPIBUSISM007_CHANGE to change customers. When a business partner is created or changed via transaction BP an IDOC is generated when the create or change is saved. This IDOC is then sent to the appropriate DTI (Third party) clients to ensure the customers remain in sync.
       Now issue is that creates and changes made using a BAPI do not generate an IDOC. Therefore, new customers and customer changes made by DTI clients do update ECC but are not being passed on to Ad Sales since an IDOC is not created. The same is true when a customer is created/changed by Ad Sales. The change is made in ECC via the BAPI but since no IDOC is generated the create/change doesn’t get moved to the DTI clients.
      what the IDOC triggering mechanism is for generating IDOCS from the BAPIBUSISM007_CREATEFROMDATA BAPI and the BAPIBUSISM007_CHANGE BAPI. This mechanism should be some type of ALE Message that can be used in the partner profile setup to automatically generate the IDOC.
    Any inputs about my issue.
    Thanks,
    Anji

    Hi Experts,
    Any updates or suggestions on this issue.
    Thanks,
    Anji

  • Problem while creating serivce call ..using bapi

    Hi
    I am trying to create a service call using a BAPI(BAPI_FLIGHT_GETLIST) as given in the example...
    while creating the service call in the step Adapt Context  i can see Airline Destination from ,Destination to and max rows,
    i am not getting any choice to select dest from and to...
    and when it is finished.. the node bapi_flights_getlist doesnt have any subnodes like cityfrom country from ... flight list.. as shown in the example...
    Can anyone send me the screenshts of creating a service call specially the step Adapt context...to [email protected]
    points will be given..
    Regards,
    Kiran

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • Creating a business object using bapi

    can some one tell me how to create a business object using a bapi and is it possible to create bapi using business object.which is dependent on which one.

    >
    jayashankar wrote:
    > can some one tell me how to create a business object using a bapi and is it possible to create bapi using business object.which is dependent on which one.
    No....
    First read [the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement]...

  • HOw to create a text file in the given path and delete it after the use?

    Hi all,
    I am trying to create a text file at the given path and delete the created file after the use.
    I am using following code.:
    import java.io.*;
    // write binary data as characters
    public class RanIO {
                                            public static void main(String f[])
                                                      // First illustrate append
                                                      String lineSep = "\n";
                                                      try {
                                                                     File temp= new File("C:/Ash","cute.txt");
                                                      boolean ch=temp.createNewFile();
                                                      if(ch)
                                                           System.out.println("file created");
                                                      else
                                                      System.out.println("file Not created");
                                                      //writing to file
                                                 /*     PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
                                                      p.print("Emp NO");
                                                      p.close();*/
                                                                // Open fileWriter in append mode
                                                                               FileWriter fos = new FileWriter(temp, true);
                                                                               BufferedWriter bw = new BufferedWriter(fos);
                                                                               PrintWriter pw = new PrintWriter(fos);
                                                                               double d=550;
                                                                          // lineSep = System.getProperty("line.separator");
                                                                          pw.print("Hello");
                                                                          //pw.print( lineSep );
                                                                          pw.print( d );
                                                                          pw.close();
                                  boolean det=temp.delete();
                                                 if(det)
                                                      System.out.println("File deleted");
                                                 else
                                                      System.out.println("File not deleted");
                                                 } catch (IOException ioe)
                                                                System.out.println( "Append IO error:" + ioe );
    My problem:
    1)
    I am not able to write to the file. I want to know, where i am going wrong.
    It is giving error message like
    "Canot resolve Symbol: temp,"
    But, FileWriter Constructor should accept a File type parameter.
    here temp is a file parameter.
    If i am not using file=new file();
    i can't delete the file after the use. i.e if i use
    PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter("cute.txt",true)));
    how can i delete cute.txt after the use?
    2)
    I am not able to write to the text file. file is created but, a blank file.
    "Hello" is not written into the text file.
    can anyone help me in this regard
    Thanks in advance
    Ashvini

    Thank you Ram,
    But, i want to create a text file in Append mode.
    for that i used
    FileWriter fos = new FileWriter(temp,true); But, it is not accepting FileWriter constructor in
    this format. if i use
    FileWriter fos = new
    FileWriter("c:/ash/cute.txt",true); it works fine. !!!!!Here's the javadoc
    public FileWriter(File file,
    boolean append)
    throws IOExceptionConstructs a FileWriter object given a File object. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
    Parameters:
    file - a File object to write to
    append - if true, then bytes will be written to the end of the file rather than the beginning
    Throws:
    IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    Since:
    1.4
    Are you using jdk.13 or lower ?
    >
    ONe more doubt, Does flush method deletes a file?
    if not, then i need to use
    File temp=new File("c:/ash/cute.txt");
    FileWriter fos = new FileWriter(temp,true); //which
    is again a problem
    if(temp.delete())
    out.println("File is deleted");
    }I don't know whether i am taking it wrong ! or
    anything wrong with my coding ! but, after creating
    and writing data into a text file. I must delete it
    as it contains confidential informations.
    Regards,
    Thanks.'flush' writes to a file immediately. Else you should explicitly call 'flush' to write contents from buffer to underlying source.
    javadoc again
    PrintWriter
    public PrintWriter(Writer out,
    boolean autoFlush)Create a new PrintWriter.
    Parameters:
    out - A character-output stream
    autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
    cheers,
    ram.
    Question; What do you gain by opening a file, writing to it and deleting it in the same program ?

  • How to get custom field value in vbkd table using "SD_SALESDOCUMENT_CREATE" bapi

    Hi Experts,
    Need your help . In one program Iam using SD_SALESDOCUMENT_CREATE bapi .
    i/p for my report is am excel.
    excel is having  below formatt.
    To create salesdoc we are using SD_SALESDOC_CREATE bapi.
    but After execution of the program we are unable to find the ZZFV_SBCNT (which is custom  field) in VBKD w.r.t salesdocument.
    Need your help what we need to do to reflect the value in vbkd table.
    Here temp will contains the data from excel
    1)
    FORM f_move_header_data .
       wg_header-doc_type            = wg_temp-auart .                   "Order type
       wg_header-sales_org           = wg_temp-vkorg .                   "Sales Organization
       wg_header-distr_chan          = wg_temp-vtweg .                   "Distribution Channel
       wg_header-division            = wg_temp-spart.                    "Division
       wg_header-sales_off           = wg_temp-vkbur .                   "Sales Office
       wg_header-sales_grp           = wg_temp-vkgrp .                   "Sales Group
       wg_header-purch_no_c          = wg_temp-bstnk .                   "Customer purchase order number
       wg_header-pymt_meth           = wg_temp-zlsch  .                  "Payment Method
       wg_header-zzychan_role        = wg_temp-zzychan_role_i.           "Channel Role
       wg_header-zzysub_role         = wg_temp-zzysub_role  .            "Submitter Role
       wg_header-zzy_inv_for_opt     = wg_temp-zzinv_format  .           "Invoice Format Optio
       wg_header-ord_reason          = wg_temp-augru  .                  "Order Reason Code
       wg_header-bill_block          = wg_temp-faksp.                    "Billing Block
       wg_headerx-doc_type            = c_set .                   "Order type
       wg_headerx-sales_org           = c_set .                   "Sales Organization
       wg_headerx-distr_chan          = c_set .                   "Distribution Channel
       wg_headerx-division            = c_set.                    "Division
       wg_headerx-sales_off           = c_set .                   "Sales Office
       wg_headerx-sales_grp           = c_set .                   "Sales Group
       wg_headerx-purch_no_c          = c_set .                   "Customer purchase order number
       wg_headerx-pymt_meth           = c_set  .                  "Payment Method
       wg_headerx-zzychan_role        = c_set.                    "Channel Role
       wg_headerx-zzysub_role         = c_set .                   "Submitter Role
       wg_headerx-zzy_inv_for_opt     = c_set .                   "Invoice Format Option
       wg_headerx-ord_reason          = c_set .                   "Order Reason Code
       wg_headerx-bill_block           = c_set.                    "Billing Block
    ENDFORM.                    " F_MOVE_HEADER_DATA
    2)
    FORM f_move_item_data .
       wg_item-itm_number          =   g_itmnumber.                              "Item number
       wg_item-material            =   wg_process-matnr .                        "Material
       wg_item-target_qty          =   wg_process-target_qty.                    "Targeted Qty
       wg_item-item_categ          =   wg_process-pstyv.                         "Sales document item category
       wg_item-zzylegal_i          =   wg_process-zzlegal.                       "Legal Contract
    **********Added this line for vbkd-ZZFV_SBCNT****************************
       wg_item-zzfv_sbcnt          = wg_process-zzfv_sbcnt.      
    APPEND wg_item TO i_item.
    wg_itemx-material            =   c_set .                        "Material
       wg_itemx-target_qty          =   c_set.                         "Targeted Qty
       wg_itemx-item_categ          =   c_set.                         "Sales document item category
       wg_itemx-zzylegal_i          =   c_set.                         "Legal Contract
       wg_itemx-zzsteady_date       =   c_set .                        "Amortization Start Date
       wg_itemx-zzsteady_end_dat    =   c_set.                         "Amortization Stop Date
    **********Added this line for vbkd-ZZFV_SBCNT****************************
       wg_itemx-ZZFV_SBCNt     =   c_set.   "
       APPEND wg_itemx TO i_itemx.
       CLEAR : wg_itemx. 
    endform. 
    3)           
    FORM f_move_head_ext
    wg_extension-structure   = c_ext_vbak.
       wg_ext_vbak-zzinv_format = wg_temp-zzinv_format.
    wg_ext_vbak-zzychan_role = wg_temp-zzychan_role_i.
       wg_ext_vbak-zzysub_role  = wg_temp-zzysub_role.
       wg_extension+30 = wg_ext_vbak.
    APPEND wg_extension to i_extension.
    CLEAR wg_extension.
       wg_extensionx-structure =  c_ext_vbakx.
       wg_ext_vbakx-zzinv_format = c_set.
      wg_ext_vbakx-zzlegal      = c_set.
       wg_ext_vbakx-zzychan_role = c_set.
       wg_ext_vbakx-zzysub_role  = c_set.
       wg_extensionx+30 = wg_ext_vbakx.
       APPEND wg_extensionx TO i_extensionx.
       CLEAR wg_extensionx.
    ENDFORM.                    " F_MOVE_HEAD_EXT
    *&      Form  F_MOVE_ITEM_EXT
    *       Item Extension
    4)
    FORM f_move_item_ext .
    * Structure for BAPI parameter Extension
       wg_extension-structure = c_ext_vbap.
       wg_ext_vbap-posnr      = g_itmnumber.
       wg_ext_vbap-zzsteady_date       =   wg_process-zzsteady_date .                 "Amortization Start Date
       wg_ext_vbap-zzsteady_end_dat    =   wg_process-zzsteady_end_dat.               "Amortization Stop Date
       wg_ext_vbap-zzlegal             =   wg_process-zzlegal.                        "Legal Contract
       wg_extension+30 = wg_ext_vbap.
    APPEND wg_extension to i_extension.
    * Structure for BAPI parameter Extension - Update Indicator Fields
       wg_extensionx-structure =  c_ext_vbapx.
       wg_ext_vbapx-posnr = g_itmnumber.
       wg_ext_vbapx-zzsteady_date       =   c_set .
       wg_ext_vbapx-zzsteady_end_dat    =   c_set.
    *  wg_ext_vbapx-zzlegal             =   c_set.
    *wg_process-zzfv_sbcnt = c_set.
       wg_extensionx+30 = wg_ext_vbapx.
       APPEND wg_extensionx TO i_extensionx.
       CLEAR wg_extensionx.
    and bapi calling is like below.
    CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
         EXPORTING
           sales_header_in       = wg_header
           sales_header_inx      = wg_headerx
           logic_switch          = wg_logic_switch
           business_object       = fp_bus_obj
           status_buffer_refresh = 'X'
         IMPORTING
           salesdocument_ex      = g_sorder
         TABLES
          return                = i_return
           sales_items_in        = i_item
           sales_items_inx       = i_itemx
           sales_partners        = i_partner
           sales_conditions_in   = i_cond
           sales_conditions_inx  = i_condx
           sales_text            = i_text
           extensionin           = i_extension
         extensionex           = i_extensionx.
    still we are not getting ZZFV_SBCNT value in VBKD table w.r.t created salesdoc(g_sorder)
    Please help me from this issue.
    Thank You..

    Hi,
    Please let me know how to add custom fields in the characteristic list, My clients wants department and profit center grouping.
    Please tell me how to solve it..
    Thanks & Regards,
    Reena..

  • Use of BApi

    Wat is the use of bapi .in sap...
    thx.
    regurds .
    nainesh.

    hi,
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    just refer to the link below
    http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Also refer to the following links..
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    Example Code
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    Bdc to Bapi
    The steps to be followed are :
    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
    2. Create a Z program and call the BAPi (same as a Funtion module call).
    2. Now, if you see this BAPi, it has
    -> Importing structures.
    eg: SALESDOCUMENT: this will take the Sales order header data as input.
    -> Tables parameters:
    eg: ORDER_ITEM_IN: this will take the line item data as input.
    Note :
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add
    Example
    1. Delete the whole order
    2. Delete order items
    3. Change the order
    4. Change the configuration
    Notes
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
    For further details... refer to the Function Module documentation for the BAPi.
    Bapi to VB(Visual Basic)
    Long back I had used the following flow structure to acheive the same.
    Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
    my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
    You need to have com4abap.exe
    If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
    else refer OSS note 419822 for installation of com4abap
    after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
    for setting up com4abap and rfc destination please refer to the documentation for com4abap.
    Invoke NEW DCOM session
    call function 'BEGIN_COM_SESSION'
    exporting
    service_dest = service_dest "(this will be a RFC destination created in SM59)
    importing
    worker_dest = worker_dest
    exceptions
    connect_to_dcom_service_failed = 1
    connect_to_dcom_worker_failed = 2
    others = 3.
    call function 'create_com_instance' destination worker_dest
    exporting
    clsid = g_c_clsid
    typelib = g_c_typelib
    importing
    instid = g_f_oid
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    call function 'com_invoke' destination worker_dest
    exporting
    %instid = g_f_oid
    %method = 'UpdatePDF'
    sntemp = g_v_const_filent
    snsysid = sy-sysid
    snflag = 'N'
    tables
    rssaptable = g_t_pdfdetail1
    %return = g_t_pdfdetail1 "t_test
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    then close the com session , using
    FM delete_com_instance
    FM END_COM_SESSION
    cheers,
    Hema.

  • How to create a sales activity using BAPI_BPCONTACT_CREATEFROMDATA 170183

    Hello everyone ,
    Please help me to create a sales activity using this BAPI's  :
    BAPI_BPCONTACT_CREATEFROMDATA
    BAPI_BPCONTACT_SAVEFROMMEMORY
    BAPI_TRANSACTION_COMMIT
    Ref. OSS 170183
    advance thank for all
    Halley

    Here is an example.  Values and partners depend on your config of course.  I'm assuming you can define the local variables - the code is too long for me to post it.
    * BAPI field initialization
      LS_GENERALDATA-ACTIVITY_TYPE    = 'Your value'.
      LS_GENERALDATA-SALESORG         = 'Your value'.
      LS_GENERALDATA-DISTR_CHAN       = 'Your value'.
      LS_GENERALDATA-DIVISION         = 'Your value'.
      LS_GENERALDATA-FROM_DATE        =  SY-DATUM.
      LS_GENERALDATA-TO_DATE          =  SY-DATUM.
      LS_GENERALDATA-FROM_TIME        =  SY-UZEIT.
      LS_GENERALDATA-TO_TIME          =  SY-UZEIT.
      LS_GENERALDATA-REASON           = 'Your value'.
      LS_GENERALDATA-RESULT           = 'Your value'.
      LS_GENERALDATA-STATE            = '0'.
      LS_GENERALDATA-ACTIVITY_COMMENT = 'Your value'.
      LS_GENERALDATA-PARTN_ROLE       = 'AG'.
      LS_GENERALDATA-PARTN_ID         = 'Sold-to account number'.
      APPEND LS_GENERALDATA TO LT_GENERALDATA.
      LS_BUSINESSPARTNER-ITM_NUMBER   = '000000'.
      LS_BUSINESSPARTNER-PARTN_ROLE   = 'AG'.
      LS_BUSINESSPARTNER-PARTN_ID     =  'Sold-to Account'.
      APPEND LS_BUSINESSPARTNER TO LT_BUSINESSPARTNER.
    * MRL notes
      LS_NOTES-TDFORMAT = '*'.
      LS_NOTES-TDLINE = 'Your long comments text here'.
      LS_TEXT-TEXT_ID   = '0001'.
      LS_TEXT-FUNCTION  = '009'.
      LS_TEXT-LANGU     =  SY-LANGU.
      LS_TEXT-TEXT_LINE =  LS_NOTES.
      APPEND LS_TEXT TO LT_TEXT.
      CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
        IMPORTING
          OWN_LOGICAL_SYSTEM             = LV_SYS
        EXCEPTIONS
          OWN_LOGICAL_SYSTEM_NOT_DEFINED = 1
          OTHERS                         = 2.
    * Call BAPI
      CALL FUNCTION 'BAPI_BPCONTACT_CREATEFROMDATA'
        EXPORTING
          SENDER          = LV_SYS
        TABLES
          GENERALDATA     = LT_GENERALDATA
          BUSINESSPARTNER = LT_BUSINESSPARTNER
          TEXT            = LT_TEXT
          RETURN          = LT_RETURN.
    * Check for error
      LOOP AT LT_RETURN INTO LS_RETURN WHERE TYPE CA 'AEX'.
        EXIT.
      ENDLOOP.
      IF SY-SUBRC NE 0.
        REFRESH LT_RETURN.
        CALL FUNCTION 'BAPI_BPCONTACT_SAVEFROMMEMORY'
          TABLES
            SALESACTIVITYIDOUT = LT_SALESACTIVITYIDOUT
            RETURN             = LT_RETURN.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ENDIF.

Maybe you are looking for

  • I want only one apple ID for all my devices

    I have an apple ID and so does my wife.  Between the four family members we 8 plus apple devices.  I want to put everything on hers and just have one.  Mine has the least amount of music and apps.  Can it be done? How do you do it without losing anyt

  • "Invalid Character" error when executing a 13KB query with ADO

    Hello I want to execute a query using an ADO Recordset using the Open method. When calling this method, an ORA-911 "Invalid Character" raises. I can say that the SQL runs fine, because using the SQL*Plus utility it works. I have a 11g client installe

  • Creating a user-defined field in VL06

    Dear all , Please guide me how to add few user defined fields in the output list of standard VL06 transaction code - (Delivery Monitor Report - WS_DELIVERY_MONITOR) - I have to add in the option of 'List Outbound deliveries' - Pls revert. Thanks in A

  • How do I remove unwanted applications in 10.7 ?

    Sorry but I've recently migrated from system 9.0 to  OS 10.7, with a brief interval at 10.4. My question is, is there no way to remove 'core' applications like Safari, AppsStore, PhotoBooth etc. NONE of which I want or need ... I have favoured applic

  • Burning songs in a particular order

    How do I burn songs in a particular order? I tried to burn all the songs by one artist, but it did it by albums - I wanted to hit random on my cd player and it randomly play the 100 songs, not by album. And how do I create one with a bunch of differe