BAPI for transaction FB01 with account posting key

Hi,
I have to use a BAPI for registering Invoices into the FI module through the FB01 transaction.
I am trying to use the standard BAPI: BAPI_ACC_DOCUMENT_POST
The problem is that this BAPI does not manage the account posting key (field BSCHL).
Could anyone provide help?
Thank you very much in advance.

It is happening here in the BAPI
CALL FUNCTION 'FI_GET_POSTING_KEY'
         EXPORTING
              i_ktosl       = gs_accit-ktosl
         IMPORTING
              e_bschs       = ld_bschs
              e_bschh       = ld_bschh
              e_umskz       = ld_umskz
         EXCEPTIONS
              error_message = 1.
As max pointed out, it is dependent on the transaction key(KTOSL).
Srinivas

Similar Messages

  • BAPI for purchase requisition with account assingment

    Dear all,
    We have third party scenario, so while creating sales order it has to create purchase requisition.our functional consultant they configured for service po .
    If any body help me

    Hi,
    Hope this link will help you http://help.sap.com/saphelp_46c/helpdata/en/7c/3ce3b765ba11d395fe00a0c94260a5/content.htm
    Regards,
    Pravin

  • Account posting keys involves for process of third party order

    hi
        pls tell me the process of third party order and whos account stock will be debited and tell me the account posting keys involves in this process and how it operates
    regards
    Ram
    Edited by: Ian Wong on Aug 13, 2008 7:06 PM

    THIRD PARTY SCENARIO
    In third-party order processing, your company does not deliver the items requested by a customer. Instead, you pass the order along to a third-party vendor who then ships the goods directly to the customer and bills you. A sales order may consist partly or wholly of third-party items. Occasionally, you may need to let a vendor deliver items you would normally deliver yourself.
    Process Flow
    The processing of third-party orders is controlled via material types. Material types define whether a material is produced only internally, can be ordered only from third-party vendors, or whether both are possible. For example, a material that is defined as a trading good can only be ordered from a third-party vendor. However, if you manufacture your own finished products, you may also want, from time to time, to be able to order the same type of product from other vendors.
    Processing Third-Party Orders in Sales
    Third-party items can be created automatically by the system, depending on how your system is set. However, you can also change a standard item to a third-party item during sales processing manually.
    Automatic third-party order processing
    If a material is always delivered from one or more third-party vendors, you can specify in the material master that the material is a third-party item. During subsequent sales order processing, the system automatically determines the appropriate item category for a third-party item: TAS. To specify a material as a third-party item, enter BANS in the Item category group field in the Sales 2 screen of the material master record.
    Manual third-party order processing
    In the case of a material that you normally deliver yourself but occasionally need to order from a third-party vendor, you can overwrite the item category during sales order processing. For a material that you normally deliver yourself, you specify the item category group NORM in the material master.
    If, as an exception, you use a third-party material, change the entry TAN to TAS in the ItCa field when processing the sales document. The item is then processed as third-party item.
    If address data for the ship-to party is changed in the sales order in third-party business transactions, the changed data will automatically be passed on to purchase requisition and also to the purchase order ,if one already exists. In the purchase order, you can display the address data for the ship-to party in the attributes for the item.
    You can only change the address data for the ship-to party in the sales order for third-party business transactions, and not in the purchase order.
    Processing Third-Party Orders in Purchasing
    When you save a sales order that contains one or more third-party items, the system automatically creates a purchase requisition in Purchasing. Each third-party item in a sales order automatically generates a corresponding purchase requisition item. During creation of the requisition, the system automatically determines a vendor for each requisition item. If a sales order item has more than one schedule line, the system creates a purchase requisition item for each schedule line.
    Purchase orders are created from purchase requisitions in the usual way. For more information about creating purchase orders, see the Purchasing documentation. During creation of the purchase order, the system automatically copies the delivery address of your customer from the corresponding sales order. In a sales order, you can enter purchase order texts for each third-party item. When you create the corresponding purchase order, the texts are automatically copied into the purchase order. The number of the purchase order appears in the document flow information of the sales order.
    All changes made in the purchase order are automatically made in the sales order as well. For example, if the vendor confirms quantities and delivery dates different from those you request and enters them in the purchase order, the revised data is automatically copied into the sales order
    You process third-party items by creating a normal sales order. In overview for the order, you can then overwrite the default item category (TAN in the standard system) with the special item category for third-party items: TAS
    Billing Third-Party Orders
    If relevance for billing indicator for the item category has been set to B (relevant for order-related billing on the basis of the order quantity) in Customizing, the system includes the order in the billing due list immediately. If, however, the indicator has been set to F (relevant to order-related billing on the basis of the invoice quantity), the system does not include the order in the billing due list until an invoice from the vendor has been received and processed by the purchasing department. In the standard system, item category TAS (third-party order processing) has been given billing-relevance indicator F.
    In the first case, the third-party order is considered to be completely billed only when the invoiced quantity equals the order quantity of the sales order item. In the second case, each time a vendor invoice is received, a customer invoice is created for the quantity in the vendor invoice and the order is considered to be fully invoiced until the next vendor invoice is received.
    If you have activated billing-relevance indicator F for item categories in Customizing, billing can refer to the goods receipt quantity instead of the incoming invoice quantity.
    You can control whether the invoice receipt quantity or the quantity of goods received is relevant for billing in Customizing for copying control for billing at item level.
    FOR YOUR PROCESS Individual Purchase Orders WELL GIVE THE RIGHT SOLUTION
    Individual purchase orders are used when your customer orders goods from you that are not in stock and must be ordered from one or more external vendors.
    Process Flow
    During sales order entry, the system automatically creates a purchase requisition item. The purchasing department creates a purchase order based on the requisition and the vendor ships the goods directly to you (unlike third party order processing, where the vendor ships directly to your customer). You then ship the goods to your customer. While the goods are part of your inventory, you manage them as part of the sales order stock. Sales order stock consists of stock that is assigned to specific sales orders and cannot be used for other purposes.
    Goods receipt will be posted when ever the vendor ships the goods to our customer.
    We will do this transaction in SAP using MIGO.
    Invoice receipt is done when the Vendor sends us the invoice.. ( I.e Billing ).
    It can be done using MIRO.
    THe above two steps are standard and manual. There are many other ways that the actual process can happen. If the client follows EDI standards then the Goods receipt and Invoice receipt can be done through IDOCs automatically.
    Process Flow for 3rd Party Sales
    Customize the third party sales in summary:
    Prerequisites for 3rd party sales,
    Purchasing org,
    purchasing group,
    assign the Purchase org to company code
    assign Purchase org to plant,
    should not maintain the stock in material, it should be trading goods,
    1. Create Vendor XK01
    2. Create Material – Material Type as "Trading Goods". Item category group as "BANS".
    3. Assign Item Category TAS to Order type that you are going to use.
    4. A sale order is created and when saved a PR is generated at the background
    5. With reference to SO a PO is created (ME21N). The company raises PO to the vendor.
    6. Vendor delivers the goods and raises bill to company. MM receives the invoice MIRO
    7. Goods receipt MIGO
    8. Goods issue
    9. The item cat TAS or Schedule line cat CS is not relevant for delivery which is evident from the config and, therefore, there is no delivery process attached in the whole process of Third party sales.
    10. Billing *--
    SD - 3rd party sales order Create Sales Order
    VA01
    Order Type
    Sales org, distr chnl, div
    Enter
    Sold to
    PO #
    Material
    Quantity
    Enter
    Save
    SD - 3rd party sales order View the PR that is created with a third party sales order
    VA01
    Order Number
    Goto Item Overview
    Item ->Schedule Item
    SD - 3rd party sales order View the PR that is created
    ME52N
    Key in the PR number
    Save
    SD - 3rd party sales order Assign the PR to the vendor and create PO
    ME57
    Key in the PR number
    Toggle the "Assigned Purchase Requisition"
    Execute
    Check the box next to the material
    Assign Automatically button
    Click on "Assignments" button
    Click on "Process assignment"
    The "Process Assignment Create PO" box , enter
    Drag the PR and drop in the shopping basket
    Save
    SD - 3rd party sales order Receive Goods
    MIGO_GR
    PO Number
    DN Number
    Batch tab , click on classification
    Serial Numbers tab
    Date of Production
    Flag Item OK
    Check, just in case
    Post
    Save
    SD - 3rd party sales order Create Invoice
    MIRO
    Invoice Date
    Look for the PO , state the vendor and the Material
    Check the box
    Click on "Copy"
    Purchase Order Number (bottom half of the screen)
    Amount
    State the baseline date
    Simulate & Post
    Invoice Number
    *Invoice blocked due to date variance
    SD - 3rd party sales order Create a delivery order
    VL01N
    In the order screen , go to the menu Sales Document , select "Deliver"
    Go to "picking" tab
    State the qty and save
    SD - 3rd party sales order Create a billing document
    VF01
    Ensure that the delivery document is correct in the
    Enter
    Go to edit -> Log
    Save
    Third party order processing is as follows:
    Assume three companies X, Y and Z
    X - The company,
    y - The customer
    Z - Vendor
    When ever X gets a PO from Y to supply some goods, X has an option of either manufacturing those goods or procuring those goods.
    If he is procuring the goods, there are two methods that are generally followed:
    Method 1) After receiving the PO from Y, X creates a sales order against Y.
    Now at the same time he also creates a PO to a vendor Z to produce the goods
    Z produces the goods and supplies to X
    X receives the goods from Z
    Then X delivers the same goods to Y.
    After that X invoices Y and Z invoices X.
    Note : Here there is no direct/ Indirect relation between Z and Y.
    This process is known as Trading Process. and the Material here is created with Material type HAWA.
    The other method is a Third party order processing method:
    Here the glaring difference is that instead of Z supplying the material to X and X in turn supplying the same material to Y.
    X authorizes Z to supply the material to Y on his behalf and notify him once the delivery is complete.
    Now Z supplies the material to Y and acknowledges the same to X.
    Z will send a copy of delivery acknowledgement and invoice to X.
    After receiving the delivery confirmation and invoice from Z, X has to verify the invoice and this process is known as invoice verification and is done in SAP through Tcode MIRO.
    The next step for X is to create an invoice and submit to Y
    Only after the invoice verification document is posted then only X can create an invoice for Y.
    This is the business flow that is followed for third party order configuration.
    There are few steps that have to be configured to enable the system to function as mentioned above.
    Step1)
    If you are always following a third party process for a material then you have to create the material using item category group BANS.
    The procurement type should be marked as External procurement (F) in MRP 2 view of the material master record.
    if you are not always allowing third party order processing then u can create a material master record with item category group as NORM and the procurement type should be marked as ( X) meaning both types of procurement ( in house manufacturing and external procurement).
    Step 2)
    the item category in the order should be manually changed as TAS.
    For that you need to configure the item category determination
    Order type + item cat Group + Usage + High level = Item cat + Manual item cat
    OR + NORM + + = TAN + TAS
    OR + BANS + + = TAS
    Step 3)
    make sure that during the item category configuration for TAS you need to mark relevant for billing indicator as F
    step 4)
    The schedule line category for this type should be CS.
    make sure that you mark subsequent type as NB - purchase requisition in this schedule line category as this will trigger the purchase requisition order immediately after the creation of the sales order and the PO to vendor is created against this purchase requisition.
    Award if Helpful,
    Regards
    Priyanka.P

  • New transaction key with the posting key 24 and 34

    Hi,
    i want to create a new transaction key with the posting key 24 and 34.
    the corresponding table is T030B.
    but what is the Tcode/ IMG path to create it?
    Regards,
    Swetha

    Hi,
    Go to FBKP. Click on  Automatic Postings.
    Suppose you want to see the Exchange Rate diff. then click on it. You will see the transaction. Suppose KDB. Then double click on it. Now click on posting keys. The same will be defined in the table which is given by you.
    Regards,
    Jigar

  • Background FI Posting with clearing, posting key control, etc - How?

    I have the requirement to post FI documents with clearing, with defined posting keys, where some of the fields come from file, some of them defaulted. It should happen in the background.
    I used BAPI BAPI_ACC_DOCUMENT_POST. I had the posting key problem, however with Badi ACC_DOCUMENT using EXTENSION2 I managed to generate the FI docs with the right posting keys.
    Now I have problem with clearing. It seems with this BAPI it's not possible to trigger clearing.
    I found some threads about FM 'POSTING_INTERFACE_CLEARING', however I don't think I can have any influence on the posting key and generated line items. So it doesn't help to me.
    FM BAPI_PAYM_ITEM_POST_CLEARING is for payments.
    Using program RFBIBL00 would be difficult, as far as I can see it can only use file in the specific format as an input.
    I should read my file and generate another file and call this program. This wouldn't be really the best approach.
    In this moment the only solution I can think of is transaction recorder/call transaction approach. Unfortunately this solution would be really release-customizing dependent and not performance-optimized.
    Any other idea?
    Thanks in advance,
    Peter

    Hi Rob,
    Thanks for your answer.
    In one of the sap standard batch program I found FM FI_PSO_DOC_DIRECT_INPUT. I'll give a try, it might help also.
    Best regards,
    Peter

  • BAPI for Transaction VA01?

    How to Develope an interface program to upload the sales order data from legacy system to SAP using BAPI for Transaction VA01.Explain me clearly?

    VA01:
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_SALESORDER_CREATEFROMDAT2
    steps for bapi creation
    STEP 1 - Define a structures for the BAPI
    In this step a structures for the parameters and tables of the function module used for the BAPI are defined.
    Use Data type -> Structure
    Define the following structures:
    ZBAPI_ORDER_STATUS_IMPORT which contains the following fields:
    ORDERID Order number (Keyfield)
    SPRAS Language
    ExcludeInactive - Checkbox - Exclude inactive status
    ZBAPISTAT:
    STEP 2 - Write Function Module
    Important notes:
    Each BAPI must have its own function group.
    Under the attributes tab remember to select Processing Type Remote Enabled module, otherwise the function module cannot be invoked via RFC and used as a BAPI
    Import/Export parameters can only be BY VALUE for an RFC enabled function module
    We are only creating one BAPI in this example, but you can create related BAPIs in the same function pool, so they will be able to share global data.
    Code
    Notes:
    The subroutine SET_RETURN_MESSAGE is a standard routine used for BAPIs that use the BAPIRETURN structure
    In form Z_BAPI_GET_ORDER_SYSTEM_STATUS there is a test IF 1 = 2. If the test is true a message is displayed. The condition will obviously never be true, and we will never want to display a message in a BAPI. The reason why it is included is, that it create a reference for the message, so that the WHERE USED functionality can be used for the message. This is the SAP standard way to handle it, copied from the Company Code GetList BAPI.
    INCLUDE LZBAPISTATUSUXX
      THIS FILE IS GENERATED BY THE FUNCTION LIBRARY.             *
      NEVER CHANGE IT MANUALLY, PLEASE!                           *
    INCLUDE LZBAPISTATUSU02.
                        "Z_BAPI_GET_ORDER_SYSTEM_STATUS
    INCLUDE LZBAPISTATUSTOP - Global data
    FUNCTION-POOL ZBAPISTATUS.                  "MESSAGE-ID Z3
    Types:
      begin of Type_tj02t,
        istat  like tj02t-istat,
        txt04  like tj02t-txt04,
        txt30  like tj02t-txt30,
      end of type_tj02t.
    DATA:
    Declarations for TABLE parameter
      T_BAPISTAT like ZBAPISTAT occurs 0,
      G_BAPISTAT like ZBAPISTAT,
    Table for object texts
      t_tj02t    type type_tj02t occurs 0,
      g_tj02t    type type_tj02t.
    Structure for return messages
    DATA:
      BEGIN OF MESSAGE,
        MSGTY LIKE SY-MSGTY,
        MSGID LIKE SY-MSGID,
        MSGNO LIKE SY-MSGNO,
        MSGV1 LIKE SY-MSGV1,
        MSGV2 LIKE SY-MSGV2,
        MSGV3 LIKE SY-MSGV3,
        MSGV4 LIKE SY-MSGV4,
      END OF MESSAGE.
    INCLUDE LZBAPISTATUSF01 - Subroutines
    ***INCLUDE LZBAPISTATUSF01 .
    *&      Form  SET_RETURN_MESSAGE
    This routine is used for setting the BAPI return message.
    The routine is a standard routine for BAPIs that handles the message
    structure for the BAPIRETURN structure. It has been copied from the
    BAPI Company Code Getlist
         -->P_MESSAGE  text
         <--P_RETURN  text
    form SET_RETURN_MESSAGE USING    VALUE(P_MESSAGE)   LIKE MESSAGE
                            CHANGING P_RETURN  LIKE BAPIRETURN.
      CHECK NOT MESSAGE IS INITIAL.
      CALL FUNCTION 'BALW_BAPIRETURN_GET'
           EXPORTING
                TYPE       = P_MESSAGE-MSGTY
                CL         = P_MESSAGE-MSGID
                NUMBER     = P_MESSAGE-MSGNO
                PAR1       = P_MESSAGE-MSGV1
                PAR2       = P_MESSAGE-MSGV2
                PAR3       = P_MESSAGE-MSGV3
                PAR4       = P_MESSAGE-MSGV4
             LOG_NO     = ' '
             LOG_MSG_NO = ' '
           IMPORTING
                BAPIRETURN = P_RETURN
           EXCEPTIONS
                OTHERS     = 1.
    endform.                    " SET_RETURN_MESSAGE
    FUNCTION Z_BAPI_GET_ORDER_STATUS
    FUNCTION z_bapi_get_order_system_status.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(I_AUFNR) TYPE  AUFNR
    *"     VALUE(I_SPRAS) TYPE  SPRAS DEFAULT SY-LANGU
    *"     VALUE(I_EXCLUDEINACTIVE) TYPE  CHAR1 OPTIONAL
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRETURN
    *"  TABLES
    *"      T_BAPISTAT STRUCTURE  ZBAPISTAT
    DATA:
       l_aufnr LIKE afko-aufnr,
       l_objnr LIKE jest-objnr.
    Check if order exists
    SELECT SINGLE aufnr
        FROM afko
        INTO  l_aufnr
        WHERE aufnr = BAPI_ORDER_STATUS_IMPORT-orderid.
      IF sy-subrc NE 0.
        CLEAR message.
        message-msgty = 'E'.
        message-msgid = 'Z3'.
        message-msgno = '000'.
        message-msgv1 = BAPI_ORDER_STATUS_IMPORT-orderid.
        PERFORM set_return_message USING    message
                                   CHANGING return.
        IF 1 = 2.
        The only reason to include this statement, that will obviously
        never execute, is that it will create a referecence so that you
        can find out where a particular message is being used. This
        functionality is used by the BAPIs programmed by SAP
          MESSAGE e000(z3).
        ENDIF.
      ENDIF.
      CHECK return IS INITIAL.
    Read order status
    CONCATENATE 'OR' BAPI_ORDER_STATUS_IMPORT-orderid INTO l_objnr.
      IF BAPI_ORDER_STATUS_IMPORT-i_excludeinactive = 'X'.
        SELECT objnr stat inact
          FROM  jest
          INTO  TABLE t_bapistat
          WHERE objnr = l_objnr AND
                inact  'X'.
      ELSE.
        SELECT objnr stat inact
          FROM  jest
          INTO  TABLE t_bapistat
          WHERE objnr = l_objnr.
      ENDIF.
      IF sy-subrc  0.
      No object status found
        CLEAR message.
        message-msgty = 'E'.
        message-msgid = 'Z3'.
        message-msgno = '001'.
        message-msgv1 = BAPI_ORDER_STATUS_IMPORT-orderid.
        PERFORM set_return_message USING    message
                                   CHANGING return.
        IF 1 = 2.
          MESSAGE e001(z3).
        ENDIF.
      ENDIF.
      CHECK return IS INITIAL.
    Read order status texts
      SELECT istat txt04 txt30
        FROM tj02t
        INTO TABLE t_tj02t
        FOR ALL ENTRIES IN t_bapistat
        WHERE istat = t_bapistat-stat AND
              spras = BAPI_ORDER_STATUS_IMPORT-i_spras.
      SORT t_tj02t BY istat.
      LOOP AT t_bapistat INTO g_bapistat.
        READ TABLE t_tj02t
          WITH KEY istat = g_bapistat-stat BINARY SEARCH
         INTO g_tj02t.
        IF sy-subrc = 0.
          MOVE:
            g_tj02t-txt04 TO g_bapistat-txt04,
            g_tj02t-txt30 TO g_bapistat-txt30.
          MODIFY t_bapistat FROM g_bapistat TRANSPORTING txt04 txt30.
        ENDIF.
    ENDLOOP.
    ENDFUNCTION.
    OBJNR like JEST-OBJNR
    STAT like JEST-STAT
    INACT like JEST-INACT
    TXT04 like TJ02T-TXT04
    TXT30 likeTJ02T-TXT30
    Important note:
    You will have to define a structure for every parameter in the BAPI. You cannot use the same structures used in existing applications because BAPI structures are frozen when BAPIs are released and then there are restrictions on changing them.
    STEP 3 - Create the API Method Using the BAPI WIZARD
    The BAPI wizard is used toTo expose the remote function module as a BAPI. The wizard will generate some additional code, so the function module is a valid method of the BOR. This allows the BAPi to be called as a workflow method in addition to be called by an outside program.
    Note: Each function module corresponds to a method in the BOR
    Go to the Business Object Builder SWO1.
    You can either create the new Object type as a subtype of an existing business object or create a new business object from scratch. In this example it would be obvious to create the Object type as a subtype of BUS2005 Production order. However, to illustrate how to create a new Object type from scratch, we will do this.
    In the Object/Interface type field write the name of the new Business Object: ZORDERSTAT. Press enter and fill in the additional fields necessary to create the object type.
    Supertype: Not relevant because we are creating our object from scratch
    Program. This is the name of the program where the wizard generates code for the Object type, NOT the function module we created earlier. The program name must not be the name of an existing program.
    Press enter and create the new business object. Note that when you create the business object a standard interface, an attribute ObjectType and the methods ExistenceCheck and Display are automatically generated. These cannot be changed !
    The next step is to add the Z_BAPI_GET_ORDER_STATUS method to the business object. Select Utilities -> API methods -> Add method and write the name of the function module in the dialog box. Next the dialog ox show below will be shown. This is the start screen of the BAPI wizard. Proceed with wizard by pressing the button.
    After you have finished the wizard, you will notice that the ZGetOrderStatus has been added to the business object:
    You can double-click on the method to see its properties. To use the business object you must change the Object type status to Implemented. Use menu Edit->Change releases status->Object type->To implemented. No you can test the object (Press F8).
    Note that the BAPI wizard has added a wrapper class for the function module so it can be sued as method in the business object. Choose menu Goto->Program to display the program:
              Implementation of object type ZORDERSTAT           *****
    INCLUDE <OBJECT>.
    BEGIN_DATA OBJECT. " Do not change.. DATA is generated
    only private members may be inserted into structure private
    DATA:
    " begin of private,
    "   to declare private attributes remove comments and
    "   insert private attributes here ...
    " end of private,
          KEY LIKE SWOTOBJID-OBJKEY.
    END_DATA OBJECT. " Do not change.. DATA is generated
    BEGIN_METHOD ZGETORDERSTATUS CHANGING CONTAINER.
    DATA:
          BAPIORDERSTATUSIMPORT LIKE ZBAPI_ORDER_STATUS_IMPORT,
          RETURN LIKE BAPIRETURN,
          TBAPISTAT LIKE ZBAPISTAT OCCURS 0.
      SWC_GET_ELEMENT CONTAINER 'BapiOrderStatusImport'
           BAPIORDERSTATUSIMPORT.
      SWC_GET_TABLE CONTAINER 'TBapistat' TBAPISTAT.
      CALL FUNCTION 'Z_BAPI_GET_ORDER_STATUS'
        EXPORTING
          BAPI_ORDER_STATUS_IMPORT = BAPIORDERSTATUSIMPORT
        IMPORTING
          RETURN = RETURN
        TABLES
          T_BAPISTAT = TBAPISTAT
        EXCEPTIONS
          OTHERS = 01.
      CASE SY-SUBRC.
        WHEN 0.            " OK
        WHEN OTHERS.       " to be implemented
      ENDCASE.
      SWC_SET_ELEMENT CONTAINER 'Return' RETURN.
      SWC_SET_TABLE CONTAINER 'TBapistat' TBAPISTAT.
    END_METHOD.
    STEP 4 - Final stepsWhen the Business object has been checked and the documentation created, the following steps must be carried out:
    Release the BAPI function module (in the Function Builder).
    Release the business object type (in the BOR ObjectType -> Change release status to -> Implemented ).
    Release the BAPI as a method in the BOR (Release the methods you has created - Set the cursor on the method then
    Edit -> Change release status -> Object type component -> To released )
    For potential write BAPIs: Release the IDoc and its segments
    You can now display the BAPI in the BAPI Explorer:
    for detailed expalnation
    http://www.erpgenie.com/abap/bapi/example.htm
    do reward if helpful

  • IDOC/ BAPI for transaction FB60

    Hi Experts,
    Can anybody tell me IDOC/ BAPI for transaction FB60 for document type (KR = Original Invoice).
    Thanks

    Hi Venkata,
    Please refer below code, this works similar to FB60.
    REPORT z_bapi_test.
    *REPORT acc_bapi_test_document .
    SELECTION-SCREEN BEGIN OF BLOCK bl01 .
    PARAMETERS:
    check_l RADIOBUTTON GROUP rb1,
    check_a DEFAULT 'X' RADIOBUTTON GROUP rb1,
    post RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
    rev_c RADIOBUTTON GROUP rb1,
    rev_p RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
    ref_key LIKE bapiache01-obj_key DEFAULT 'TEST000001BAPICALL',
    dest LIKE bdi_logsys-logsys DEFAULT ' '.
    SELECTION-SCREEN END OF BLOCK bl01 .
    DATA:
    gd_documentheader LIKE bapiache09,
    gd_customercpd LIKE bapiacpa09,
    gd_fica_hd LIKE bapiaccahd,
    it_accountreceivable LIKE TABLE OF bapiacar09 WITH HEADER LINE,
    it_accountgl LIKE TABLE OF bapiacgl09 WITH HEADER LINE,
    it_accounttax LIKE TABLE OF bapiactx09 WITH HEADER LINE,
    it_criteria LIKE TABLE OF bapiackec9 WITH HEADER LINE,
    it_valuefield LIKE TABLE OF bapiackev9 WITH HEADER LINE,
    it_currencyamount LIKE TABLE OF bapiaccr09 WITH HEADER LINE,
    it_return LIKE TABLE OF bapiret2 WITH HEADER LINE,
    it_receivers LIKE TABLE OF bdi_logsys WITH HEADER LINE,
    it_fica_it LIKE TABLE OF bapiaccait WITH HEADER LINE,
    it_accountpayable LIKE TABLE OF bapiacap09 WITH HEADER LINE,
    it_paymentcard LIKE TABLE OF bapiacpc09 WITH HEADER LINE,
    it_ext LIKE TABLE OF bapiacextc WITH HEADER LINE.
    it_re LIKE TABLE OF bapiacre09 WITH HEADER LINE,
    it_ext2 LIKE TABLE OF bapiparex WITH HEADER LINE.
    PERFORM fill_internal_tables.
    IF check_l = 'X'.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
    DESTINATION dest
    EXPORTING
    documentheader = gd_documentheader
    customercpd = gd_customercpd
    contractheader = gd_fica_hd
    TABLES
    accountgl = it_accountgl
    accountreceivable = it_accountreceivable
    accountpayable = it_accountpayable
    accounttax = it_accounttax
    currencyamount = it_currencyamount
    criteria = it_criteria
    valuefield = it_valuefield
    extension1 = it_ext
    return = it_return
    paymentcard = it_paymentcard
    contractitem = it_fica_it.
    extension2 = it_ext2
    realestate = it_re.
    WRITE: / 'Result of check lines:'. "#EC NOTEXT
    PERFORM show_messages.
    ENDIF.
    IF check_a = 'X'.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
    DESTINATION dest
    EXPORTING
    documentheader = gd_documentheader
    customercpd = gd_customercpd
    contractheader = gd_fica_hd
    TABLES
    accountgl = it_accountgl
    accountreceivable = it_accountreceivable
    accountpayable = it_accountpayable
    accounttax = it_accounttax
    currencyamount = it_currencyamount
    criteria = it_criteria
    valuefield = it_valuefield
    extension1 = it_ext
    return = it_return
    paymentcard = it_paymentcard
    contractitem = it_fica_it.
    extension2 = it_ext2
    realestate = it_re.
    WRITE: / 'Result of check all:'. "#EC NOTEXT
    PERFORM show_messages.
    ENDIF.
    IF post = 'X'.
    DATA: l_type LIKE gd_documentheader-obj_type,
    l_key LIKE gd_documentheader-obj_key,
    l_sys LIKE gd_documentheader-obj_sys.
    IF dest = space OR
    dest = gd_documentheader-obj_sys.
    post synchron
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
    documentheader = gd_documentheader
    customercpd = gd_customercpd
    contractheader = gd_fica_hd
    IMPORTING
    obj_type = l_type
    obj_key = l_key
    obj_sys = l_sys
    TABLES
    accountgl = it_accountgl
    accountreceivable = it_accountreceivable
    accountpayable = it_accountpayable
    accounttax = it_accounttax
    currencyamount = it_currencyamount
    criteria = it_criteria
    valuefield = it_valuefield
    extension1 = it_ext
    return = it_return
    paymentcard = it_paymentcard
    contractitem = it_fica_it.
    extension2 = it_ext2
    realestate = it_re.
    WRITE: / 'Result of post:'. "#EC NOTEXT
    PERFORM show_messages.
    ELSE.
    create Idoc
    it_receivers-logsys = dest.
    APPEND it_receivers.
    CALL FUNCTION 'ALE_ACC_DOCUMENT_POST'
    EXPORTING
    documentheader = gd_documentheader
    customercpd = gd_customercpd
    contractheader = gd_fica_hd
    TABLES
    accountgl = it_accountgl
    accountreceivable = it_accountreceivable
    accountpayable = it_accountpayable
    accounttax = it_accounttax
    currencyamount = it_currencyamount
    criteria = it_criteria
    valuefield = it_valuefield
    extension1 = it_ext
    paymentcard = it_paymentcard
    contractitem = it_fica_it
    extension2 = it_ext2
    realestate = it_re
    receivers = it_receivers
    COMMUNICATION_DOCUMENTS* APPLICATION_OBJECTS EXCEPTIONS
    error_creating_idocs = 1
    OTHERS = 2 .
    IF sy-subrc = 0.
    WRITE: / 'IDoc created'. "#EC NOTEXT
    ELSE.
    WRITE: sy-msgid.
    ENDIF.
    ENDIF.
    ENDIF.
    IF rev_p = 'X' OR rev_c = 'X'.
    DATA: rev LIKE bapiacrev,
    rev_key LIKE ref_key.
    rev_key = ref_key.
    rev_key(1) = 'R'.
    rev-obj_type = gd_documentheader-obj_type.
    rev-obj_key = rev_key.
    rev-obj_sys = gd_documentheader-obj_sys.
    rev-obj_key_r = ref_key.
    IF rev_c IS INITIAL.
    IF dest = space OR
    dest = gd_documentheader-obj_sys.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_POST'
    EXPORTING
    reversal = rev
    bus_act = gd_documentheader-bus_act
    TABLES
    return = it_return.
    ELSE.
    it_receivers-logsys = dest.
    APPEND it_receivers.
    CALL FUNCTION 'ALE_ACC_DOCUMENT_REV_POST'
    EXPORTING
    reversal = rev
    busact = gd_documentheader-bus_act
    OBJ_TYPE = 'BUS6035'
    SERIAL_ID = '0'
    TABLES
    receivers = it_receivers
    COMMUNICATION_DOCUMENTS* APPLICATION_OBJECTS EXCEPTIONS
    error_creating_idocs = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    WRITE: / 'IDoc created'. "#EC NOTEXT
    ENDIF.
    ENDIF.
    ELSE.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_REV_CHECK'
    EXPORTING
    reversal = rev
    bus_act = gd_documentheader-bus_act
    TABLES
    return = it_return.
    ENDIF.
    WRITE: / 'Result of Reversal Posting:'. "#EC NOTEXT
    PERFORM show_messages.
    ENDIF.
    COMMIT WORK.
    Kindly close if it helps you.
    Regards
    Abhii...

  • BAPI for transaction MI10

    Hi Gurus,
    Can you please tell me if there is any BAPI for transaction MI10(post document,count and difference: initial screen).
    Is there any standard IDOC type for inventory management or any message type associated with inventory management IDoc.
    Thanks

    Hi,
       check with below BAPIs
    BAPI_MATPHYSINV_CHANGECOUNT Change count for particular items of a phys. inv. doc.
    BAPI_MATPHYSINV_COUNT Enter count for particular items of a phys. inv. doc.
    BAPI_MATPHYSINV_CREATE Create physical inventory document
    BAPI_MATPHYSINV_CREATE_MULT Create physical inventory document
    BAPI_MATPHYSINV_GETDETAIL Read items for a physical inventory document
    BAPI_MATPHYSINV_GETITEMS Read list of physical inventory documents with items
    BAPI_MATPHYSINV_GETLIST Read list of phys. inv. documents
    BAPI_MATPHYSINV_POSTDIFF Post differences for certain items in a phys. inv. document
    Thanks,
    Asit Purbey.

  • Payment Transaction check box in Posting Key configuration

    Hi all,
    Could you please enlighten me on the use of Payment transaction check box in posting key configuration screen.
    I would like to know what impact does it have if its checked and if unchecked.
    In F1 help its mentioned, Set this indicator in the posting keys for incoming payments, outgoing payments, payment differences (residual items) and payment clearing. - but I am need to know in which scenario this check box plays a role and its affect.
    Thanks,
    DSK

    Hi,
    Generally Payment Transaction checkbox will be checked for Payment Documents. Ex: PK -25 (Outgoing payment) and PK-35 (Incoming payment)
    Payment Transaction checkbox will be unchecked for Invoice Documents. Ex PK-01 (Sales Invoice) and PK-31 (Purchase Invoice)
    In this case, Default Payment Terms will be picked by system automatically at the time of invoice posting.
    Thanks
    Chandra

  • Need BAPI for Parking G/L Account

    Hi All,
    I need BAPI for Parking G/L account document.
    Please let me know.
    Regards
    R.Ragu
    Useful Answers will be rewarded.

    Hi Ragu.
    Try these:
    BAPI_GL_ACC_EXISTENCECHECK
    BAPI_GL_ACC_GETDETAIL
    BAPI_GL_ACC_GETLIST
    For further details GoTo->Transaction BAPI->Alphabetical->General Ledger Account.
    Good Luck & Regards
    Harsh
    Edited by: Harsh Dave on Jul 11, 2008 10:14 AM

  • Any BAPI for Transaction VF01??

    Hi Experts ,
    Is there any Bapi for transaction VF01.
    If it is then plz. do help me to use that one with coding .
    Regards,
    Rahul

    Hi,
    Check this sample code of creating the billing document using the bapi BAPI_BILLINGDOC_CREATEMULTIPLE.
    DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE.
    DATA: t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE.
    DATA: t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE.
    t_billing-salesorg = vbak-vkorg.
    t_billing-DISTR_CHAN = vbak-vtweg.
    t_billing-DIVISION = vbak-spart.
    t_billing-DOC_TYPE = vbak-auart.
    t_billing-ref_doc = vbak-vbeln.
    t_billing-ref_item = vbap-posnr.
    t_billing-doc_number = vbak-vbeln.
    t_billing-ITM_NUMBER = vbap-posnr.
    t_billing-ordbilltyp = 'BILLING TYPE'.
    t_billing-price_date = sy-datum.
    t_billing-ref_doc_ca = vbak-vbtyp.
    t_billing-sold_to = vbak-kunnr.
    t_billing-material = vbap-matnr.
    t_billing-plant = vbap-werks.
    APPEND t_billing.
    CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
    TABLES
    billingdatain = t_billing
    return = t_return
    success = t_success.
    commit work.
    <b>Reward points</b>
    Regards

  • Manual Bank Statement (One entry posted with wrong Posting Key)

    In The Manual Bank Statement, the user has posted one entry with wrong posting key, How can that be rectified? Or Is there anyway wherein the entire statement can be reversed?

    Hi,
    The standard document change rule will never allow to change the posting key irrespective of the transaction being used.
    You can use program RFEBKA96 to delete the statement so that you can post the same statement.
    If document generate with wrong posting key can be reversed through regular FB08
    Regards,
    Chintan Joshi

  • Bapi for transaction FB60

    Hi All,
    I need bapi which can create document for transaction FB60 and later we can do the commit explicitly. we need to upload
    *HEADER     *
    BESG-LIFNR, BKPF-BLDAT, BKPF-BUDAT, INVFO-WRBTR,
    BKPF-BUKRS, BKPF-WAERS, BKPF-XBLNR, BSEG-MWSKZ,
    BKPF-BKTXT, INVFO-ZFBDT, INVFO-ZTERM
    LINE ITEM
    BSEG-HKONT, BSEG-SGTXT, BSEG-WRBTR, BSEG-MWSKZ, BSEG-TXJCD, BSEG-KOSTL, BSEG-KSTRG,
    BSEG-MATNR, BSEG-MENGE, BSEG-MEINS
    i know one bapi BAPI_ACC_INVOICE_RECEIPT_POST but i am not able to pass the value of vendor as a header data on this bapi. please suggest.
    Thanks,
    Madhu

    I have one BAPI API_ACC_INVOICE_RECEIPT_POST, i think i hcan use this BAPI for my requirement but while posting the data i am getting errors :
    1. Required field AMT_BASE was not transferred in parameter  CURRENCYAMOUNT
    2. Required field ACCT_KEY was not transferred in parameter ACCOUNTTAX
    In the excel sheet these two fields data is not given, then how can i pass the values in these two fileds.
    Please reply,
    Thanks

  • Bapi for transaction FOB1

    Hi everyone,
    Is there a BAPI for transaction FOB1 ? I allready looked into some lists of BAPI's, but i'm not sure what to be looking for...
                   Thanks in advance...
                           Nuno

    Anyone ? Isn't this possible ? Do i have to do it with batch? If so, if i put the batch running in background, how can i caught the number of the documents created to print them on screen ?

  • Bapi for transaction va21

    hi!
    is there any bapi for transaction va21 creating qoutation?
    regards
    yifat

    Hi Yifat,
        There are two BAPI's to create Quotation.
    BAPI_QUOTATION_CREATEFROMDATA
    This BAPI has been released.
    BAPI_QUOTATION_CREATEFROMDATA2
    This BAPI has not been released yet.
    There is small problem when you use these two BAPI's they dont update the document flow (i.e) these BAPI's will allow you to create 'n' number quotations for a single Inquiry, which according to business is not allowed.
    You can do an alternate method, which you can use a BDC to create a Quotation and the updation part for that Quotation can be done with a BAPI 'BAPI_CUSTOMERQUOTATION_CHANGE'.
    Hope this might be useful.
    Regards,
    Tushar
    Reward points if found useful.

Maybe you are looking for

  • Family Sharing - Combining Accounts

    I have a family with a large collection of Apple devices. I have some questions about Family Sharing. I have read some of the documentation on the Family Sharing pages but it does not really answer my questions. Due to some legacy items, we have basi

  • Change creator id of purchase order ?

    Hello, I am working on SRM 5.0 , Extended classic scenario. In SRM, after creating a shopping cart, the creator id of the corresponding purchase order  is WF-BATCH (since WF-BATCH is the user system used in baground task ). We have a requirement wher

  • The use of clean-out orders

    Dear SDN Is it possible to have clean-out orders created automatically, without using campaign management? We do not use campaign management functionality, and the production runs clean-out orders between process orders. We would like to have system

  • Imovie is freezing up my entire computer when it gets to generating thumbnails.

    i have tried rebooting, but it won't let me close out of any other programs. is there any way to get out of this? thanks.

  • The server is not running  - archiver is unable...

    Archiver is unable to archive a redo log because the output device is full or unavailable. The instance is open. 1. Increase db_recovery_file_dest_size 2. Start full as backup database plus archivelog or start archive log backup than delete them. 3.