BAPI for Knvv text

Hi all,
I'd be greatful if anyone of you could guide me for the bapi, Is there is any bapi for knvv table text. In KNVV table we have four fields (VKBUR, VKGRP, KVGR1, KVGR2) and the related text we can get in table TVKBT TVGRT TVV1T TVV2T. plz tell me if there is any bapi where we just put these four fields and we can get related text ..
Thnks for ur help
Puneet

Hi,
Try it this way
DATA : IT_TVV1T TYPE TABLE OF TVV1T_KEY,
       WA_TVVIT TYPE TVV1T_KEY,
       ET_TVV1T TYPE TABLE OF TVV1T.
WA_TVVIT-SPRAS = 'E'.
WA_TVVIT-KVGR1 = '01'. "--> Pass your value here
APPEND WA_TVVIT TO IT_TVV1T.
CALL FUNCTION 'WB2_TVV1T_ARRAY_SELECT'
  TABLES
    IT_TVV1T              = IT_TVV1T
    ET_TVV1T              = ET_TVV1T
EXCEPTIONS
   NOT_FOUND             = 1
   PARAMETER_ERROR       = 2
   OTHERS                = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards

Similar Messages

  • BAPI for adding text in the delivery Header Text Tab?

    Dear All,
    We are using the SAP standard BAPI to create the delivery Document by inputing sales order number.
    The issue is that the customer is maintaining the Truck number in the delivery Header Level Text Tab, now he wants that he will give the sales order number and truck number as inputs the BAPI as to create the Delivery document and the truck number should appear in the Deliver header level text tab ("Truck No" text object maintained)
    Please suggest asap.
    Regards,
    Javal;

    Dear Javali,
    Have you tried the function module 'CREATE_TEXT' ?
    Check and revert back.
    Thanks & Regards,
    Hegal

  • Flexible Real Estate BAPI or API for Supplemental Text (Memo Fields)

    Hi,
    Can any one let me know if there are any BAPI or API by which i can load long text into Memo Field (Supplemental text). we are on ECC 6.0 version (FLX-RE)
    Thanks
    Veman

    Hi,
    the upload of additional texts with BAPI or batch input recording is
    not supported.
    It's not possible to create notes or memos with the same BAPI call for
    creating the real estate object itself. But you can add supplementary
    texts in a 2nd step for existing real estate objects.
    (1) Additional texts are SAPscript text modules
    Use function modules INIT_TEXT and SAVE_TEXT.
    Keys of RE-FX text modules are:
    - OBJECT always "RE"
    - ID = group key, e.g. "TMNO"
    - NAME = <INTRENO of real estate object>#<subkey>#
    - LANGU = logon language
    Simply create a memo manually and check the resulting SAPscript text
    module with report RFRECATM (tool to maintain text modules).
    Function modules CONVERT_STREAM_TO_ITF_TEXT and
    CONVERT_ITF_TO_STREAM_TEXT may be helpful to work with the SAPscript
    ITF text format.
    (2) Update of table VICAADDTEXT
    The relationship between contract and text id is stored in table
    VICAADDTEXT. To see the before created text module in the contract
    dialog you have to insert an entry in table VICAADDTEXT.
    INTRENO   intreno of the contract
    TEXTCATE  text category
    ADDTEXTGUID  GUID for additional text
    A new GUID can be created with function call:
        CALL FUNCTION 'GUID_CREATE'
          IMPORTING
            ev_guid_16       = ls_vicaaddtext-addtextguid
          EV_GUID_22       =
          EV_GUID_32       =
    It may be helpful to first have a look at the content of table
    VICAADDTEXT to see how already manually inserted entries are stored
    in this table.
    I hope that this information will help you to get the texts loaded.
    Regards, Franz

  • Bapi for open PO

    Hi!
    Can anyone let me know where to find the bapi for open po and how to use it in my report program.
    Thanks in advance.
    Note: Mr Anji Reddy vangala has answered me for which iam very much thankful to him, but i need to know about the concerned bapi.
    Regards,
    Parwez.

    Hi,
    Refer the sample code below which creats PO using BAPI_PO_CREATE1.
    Hope this helps your querry.
    *& Report  YDM_PO_CREATE                                               *
    REPORT  ydm_po_create.
    *-- Input File Declaration
    TYPES: BEGIN OF ty_input_file,
           column1 TYPE char50,
           column2 TYPE char50,
           column3 TYPE char50,
           column4 TYPE char50,
           column5 TYPE char50,
           column6 TYPE char50,
           column7 TYPE char50,
           column8 TYPE char50,
           column9 TYPE char50,
           column10 TYPE char50,
           column11 TYPE char50,
           column12 TYPE char50,
           column13 TYPE char50,
           column14 TYPE char50,
           column15 TYPE char50,
           column16 TYPE char50,
           column17 TYPE char50,
           column18 TYPE char50,
    END OF ty_input_file.
    DATA: i_input_file  TYPE STANDARD TABLE OF ty_input_file,
          wa_input_file TYPE ty_input_file.
    CONSTANTS: c_path     TYPE char20 VALUE 'C:\',
               c_mask     TYPE char9  VALUE ',*.*,*.*.',
               c_mode     TYPE char1  VALUE 'O',
               c_filetype TYPE char10 VALUE 'ASC',
               c_x        TYPE char01 VALUE 'X'.
    PARAMETERS : p_fname   LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    *-- Browse Presentation Server
      PERFORM f4_presentation_file.
    START-OF-SELECTION..
    *-- Read presentation server file
      PERFORM f1003_upload_file.
      IF NOT i_input_file[] IS INITIAL.
        PERFORM split_data.
      ENDIF.
    *&                  Form  f4_presentation_file
    *&                F4 Help for presentation server
    FORM f4_presentation_file .
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_path         = c_path
          mask             = c_mask
          mode             = c_mode
          title            = text-001
        IMPORTING
          filename         = p_fname
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " f4_presentation_file
    *&                      Form  f1003_upload_file
    *&                         Upload File
    FORM f1003_upload_file .
      DATA: lcl_filename TYPE string.
      lcl_filename = p_fname.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lcl_filename
          filetype                = c_filetype
          has_field_separator     = c_x
        TABLES
          data_tab                = i_input_file
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    ENDFORM.                    " f1003_upload_file
    *&      Form  split_data
          Collect data for creating Purchase Order
    FORM split_data .
      DATA: i_poitem        TYPE STANDARD TABLE OF bapimepoitem,
            i_poitemx       TYPE STANDARD TABLE OF bapimepoitemx,
            i_poitem_sch    TYPE STANDARD TABLE OF bapimeposchedule,
            i_poitem_schx   TYPE STANDARD TABLE OF bapimeposchedulx,
            i_acct_***      TYPE STANDARD TABLE OF bapimepoaccount,
            i_acct_assx     TYPE STANDARD TABLE OF bapimepoaccountx,
            i_services      TYPE STANDARD TABLE OF bapiesllc ,
            i_srvacc        TYPE STANDARD TABLE OF bapiesklc,
            i_return        TYPE STANDARD TABLE OF bapiret2,
            wa_header       TYPE bapimepoheader,
            wa_headerx      TYPE bapimepoheaderx,
            wa_poitem       TYPE bapimepoitem,
            wa_poitemx      TYPE bapimepoitemx,
            wa_poitem_sch   TYPE bapimeposchedule,
            wa_poitem_schx  TYPE bapimeposchedulx,
            wa_acct_***     TYPE bapimepoaccount,
            wa_acct_assx    TYPE bapimepoaccountx,
            wa_services     TYPE bapiesllc,
            wa_srvacc       TYPE bapiesklc,
            wa_return       TYPE bapiret2,
            ws_po           TYPE bapimepoheader-po_number.
      break gbpra8.
      wa_services-pckg_no = 10.
      wa_services-line_no = 1.
      wa_services-outl_no = '0'.
      wa_services-outl_ind = c_x.
      wa_services-subpckg_no = 20.
      APPEND wa_services TO i_services.
      wa_srvacc-pckg_no = 10.
      wa_srvacc-line_no = 1.
      wa_srvacc-serno_line = 01.
      wa_srvacc-serial_no = 01.
      wa_srvacc-percentage = 100.
      APPEND wa_srvacc TO i_srvacc.
      LOOP AT i_input_file INTO wa_input_file.
        IF wa_input_file-column2 EQ 'HD'.
          wa_header-doc_type = wa_input_file-column3.
          wa_header-creat_date = sy-datum.
          wa_header-created_by = sy-uname.
          wa_header-vendor = wa_input_file-column4.
          PERFORM conversion_output USING wa_header-vendor
                                    CHANGING wa_header-vendor.
          wa_header-comp_code = 'DE03'.
          wa_header-purch_org = 'DE03'.
          wa_header-pur_group = 'DE1'.
          wa_header-vper_start = wa_input_file-column9.
          wa_header-vper_end = wa_input_file-column10.
          wa_headerx-comp_code = c_x.
          wa_headerx-doc_type = c_x.
          wa_headerx-creat_date = c_x.
          wa_headerx-created_by = c_x.
          wa_headerx-vendor = c_x.
          wa_headerx-purch_org = c_x.
          wa_headerx-pur_group = c_x.
          wa_headerx-vper_start = c_x.
          wa_headerx-vper_end = c_x.
        ENDIF.
        IF wa_input_file-column2 EQ 'IT'.
          wa_poitem-po_item = wa_input_file-column3.
          wa_poitem-short_text = wa_input_file-column6.
          wa_poitem-plant = wa_input_file-column8.
          wa_poitem-quantity = '1'.
          wa_poitem-tax_code = 'V0'.
          wa_poitem-item_cat = 'D'.
          wa_poitem-acctasscat = 'K'.
          wa_poitem-matl_group = wa_input_file-column7.
          wa_poitem-pckg_no = '10'.
          APPEND wa_poitem TO i_poitem .
          wa_poitemx-po_item = wa_input_file-column3.
          wa_poitemx-po_itemx = c_x.
          wa_poitemx-short_text = c_x.
          wa_poitemx-plant = c_x.
          wa_poitemx-quantity = c_x.
          wa_poitemx-tax_code = c_x.
          wa_poitemx-item_cat = c_x.
          wa_poitemx-acctasscat = c_x.
          wa_poitemx-matl_group = c_x.
          wa_poitemx-pckg_no = c_x.
          APPEND wa_poitemx TO i_poitemx.
          wa_poitem_sch-po_item = wa_input_file-column3.
          wa_poitem_sch-delivery_date = sy-datum.
          APPEND wa_poitem_sch TO i_poitem_sch.
          wa_poitem_schx-po_item = wa_input_file-column3.
          wa_poitem_schx-po_itemx = c_x.
          wa_poitem_schx-delivery_date = c_x.
          APPEND wa_poitem_schx TO i_poitem_schx.
          wa_acct_***-po_item = 10.
          wa_acct_***-serial_no = 01.
          wa_acct_***-gl_account = '0006360100'.
          wa_acct_***-co_area  = '1000'.
          wa_acct_***-costcenter = 'KC010000'.
          APPEND wa_acct_*** TO i_acct_***.
          wa_acct_***-po_item = 10.
          wa_acct_***-serial_no = 02.
          wa_acct_***-gl_account = '0006360100'.
          wa_acct_***-co_area  = '1000'.
          wa_acct_***-costcenter = 'KC010000'.
          APPEND wa_acct_*** TO i_acct_***.
          wa_acct_assx-po_item = 10.
          wa_acct_assx-serial_no = 01.
          wa_acct_assx-po_itemx = c_x.
          wa_acct_assx-serial_nox = c_x.
          wa_acct_assx-gl_account = c_x.
          wa_acct_assx-co_area  = c_x.
          wa_acct_assx-costcenter = c_x.
          APPEND wa_acct_assx TO i_acct_assx.
          wa_acct_assx-po_item = 10.
          wa_acct_assx-serial_no = 02.
          wa_acct_assx-po_itemx = c_x.
          wa_acct_assx-serial_nox = c_x.
          wa_acct_assx-gl_account = c_x.
          wa_acct_assx-co_area  = c_x.
          wa_acct_assx-costcenter = c_x.
          APPEND wa_acct_assx TO i_acct_assx.
          wa_services-pckg_no = 20.
          wa_services-line_no = 2.
          wa_services-service = wa_input_file-column9.
          wa_services-quantity = '100'.
          wa_services-gr_price = '100'.
          wa_services-userf1_txt = wa_input_file-column13.
          APPEND wa_services TO i_services.
          wa_srvacc-pckg_no = 20.
          wa_srvacc-line_no = 1.
          wa_srvacc-serno_line = 02.
          wa_srvacc-serial_no = 02.
          wa_srvacc-percentage = 100.
          APPEND wa_srvacc TO i_srvacc.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader                     = wa_header
          poheaderx                    = wa_headerx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
       IMPORTING
         exppurchaseorder             = ws_po
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
       TABLES
         return                       = i_return
         poitem                       = i_poitem
         poitemx                      = i_poitemx
      POADDRDELIVERY               =
         poschedule                   = i_poitem_sch
         poschedulex                  = i_poitem_schx
         poaccount                    = i_acct_***
      POACCOUNTPROFITSEGMENT       =
         poaccountx                   = i_acct_assx
      POCONDHEADER                 =
      POCONDHEADERX                =
      POCOND                       =
      POCONDX                      =
      POLIMITS                     =
      POCONTRACTLIMITS             =
         poservices                   = i_services
         posrvaccessvalues            = i_srvacc
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
      break gbpra8.
      LOOP AT i_return INTO wa_return.
      ENDLOOP.
    ENDFORM.                    " split_data
    *&      Form  conversion_output
          Conversion exit input
    FORM conversion_output  USING    p_ip
                            CHANGING p_op.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = p_ip
        IMPORTING
          output = p_op.
    ENDFORM.                    " conversion_output
    <b>Reward points if this helps.
    Manish</b>

  • BAPI FOR Deleting a Schedule Line Item from EKES and EKET tables

    Dear All,
    I would like to for deleting one of the line item from EKES (Po Confirmation ) and the respective line item from the EKET(PO Schedule Line Item Table).
    Assume that am allowing the user to select the lineitem from zprogram screen and collecting the PO and Its LIne Item details in an internal table.
    Can i Use
    <b>BAPI_PO_Change</b> , if so , can anybody tell me the steps to follow to use this bapi for deleting the PO lineItems, since i m going to try BAPI for First time.
    pls help me out
    Message was edited by: Raja K.P

    Hi raja ,
    loop at iekko1.
        w_index = sy-tabix.
        item-po_item   = itemx-po_item   = iekko1-ebelp.
        item-quantity  = iekko1-mng01.
        itemx-quantity = iekko1-mng01.
        if iekko1-wamng = iekko1-wemng.
        itemx-no_more_gr = item-no_more_gr = 'X'.
        else.
        itemx-no_more_gr = item-no_more_gr = ''.
        endif.
        append item.
        append itemx.
          clear return[].
          call function 'BAPI_PO_CHANGE'
               exporting
                    purchaseorder = iekko1-ebeln
               tables
                    return        = return
                    poitem        = item
                    poitemx       = itemx.
          if return[] is initial.
          commit work and wait.
          call function 'DEQUEUE_ALL'.
    search for deletion fields which u have to mark 'X'.
    before calling  this BAPi u have to lock the PO by using ENQUEUE.
    <b>
    FU BAPI_PO_CHANGE
    Text
    Change purchase order
    Functionality
    Function module BAPI_PO_CHANGE enables you to change purchase orders. The Change method uses the technology behind the online transaction ME22N.
    Alternatively, the IDoc type PORDCH1 is available. The data from this IDoc populates the interface parameters of the function module BAPI_PO_CHANGE.
    Functionality in Detail
    Authorization
    When you create (activity 02) an Enjoy purchase order, the following authorization objects are checked:
    M_BEST_BSA (document type in PO)
    M_BEST_EKG (purchasing group in PO)
    M_BEST_EKO (purchasing organization in PO)
    M_BEST_WRK (plant in PO)
    Controlling adoption of field values via X bar
    For most tables, you can use your own parameters in the associated X bar (e.g. PoItemX) to determine whether fields are to be set initial, values inserted via the interface, or default values adopted from Customizing or master records, etc. (for example, it is not mandatory to adopt the material group from an underlying requisition - you can change it with the BAPI).
    Transfer
    Purchase order number
    The PurchaseOrder field uniquely identifies a purchase order. This field must be populated in order to carry out the Change method.
    Header data
    The header data of the Enjoy purchase order is transferred in table PoHeader.
    Item data
    The item data of the Enjoy purchase order is stored in the tables PoItem (general item data). Changes regarding quantity and delivery date are to be made in the table PoSchedule.
    Use the table PoAccount to change the account assignment information.
    Services and limits
    Changes to existing items cannot be carried out with the Change method. It is only possible to create new items.
    Conditions
    Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. A new price determination process can be initiated via the parameter CALCTYPE in the table PoItem.
    Vendor and delivery address
    The vendor address in the table PoAddrVendor and the delivery address in the table PoAddrDelivery can only be replaced by another address number that already exists in the system (table ADRC). Changes to address details can only be made using the method BAPI_ADDRESSORG_CHANGE.
    Partner roles
    You can change all partners except the partner role "vendor" via the table PoPartner.
    Export/import data
    Export/import data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items. Changes to the export/import data of existing items are not possible.
    Texts
    Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText. Texts can only be replaced completely.
    Version Management
    You can make use of the Version Management facility via the table AllVersions.
    Return
    If the PO was changed successfully, the header and item tables are populated with the information from the PO.
    Return messages
    Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. If a PO has been successfully created, the PO number is also placed in the return table with the appropriate message.
    Restrictions
    With this function module, it is not possible to:
    Create subcontracting components (you can only use existing ones)
    Create configurations (you can only use existing ones)
    Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
    Attach documents to the purchase order
    Change foreign trade data
    Change service data
    Change or reexplode BOMs
    A firewall prevents the manipulation of data that is not changeable in Purchasing according to the business logic of the purchase order (e.g. PO number, vendor, etc.).
    PO items with an invoicing plan cannot be created or changed using the BAPIs
    In this connection, please refer to current information in Note 197958.
    To change addresses with numbers from Business Address Services (cantral address management), please use the function module BAPI_ADDRESSORG_CHANGE.
    To change variant configurations, please use the function module BAPI_UI_CHANGE. More information is available in the BAPI Explorer under the Logistics General node.
    In the case of changes that are to be made via the BAPI_PO_CHANGE, a firewall first checks whether the relevant fields are changeable. This approach follows that of the online transaction. Here it is not possible to change the vendor or the document type, for example.
    Example
    Example of changes made to a purchase order with:
    1. Change in header data
    2. Change in item
    3. Change in delivery schedule
    4. Change in account assignment
    5. Change in conditions
    6. Change in partners
    Parameter: PURCHASEORDER 4500049596
    Parameter: POHEADER
    PMNTTRMS = 0002
    PUR_GROUP = 002
    Parameter: POHEADERX
    PMNTTRMS = X
    PUR_GROUP = X
    Parameter: POITEM
    PO_ITEM = 00001
    CONF_CTRL = 0001
    Parameter: POITEMX
    PO_ITEM = 00001
    PO_ITEMX = X
    CONF_CTRL =  X
    Parameter: POSCHEDULE
    PO_ITEM = 00001
    SCHED_LINE = 0001
    QUANTITY = 10.000
    PO_ITEM = 00001
    SCHED_LINE = 0003
    DELETE_IND =  X
    Parameter: POSCHEDULEX
    PO_ITEM =  00001
    SCHED_LINE =  0001
    PO_ITEMX =  X
    SCHED_LINEX =  X
    QUANTITY =  X
    PO_ITEM =  00001
    SCHED_LINE =  0003
    PO_ITEMX =  X
    SCHED_LINEX =  X
    DELETE_IND = X
    Parameter: POACCOUNT
    PO_ITEM = 00001
    SERIAL_NO = 01
    GL_ACCOUNT = 0000400020
    Parameter: POACCOUNTX
    PO_ITEM = 00001
    SERIAL_NO = 01
    PO_ITEMX = X
    SERIAL_NOX = X
    GL_ACCOUNT = X
    Parameter: POCOND
    ITM_NUMBER = 000001
    COND_TYPE = RA02
    COND_VALUE = 2.110000000
    CURRENCY = %
    CHANGE_ID = U
    Parameter: POCONDX
    ITM_NUMBER = 000001
    COND_ST_NO = 001
    ITM_NUMBERX = X
    COND_ST_NOX = X
    COND_TYPE = X
    COND_VALUE = X
    CURRENCY = X
    CHANGE_ID = X
    Parameter: POPARTNER
    PARTNERDESC =  GS
    LANGU =  EN
    BUSPARTNO = 0000001000
    Help in the Case of Problems
    1. Note 197958 lists answers to frequently asked questions (FAQs). (Note 499626 contains answers to FAQs relating to External Services Management.)
    2. If you have detected an error in the function of a BAPI, kindly create a reproducible example in the test data directory in the Function Builder (transaction code SE37). Note 375886 tells you how to do this.
    3. If the problem persists, please create a Customer Problem Message for the componente MM-PUR-PO-BAPI, and document the reproducible example where necessary.
    Customer Enhancements
    The following user exits (function modules) are available for the BAPI BAPI_PO_CREATE1:
    EXIT_SAPL2012_001 (at start of BAPI)
    EXIT_SAPL2012_003 (at end of BAPI)
    The following user exits (function modules) are available for the BAPI BAPI BAPI_PO_CHANGE:
    EXIT_SAPL2012_002 (at start of BAPI)
    EXIT_SAPL2012_004 (at end of BAPI)
    These exits belong to the enhancement SAPL2012 (see also transaction codes SMOD and CMOD).
    There is also the option of populating customer-specific fields for header, item, or account assignment data via the parameter EXTENSIONIN.
    Further Information
    1. Note 197958 contains up-to-date information on the purchase order BAPIs.
    2. If you test the BAPIs BAPI_PO_CREATE1 or BAPI_PO_CHANGE in the Function Builder (transaction code SE37), no database updates will be carried out. If you need this function, please take a look at Note 420646.
    3. The BAPI BAPI_PO_GETDETAIL serves to read the details of a purchase order. The BAPI cannot read all details (e.g. conditions). However, you can use the BAPI BAPI_PO_CHANGE for this purpose if only the document number is populated and the initiator has change authorizations for purchase orders.
    4. Frequently used BAPIs for purchase orders are BAPI_PO_CREATE, BAPI_PO_CREATE1, BAPI_PO_CHANGE, BAPI_PO_GETDETAIL, BAPI_PO_GETITEMS, BAPI_PO_GETITEMSREL, and BAPI_PO_GETRELINFO.
    5. For more information on purchase orders, refer to the SAP library (under MM Purchasing -> Purchase Orders) or the Help for the Enjoy Purchase Order, or choose the path Tools -> ABAP Workbench -> Overview -> BAPI Explorer from the SAP menu.
    Parameters
    PURCHASEORDER
    POHEADER
    POHEADERX
    POADDRVENDOR
    TESTRUN
    MEMORY_UNCOMPLETE
    MEMORY_COMPLETE
    POEXPIMPHEADER
    POEXPIMPHEADERX
    VERSIONS
    NO_MESSAGING
    NO_MESSAGE_REQ
    NO_AUTHORITY
    NO_PRICE_FROM_PO
    EXPHEADER
    EXPPOEXPIMPHEADER
    RETURN
    POITEM
    POITEMX
    POADDRDELIVERY
    POSCHEDULE
    POSCHEDULEX
    POACCOUNT
    POACCOUNTPROFITSEGMENT
    POACCOUNTX
    POCONDHEADER
    POCONDHEADERX
    POCOND
    POCONDX
    POLIMITS
    POCONTRACTLIMITS
    POSERVICES
    POSRVACCESSVALUES
    POSERVICESTEXT
    EXTENSIONIN
    EXTENSIONOUT
    POEXPIMPITEM
    POEXPIMPITEMX
    POTEXTHEADER
    POTEXTITEM
    ALLVERSIONS
    POPARTNER
    Exceptions
    Function Group
    2012
    </b>
    regards
    prabhu
    Message was edited by: Prabhu Peram

  • Can u tell me any predefined BAPI for change and creation of Material

    Hi,
        Can anybody tell me  predefined BAPI for change and creation of Materialmasterand Pricing?
    Thanks & regards,
    Gopianne.

    you can use the BAPI to BAPI_MATERIAL_SAVEDATA create as well as to change material master.
    When changing material master data, you need enter only the material
    number.
    In the header data, you must select at least one view for which data is
    to be created. Depending on the view selected, you must maintain other
    required parameters. If you do not enter values for all of the required
    parameters, the method is ended with an error message.
    The corresponding fields in the tables (such as CLIENTDATA) must first
    be supplied with data by the calling program. An indicator must also be
    set for each of these fields so that the data is written to the database
    by the method. This requires the calling program to supply the
    corresponding field with the indicator in a checkbox table (for example,
    CLIENTDATAX). Checkbox tables exist for tables that do not contain any
    language-dependent texts (MAKT, MLTX), International Article Numbers
    (MEAN), or tax classifications (MLAN). Several data records for a
    material can be created in these tables.
    regards
    vivek
    reward points if it helps

  • Bapi for f-44

    Hi....
    I'm using BAPI_ACC_DOCUMENT_POST to clear vendor open items for the T-code f-44.The following is my below code and it seems to be going on fine but the data in the table bsak(Vendor accounts cleared items) is not updated..with the concern vendor number and documnet no....more over when i'm checking this FM the document post perform is displaying an erro RW with number 604.......in the return internal table.....what wud be the problem for this i'm posting my coding below plz suggest me for this......Is the Bapi correct for the concern document......
    *& Report  Z_TEST_F44                                                  *
    REPORT  z_test_f44 NO STANDARD PAGE HEADING
    LINE-COUNT 65
    LINE-SIZE 132
    MESSAGE-ID zfi.
    *tables: bsik.
    TYPES: BEGIN OF tp_tab_bsik,
           bukrs TYPE bukrs,
           lifnr TYPE lifnr,
           gjahr TYPE gjahr,
           budat TYPE budat,
           bldat TYPE bldat,
           blart TYPE blart,
           bschl TYPE bschl,
           END OF tp_tab_bsik.
    DATA: l_tab_bsik TYPE  tp_tab_bsik OCCURS 10.
    DATA: l_wa_tab_bsik TYPE tp_tab_bsik.
    DATA:BEGIN OF it_account_tab OCCURS 0,
    line(255),
    END OF it_account_tab.
    DATA:
    g_fis_period(2) TYPE c,
    g_clear_date(10) TYPE c,
    g_accountno(10) TYPE c,
    g_currencytype(3) TYPE c,
    g_docno(10) TYPE c,
    g_amount(13) TYPE c,
    g_sign TYPE c,
    g_pstkey(2) TYPE c,
    g_companycode(4) TYPE c.
    DATA:
    it_error_acc_tab LIKE it_account_tab OCCURS 0 WITH HEADER LINE.
    *include bdcrecxx.
    --Start of Selection Parameters--
    SELECTION-SCREEN:BEGIN OF BLOCK blck01 WITH FRAME TITLE text-001.
    PARAMETERS:
    p_fname LIKE rlgrap-filename,
    p_fserv LIKE rlgrap-filename.
    SELECTION-SCREEN:END OF BLOCK blck01.
    --End of Selection Parameters--
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'DATASET'
        IMPORTING
          file_name     = p_fname.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fserv.
      DATA:
      l_pfad LIKE ibipparms-path.
      CALL FUNCTION 'F4_FILENAME_SERVER'
        EXPORTING
          pfad              = l_pfad
        IMPORTING
          file_name         = p_fserv
        EXCEPTIONS
          no_file_on_server = 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.
      ENDIF.
    --START OF SELECTION--
    START-OF-SELECTION.
      PERFORM get_data_bsik.
      PERFORM get_default_data. "Getting the default data
      PERFORM get_input_data. "Uploading the file data
      PERFORM format_input_data. "Formating the data
      PERFORM process_data. "Posting using F-44(Bapi)
      IF it_error_acc_tab[] IS INITIAL.
        MESSAGE i001(ztest).
      ENDIF.
    END-OF-SELECTION.
    --End OF SELECTION--
    *& Form get_default_data
    text
    --> p1 text
    <-- p2 text
    FORM get_default_data.
    ENDFORM. " get_default_data
    *& Form get_input_data
    text
    --> p1 text
    <-- p2 text
    FORM get_input_data.
      DATA:
      l_fname TYPE string,
      l_dsn(128) TYPE c,
      l_rec(80) TYPE c.
      l_fname = p_fname.
      IF NOT l_fname IS INITIAL.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename                = l_fname
            filetype                = 'ASC'
           has_field_separator     = 'X'
          TABLES
            data_tab                = it_account_tab
          EXCEPTIONS
            file_open_error         = 1
            file_read_error         = 2
            no_batch                = 3
            gui_refuse_filetransfer = 4
            invalid_type            = 5
            no_authority            = 6
            unknown_error           = 7
            bad_data_format         = 8
            header_not_allowed      = 9
            separator_not_allowed   = 10
            header_too_long         = 11
            unknown_dp_error        = 12
            access_denied           = 13
            dp_out_of_memory        = 14
            disk_full               = 15
            dp_timeout              = 16
            OTHERS                  = 17.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.
        BREAK-POINT.
        l_dsn = p_fserv.
        OPEN DATASET l_dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        READ DATASET l_dsn INTO l_rec.
        APPEND it_account_tab.
        WHILE sy-subrc <> 0.
          READ DATASET l_dsn INTO l_rec.
          APPEND it_account_tab.
        ENDWHILE.
        CLOSE DATASET l_dsn.
      ENDIF.
    ENDFORM. " get_input_data
    *& Form format_input_data
    text
    --> p1 text
    <-- p2 text
    FORM format_input_data.
      SORT it_account_tab.
    ENDFORM. " format_input_data
    *& Form process_data
    text
    --> p1 text
    <-- p2 text
    FORM process_data.
      DATA:
      l_documentheader LIKE bapiache09,
      l_accountgl  LIKE bapiacgl09 OCCURS 2 WITH HEADER LINE,
      l_vendoritem LIKE bapiacap09 OCCURS 2 WITH HEADER LINE,
      l_currencyamount LIKE bapiaccr09 OCCURS 2 WITH HEADER LINE,
      l_currencytype LIKE bapiaccr09-currency_iso,
      l_return LIKE bapiret2 OCCURS 5 WITH HEADER LINE,
      l_obj_type LIKE bapiache02-obj_type,
      l_obj_key LIKE bapiache02-obj_key,
      l_obj_sys LIKE bapiache02-obj_sys.
      LOOP AT it_account_tab.
        CLEAR:
        g_fis_period,
        g_clear_date,
        g_accountno,
        g_amount,
        g_sign,
        l_documentheader,
        l_vendoritem,
        l_accountgl,
        l_wa_tab_bsik,
        l_currencyamount,
        l_return.
        REFRESH:l_vendoritem,
        l_currencyamount,
        l_return.
        g_accountno = it_account_tab-line+0(10).
        g_clear_date = it_account_tab-line+11(10).
        g_fis_period = it_account_tab-line+22(2).
        g_companycode = it_account_tab-line+25(4).
        g_docno = it_account_tab-line+30(10).
        g_pstkey = it_account_tab-line+41(2).
        g_amount = it_account_tab-line+44(13).
        g_currencytype = it_account_tab-line+58(3).
        IF sy-subrc <> 0.
          MOVE-CORRESPONDING it_account_tab TO it_error_acc_tab.
          APPEND it_error_acc_tab.
          CLEAR it_error_acc_tab.
          CONTINUE.
        ENDIF.
    READ TABLE l_tab_bsik INTO l_wa_tab_bsik WITH KEY bukrs = g_companycode
                                                      lifnr = g_accountno.
        l_documentheader-obj_type = 'BKPFF'.
        l_documentheader-obj_key = sy-uzeit.
        l_documentheader-obj_sys = 'ABAPEML2'.
        l_documentheader-bus_act = 'RFBU'.
        l_documentheader-ac_doc_no  = g_accountno.
        l_documentheader-username = sy-uname.
        l_documentheader-comp_code = g_companycode.
        l_documentheader-fis_period = g_fis_period(2).
        l_documentheader-doc_date = g_clear_date.
        l_documentheader-pstng_date = g_clear_date.
        l_documentheader-fisc_year = l_wa_tab_bsik-gjahr.
        l_documentheader-doc_type  = l_wa_tab_bsik-blart.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = g_accountno
          IMPORTING
            output = g_accountno.
        l_accountgl-itemno_acc  = '2'.
        l_accountgl-gl_account = g_accountno.
        l_accountgl-comp_code = g_companycode.
        l_accountgl-pstng_date = sy-datum.
        l_accountgl-doc_type = l_wa_tab_bsik-blart.
        l_accountgl-ac_doc_no = g_accountno.
        APPEND l_accountgl.
        l_vendoritem-itemno_acc =  '2'.
        l_vendoritem-vendor_no   = g_accountno.
        l_vendoritem-comp_code =   g_companycode.
        APPEND l_vendoritem.
        l_currencyamount-itemno_acc = '2'.
        l_currencyamount-currency_iso = g_currencytype.
        l_currencyamount-amt_doccur = g_amount.
        IF g_sign = '-'.
          l_currencyamount-amt_doccur = l_currencyamount-amt_doccur * -1.
        ENDIF.
        APPEND l_currencyamount.
    *CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
        CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
          EXPORTING
            documentheader = l_documentheader
          IMPORTING
            obj_key        = l_obj_key
          TABLES
            accountgl      = l_accountgl
            accountpayable = l_vendoritem
            currencyamount = l_currencyamount
            return         = l_return.
        IF l_obj_key NE '$'.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        ELSE.
          MOVE-CORRESPONDING it_account_tab TO it_error_acc_tab.
          APPEND it_error_acc_tab.
          CLEAR it_error_acc_tab.
        ENDIF.
      ENDLOOP.
    ENDFORM. "process_data
    *&      Form  get_data_bsik
          text
    -->  p1        text
    <--  p2        text
    FORM get_data_bsik.
      SELECT bukrs
             lifnr
             gjahr
             budat
             bldat
             blart
             bschl
             FROM bsik INTO TABLE l_tab_bsik.
    ENDFORM.                    " get_data_bsik
    Points wud be surely awarded....................

    hi kiran....
    this bapi will get all the open items from <b>bsik</b> and will show us the open items but i want the bapi for clearing this open items and post it in the<b> bsak</b> table.And more over this is concerned with the Customer side ie bsad and bsid(clear items) tables.........Will this work?????????
    Thanks.........

  • Profit Center not getting uploaded through BAPI for MM01. Pls help

    Hello all,
                  I am getting an errror while uploading a file through BAPI for MM01 , The error says
    Error:
    Profit center 1000/sslcommon does not exist
    for material: AC2
    *& Report  ZBAPI_DUMMY
    REPORT  ZBAPI_MM01.
    *& Report  ZBAPI2
    TABLES
    FLAGS *
    DATA: F_STOP. " Flag used to stop processing
    DATA DECLARATIONS *
    DATA : V_EMPTY TYPE I, " No. of empty records
    V_TOTAL TYPE I. " Total no. of records.
    STRUCTURES & INTERNAL TABLES
    *--- BAPI structures
    DATA: BAPI_HEAD LIKE BAPIMATHEAD,  " Header Segment with Control
    BAPI_MAKT LIKE BAPI_MAKT, " Material Description
    BAPI_MARA1 LIKE BAPI_MARA, " Client Data
    BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
    BAPI_MARC1 LIKE BAPI_MARC, " Plant View
    BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
    BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
    BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
    BAPI_RETURN LIKE BAPIRET2, " Return Parameter
    BAPI_MARDL LIKE BAPI_MARD,
    BAPI_MARDX LIKE BAPI_MARDX.
    *--- Internal table to hold excel file data
    DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    *--- Internal table to hold Matetrial descriptions
    DATA: BEGIN OF IT_MAKT OCCURS 100.
            INCLUDE STRUCTURE BAPI_MAKT.
    DATA: END OF IT_MAKT.
    *--- Internal to hold the records in the text file
    DATA : BEGIN OF IT_DATA OCCURS 100,
    WERKS(4), " Plant
    MTART(4), " Material type
    MATNR(18), " Material number
    MATKL(9) , " Material group
    MBRSH(1), " Industry sector
    MEINS(3), " Base unit of measure
    SPART(2), " Division
    EKGRP(3), " Purchasing group
    PRCTR(10), " Profit Center
    VPRSV(1), " Price control indicator
    BKLAS(4), "Valuation Class
    *stprs(12), " Standard price
    PEINH(3), " Price unit
    SPRAS(2), " Language key
    MAKTX(40), " Material description
    LGORT(4) , " storage location
    DISMM(2) , "MRP TYPE
    VERPR(23), " Moving Average Price
    MTVFP(2) , " Availability Check
    DISLS(2) , "Lot Size
    DISPO(3) , "MRP Controller
    BESKZ(1) , "Procurment Type
    FHORI(3) , "SCHEDMARGIN KEY
    PERKZ(1) , "Period Indicator
    END OF IT_DATA.
    SELECTION SCREEN. *
    SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
    PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY  " Input File
    PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
    PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
    PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
    P_BEGROW TYPE I DEFAULT 2 NO-DISPLAY,
    P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
    P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
    SELECTION-SCREEN END OF BLOCK SCR1.
    AT SELECTION-SCREEN *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *--- Validating file
      PERFORM VALIDATE_FILE USING P_FILE.
    START-OF-SELECTION
    START-OF-SELECTION.
    *--- Perform to convert the Excel data into an internal table
      PERFORM CONVERT_XLS_ITAB.
      IF NOT IT_DATA[] IS INITIAL.
    *--- Perform to delete Header lines
        PERFORM DELETE_HEADER_EMPTY_RECS.
      ENDIF.
    END OF SELECTION. *
    END-OF-SELECTION.
    *--- Perform to upload Material Master data
      PERFORM UPLOAD_MATMAS.
    Form : validate_input_file
    Description : To provide F4 help for file if read from PC
    FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = F_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC <> 0.
        MESSAGE S010(ZLKPL_MSGCLASS). " 'Error in getting filename'.
      ENDIF.
    ENDFORM. " validate_input_file
    *& Form CONVER_XLS_ITAB
    text
    FORM CONVERT_XLS_ITAB.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          FILENAME    = P_FILE
          I_BEGIN_COL = P_BEGCOL
          I_BEGIN_ROW = P_BEGROW
          I_END_COL   = P_ENDCOL
          I_END_ROW   = P_ENDROW
        TABLES
          INTERN      = IT_INTERN.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *--- Perform to move the data into an internal data
      PERFORM MOVE_DATA.
    ENDFORM. " CONVERT_XLS_ITAB
    *& Form MOVE_DATA
    text
    FORM MOVE_DATA.
      DATA : LV_INDEX TYPE I.
      FIELD-SYMBOLS <FS>  .
    *--- Sorting the internal table
      SORT IT_INTERN BY ROW COL.
      CLEAR IT_INTERN.
      LOOP AT IT_INTERN.
        MOVE IT_INTERN-COL TO LV_INDEX.
    *--- Assigning the each record to an internal table row
        ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO <FS> .
    *--- Asigning the field value to a field symbol
        MOVE IT_INTERN-VALUE TO <FS> .
        AT END OF ROW.
          APPEND IT_DATA.
          CLEAR IT_DATA.
        ENDAT.
      ENDLOOP.
    ENDFORM. " MOVE_DATA
    *& Form DELETE_HEADER_EMPTY_RECS
    To delete the Header and empty records
    FORM DELETE_HEADER_EMPTY_RECS.
      DATA: LV_TABIX LIKE SY-TABIX.
      IF NOT P_HEADER IS INITIAL.
        LOOP AT IT_DATA.
          IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
            DELETE IT_DATA FROM 1 TO P_HEADER.
    P_HEADER = 0.
            EXIT.
          ENDIF.
        ENDLOOP.
      ENDIF.
      CLEAR IT_DATA.
    *--- To delete the empty lines from internal table
      LOOP AT IT_DATA.
        LV_TABIX = SY-TABIX.
        IF IT_DATA IS INITIAL.
          V_EMPTY = V_EMPTY + 1.
          DELETE IT_DATA INDEX LV_TABIX..
        ENDIF.
      ENDLOOP.
      CLEAR IT_DATA.
    *--- Total no of recs in file
      DESCRIBE TABLE IT_DATA LINES V_TOTAL.
      IF V_TOTAL = 0.
        MESSAGE I013(ZLKPL_MSGCLASS). " No records in the file
        F_STOP = 'X'.
        STOP.
      ENDIF.
    ENDFORM. " DELETE_HEADER_EMPTY_RECS
    *& Form UPLOAD_MATMAS
    to upload Material Master data
    FORM UPLOAD_MATMAS .
      LOOP AT IT_DATA.
    Header
        BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
        BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
        BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
        BAPI_HEAD-BASIC_VIEW = 'X'.
        BAPI_HEAD-PURCHASE_VIEW = 'X'.
        BAPI_HEAD-ACCOUNT_VIEW = 'X'.
        BAPI_HEAD-storage_view ='X'.
        bapi_head-mrp_view = 'X'.
        bapi_head-COST_view ='X'.
    Material Description
        REFRESH IT_MAKT.
        IT_MAKT-LANGU = IT_DATA-SPRAS.
        IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
        APPEND IT_MAKT.
    Client Data - Basic
        BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
        BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
       bapi_mara1-unit_of_wt = it_data-gewei.
        BAPI_MARA1-DIVISION = IT_DATA-SPART.
        BAPI_MARAX-MATL_GROUP = 'X'.
        BAPI_MARAX-BASE_UOM = 'X'.
        BAPI_MARAX-UNIT_OF_WT = 'X'.
        BAPI_MARAX-DIVISION = 'X'.
    Plant - Purchasing
        BAPI_MARC1-PLANT = IT_DATA-WERKS.
        BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
        BAPI_MARC1-PROFIT_CTR = IT_DATA-PRCTR.
        BAPI_MARC1-MRP_TYPE = IT_DATA-DISMM.
        BAPI_MARC1-AVAILCHECK = IT_DATA-MTVFP.
        BAPI_MARC1-LOTSIZEKEY = IT_DATA-DISLS.
        BAPI_MARC1-MRP_CTRLER = IT_DATA-DISPO.
        BAPI_MARC1-PROC_TYPE = IT_DATA-BESKZ.
        BAPI_MARC1-SM_KEY = IT_DATA-FHORI.
        BAPI_MARC1-PERIOD_IND = IT_DATA-PERKZ.
        BAPI_MARCX-PLANT = IT_DATA-WERKS.
        BAPI_MARCX-PUR_GROUP = 'X'.
        BAPI_MARCX-AVAILCHECK = 'X'.
        BAPI_MARCX-PROFIT_CTR = 'X'.
        BAPI_MARCX-MRP_TYPE = 'X'.
        BAPI_MARCX-MRP_CTRLER = 'X'.
        BAPI_MARCX-SM_KEY = 'X'.
        BAPI_MARCX-LOTSIZEKEY = 'X'.
       Storage Location.
        BAPI_MARDL-PLANT     = IT_DATA-WERKS.
        BAPI_MARDL-STGE_LOC = IT_DATA-LGORT.
        BAPI_MARDX-PLANT    = IT_DATA-WERKS.
        BAPI_MARDX-STGE_LOC = IT_DATA-LGORT.
    Accounting
        BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
        BAPI_MBEW1-VAL_CLASS = IT_DATA-BKLAS.
        BAPI_MBEW1-MOVING_PR = IT_DATA-VERPR.
       bapi_mbew1-std_price = it_data-stprs.
        BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
        BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
        BAPI_MBEWX-PRICE_CTRL = 'X'.
        BAPI_MBEWX-STD_PRICE = 'X'.
        BAPI_MBEWX-PRICE_UNIT = 'X'.
        BAPI_MBEWX-MOVING_PR = 'X'.
    *--- BAPI to create material
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
        EXPORTING
        HEADDATA = BAPI_HEAD
        CLIENTDATA = BAPI_MARA1
        CLIENTDATAX = BAPI_MARAX
        PLANTDATA = BAPI_MARC1
        PLANTDATAX = BAPI_MARCX
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA = BAPI_MARDL
    STORAGELOCATIONDATAX = BAPI_MARDX
    VALUATIONDATA = BAPI_MBEW1
    VALUATIONDATAX = BAPI_MBEWX
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA = BAPI_MVKE1
    SALESDATAX = BAPI_MVKEX
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
        IMPORTING
        RETURN = BAPI_RETURN
        TABLES
        MATERIALDESCRIPTION = IT_MAKT
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
        IF BAPI_RETURN-TYPE = 'E'.
          WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,
    IT_DATA-MATNR.
        ELSEIF BAPI_RETURN-TYPE = 'S'.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT          =
         IMPORTING
           RETURN        = BAPI_RETURN
          WRITE: 'Successfully created material' ,IT_DATA-MATNR.
        ENDIF.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT          =
        IMPORTING
          RETURN        = BAPI_RETURN
      ENDLOOP.
    ENDFORM. " UPLOAD_MATMAS

    the Profit center 1000/sslcommon  not created. first create the profit center and then upload your data.check tcode KE52 for created profit centers...

  • BAPI for Purchase Order Vendor Confirmations

    Can any body suggest me the BAPI for the purchase order vendor confirmations transaction code me22n - Tab<b>-(Confirmations)</b> alone.
    regs,
    Raja

    Dear Asha,
    Pls find the below code, this handles only the BDC part of the program.Updates only the EKES table thru standard confirmation tab on ME22N.
    Kindly clarify any doubts in this reg.
    regs,
    Raja.
    FORM ins_stdtable .
      DATA:var TYPE c LENGTH 30,
      cstr(02) TYPE n value '01'.
      data istr(02) type n value '00'.
      DATA recno TYPE i.
      data: eblc type c length 5,
      ebli type i.
      DATA: kebeln LIKE utab-ebeln.
      DATA: BEGIN OF indx,
             ebelp type ekes-ebelp,
             eindx type i,
            END OF indx.
      DATA : CNT TYPE I value 1.
      DATA: COUNTER(2) TYPE N VALUE '01',
      ROWS TYPE P.
      DATA: w_textout            LIKE t100-text.
      DATA: gd_update TYPE i,
            gd_lines TYPE i.
      data :waek like indx,
      itabek LIKE TABLE OF waek.
    *Used to stores error information from CALL TRANSACTION Function Module
      DATA: BEGIN OF messtab OCCURS 0.
              INCLUDE STRUCTURE bdcmsgcoll.
      DATA: END OF messtab.
      SELECT MAX( ETENS ) FROM ekes INTO zetens WHERE ebeln =
      ekko-ebeln.
      recno = zetens.
      LOOP AT utab.
        SELECT distinct ebelp INTO CORRESPONDING FIELDS OF TABLE
        itabek  FROM eket  WHERE ebeln = ekko-ebeln.
        loop at itabek into waek.
          ebli =  ebli + 1.
          waek-eindx = ebli.
          modify itabek from waek.
        endloop.
        loop at itabek into waek where ebelp = utab-ebelp.
          eblc = waek-eindx.
          condense eblc.
        endloop.
        AT NEW ebeln.
          PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=MECHOB'.
          PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0002'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=MEOK'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'MEPO_SELECT-EBELN'.
          PERFORM bdc_field       USING 'MEPO_SELECT-EBELN'
                                         utab-ebeln.
          AT New EBELP.
            perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
            perform bdc_field       using 'BDC_CURSOR'
                                      'DYN_6000-LIST'.
            perform bdc_field       using 'DYN_6000-LIST'
                                     eblc.
            perform bdc_field       using 'BDC_OKCODE'
                                          '=DDOWN3200'.
            PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=TABIDT15'.
            perform bdc_field       using 'DYN_6000-LIST'
                                    eblc.
            PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          'PICK'.
          ENDAT.
        ENDAT.
        PERFORM bdc_field       USING 'DYN_6000-LIST'
                                          eblc.
        recno = recno + 1.
        cstr = recno.
        counter = cstr.
    *This is to check whether the scheduled line item exceeding 12 rows. if so, use *page up
        if counter >= 13.
          rows = counter MOD 13.
          istr = ( ( counter - rows ) / 13 ).
          do istr times.
            perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
            perform bdc_field       using 'BDC_OKCODE'
                                    '=EINB_CREATE'.
          enddo.
          DO 2 TIMES.
            perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
            perform bdc_field       using 'BDC_OKCODE'
                                    '=P+'.
          enddo.
          COUNTER = '03'.
          cstr = '03'.
        ENDIF.
        CONCATENATE 'EKES-EBTYP('  cstr  ')' INTO var.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                          var.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
        PERFORM bdc_field       USING var
                                    utab-ebtyp.
        CONCATENATE 'RM06E-EEIND('  cstr  ')' INTO var.
        PERFORM bdc_field       USING var
                                       utab-eeind.
        CONCATENATE 'EKES-MENGE('  cstr  ')' INTO var.
        PERFORM bdc_field       USING var
                                       utab-menge.
        CONCATENATE 'J_3ASZDI-J_3ASIZED('  cstr  ')' INTO var.
        PERFORM bdc_field       USING var
                                       utab-j_3asize.
        AT END OF Ebelp.
          PERFORM bdc_dynpro      USING 'SAPLMEGUI' '0014'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=MESAVE'.
          perform bdc_dynpro      using 'SAPLMEGUI' '0014'.
          perform bdc_field       using 'BDC_OKCODE'
                                    '/00'.
          CALL TRANSACTION 'ME22N' USING bdcdata MODE 'E'.
          IF sy-subrc EQ 0.
            savedone = 'Y'.
            saveflag = 'Y'.
            initflag = 'N'.
            MESSAGE 'SAVED' TYPE 'I'.
          else.
            saveflag = 'N'.
            savedone = 'N'.
            initflag = 'Y'.
            MESSAGE 'Not Saved' Type 'I'.
          endif.
          CLEAR: bdcdata.
          REFRESH bdcdata.
        ENDAT.
      ENDLOOP.
    ENDFORM.
    Hope this will help u

  • Need information on BAPI for Sales Process ?

    Hello SAP folks,
    I am currently involved in Consumer Portal integration with SAP System. I need information about the right kind of BAPI that would help me to enter and retrieve data from SAP database. I have noted down following funtionality in Sales And Distribution areas where i require a BAPI :
    1. Account Management -- > There are concept of Sales rep, Dealer on the consumer Portal. My question is -- > Could anyone suggest some BAPI for creation of User ID for Sales rep and Dealer as well i need information on the BAPI which would also help me displaying the data from SAP database. As far i know, in Customer Master record, we maintain Contact person and Buiness Partners. So how to take up these development into consideration ???
    2. Mulitple Credit Card Management --> Please suggest the BAPI for meeting this functionality at Sales order level.
    3. Customer Inclusion/Exclusion --> Here the basic need is exclude certain customer from availabling some product. Please suggest the BAPI for this operation.
    Regards,
    Sarthak

    Dear Sarthak M,
               Assume you have gone through the transaction BAPI,
    where you can find all relevant BAPI's .
    select the relevant text such as "sales orders" - from the right side of the screen - check "Tools" tab,where you will find "Create BAPI list", click to search for the Function moduels.

  • BAPI for return/supplement the funds for both overall and fiscal year.

    I have a development requirement for following and I am new to Investment ,management and Project
    Systems functionality.
    Your help will be appreciated
    The new transaction will use the upload data to create returns and/or supplements to Marketing budgets.  The following is what the transaction will do per request:
    •     Verify funds are available to shift.  The program will do this by creating an error log for items that do not meet this criteria.  The program will process all line items that have available funds (IM52).
    Q pls let me know what BAPi/FM to use to verify whether funds are vailable or not
    •     Return the funds for both overall and fiscal year (IM52).
    Q Pls tell me BAPI for same
    •     Supplement the funds for bother overall and fiscal year (IM52).
    Q BAPI for same
    •     Deactivate the availability control for the WBSE’s affected (CJBW).
    Q  How to do that and BAPI/FM for same
    •     Activate the availability control for the WBSE’s affected (CJBV).
    Q  How to do that and BAPI/FM for same
    •     Add appropriate text from the data in the upload spreadsheet (this may be a concatenation of data from the columns in the upload) (IM52).
           Not clear what user is trying to say
    •     The transaction needs to be able to handle whole dollars as well as numbers that might include up to two decimals:  e.g. .01 (IM52).

    I am answering my own question since i completed the above development by using the FM KBPV_POST_DATA .
    It will post to all the BP tables and is tested successfully.

  • BAPI for trx F-03

    Hi Guru there.
    i been using BDC method to execute <b>F-03</b> in my program.
    it works good if there are 1,000 itmes in one program.
    but this time it went for 4000 items and bdc program ran in to page overflow creating such huge bdc session.
    >><b>Does anybody know if there is a BAPI for transaction F-03 ?</b>
    Thanks
    SAndeeP

    Hi
    This is a code I've used to clear the items:
    Open file
    OPEN DATASET ZFAGTB01-FILENAME FOR OUTPUT IN TEXT MODE.
    Session data
    PERFORM FILL_NO_DATA USING BGR00 'BGR00'.
    BGR00-STYPE  = '0'.
    BGR00-GROUP  = ZFAGTB01-ZGROUP.
    BGR00-MANDT  = SY-MANDT.
    BGR00-USNAM  = SY-UNAME.
    BGR00-START  = SPACE.
    BGR00-XKEEP  = 'X'.
    BGR00-NODATA = '/'.
    TRANSFER BGR00 TO ZFAGTB01-FILENAME.
    Header data
    PERFORM FILL_NO_DATA USING BBKPF 'BBKPF'.
    BBKPF-STYPE = '1'.
    BBKPF-TCODE = 'FB05'.
    BBKPF-BLART = ZFAGTF02-BLART.
    BBKPF-BUKRS = BSIK-BUKRS.
    BBKPF-WAERS = BSIK-WAERS.
    BBKPF-AUGLV = 'UMBUCHNG'. "Transfer posting with clearing
    WRITE: P_BUDAT TO BBKPF-BUDAT,
           P_BLDAT TO BBKPF-BLDAT.
    TRANSFER BBKPF TO ZFAGTB01-FILENAME.
    Data for selection
    PERFORM FILL_NO_DATA USING BSELK 'BSELK'.
    BSELK-STYPE  = '2'.
    BSELK-TBNAM  = 'BSELK'.
    BSELK-AGKON  = BSIK-LIFNR.
    BSELK-AGBUK  = BSIK-BUKRS.
    BSELK-AGKOA  = 'K'.
    IF BSIK-UMSKZ IS INITIAL.
    BSELK-XNOPS = 'X'.
    ELSE.
    BSELK-AGUMS  = BSIK-UMSKZ.
    ENDIF.
    TRANSFER BSELK TO ZFAGTB01-FILENAME.
    PERFORM FILL_NO_DATA USING BSELP 'BSELP'.
    BSELP-STYPE    = '2'.
    BSELP-TBNAM    = 'BSELP'.
    BSELP-FELDN_1  = 'ZUONR'.
    BSELP-SLVON_1   = BSIK-ZUONR.
    TRANSFER BSELP TO ZFAGTB01-FILENAME.
    CLOSE DATASET ZFAGTB01-FILENAME.
    SUBMIT RFBIBL00 WITH DS_NAME  = ZFAGTB01-FILENAME
                      WITH CALLMODE = 'B' AND RETURN.
    In my situation I cleared vendor items but perhaps you can close G/L items.
    Max

  • Bapi for the transaction FBRA, FB08, FB01 anf FD02

    hi,
    can any one please help me with BAPI for the following transaction?
    FBRA - reset cleared items
    FB08 - reversal of the documents
    FB01 - post documents
    FD02 - change customer.
    regards kriti

    Hi
    Copy the below  program in se38 and execute the program and along with the transaction code you need to specify the program name to obtain the program name all you have to do is execute the t-code and go to system--> status and copy the program name from the screen and paste it in the above program.
    tables : tstc,
             tadir,
             modsapt,
             modact,
             trdir,
             tfdir,
             enlfdir,
             sxs_attrt ,
             tstct.
    data :
       jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode,
    p_pgmna like tstc-pgmna .
    data wa_tadir type tadir.
    start-of-selection.
      if not p_tcode is initial.
        select single * from tstc where tcode eq p_tcode.
      elseif not p_pgmna is initial.
        tstc-pgmna = p_pgmna.
      endif.
      if sy-subrc eq 0.
        select single * from tadir
        where pgmid = 'R3TR'
        and object = 'PROG'
        and obj_name = tstc-pgmna.
        move : tadir-devclass to v_devclass.
        if sy-subrc ne 0.
          select single * from trdir
          where name = tstc-pgmna.
          if trdir-subc eq 'F'.
            select single * from tfdir
            where pname = tstc-pgmna.
            select single * from enlfdir
            where funcname = tfdir-funcname.
            select single * from tadir
            where pgmid = 'R3TR'
            and object = 'FUGR'
            and obj_name eq enlfdir-area.
            move : tadir-devclass to v_devclass.
          endif.
        endif.
        select * from tadir into table jtab
        where pgmid = 'R3TR'
        and object in ('SMOD', 'SXSD')
        and devclass = v_devclass.
        select single * from tstct
        where sprsl eq sy-langu
        and tcode eq p_tcode.
        format color col_positive intensified off.
        write:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        skip.
        if not jtab[] is initial.
          write:/(105) sy-uline.
          format color col_heading intensified on.
          * sorting the internal table
       sort jtab by object.
          data : wf_txt(60) type c,
          wf_smod type i ,
          wf_badi type i ,
          wf_object2(30) type c.
          clear : wf_smod, wf_badi , wf_object2.
          * get the total smod.
          loop at jtab into wa_tadir.
            at first.
              format color col_heading intensified on.
              write:/1 sy-vline,
              2 'Enhancement/ Business Add-in',
              41 sy-vline ,
              42 'Description',
              105 sy-vline.
              write:/(105) sy-uline.
            endat.
            clear wf_txt.
            at new object.
              if wa_tadir-object = 'SMOD'.
                wf_object2 = 'Enhancement' .
              elseif wa_tadir-object = 'SXSD'.
                wf_object2 = ' Business Add-in'.
              endif.
              format color col_group intensified on.
              write:/1 sy-vline,
              2 wf_object2,
              105 sy-vline.
            endat.
            case wa_tadir-object.
              when 'SMOD'.
                wf_smod = wf_smod + 1.
                select single modtext into wf_txt
                from modsapt
                where sprsl = sy-langu
                and name = wa_tadir-obj_name.
                format color col_normal intensified off.
              when 'SXSD'.
                * for badis
             wf_badi = wf_badi + 1 .
                select single text into wf_txt
                from sxs_attrt
                where sprsl = sy-langu
                and exit_name = wa_tadir-obj_name.
                format color col_normal intensified on.
            endcase.
            write:/1 sy-vline,
            2 wa_tadir-obj_name hotspot on,
            41 sy-vline ,
            42 wf_txt,
            105 sy-vline.
            at end of object.
              write : /(105) sy-uline.
            endat.
          endloop.
          write:/(105) sy-uline.
          skip.
          format color col_total intensified on.
          write:/ 'No.of Exits:' , wf_smod.
          write:/ 'No.of BADis:' , wf_badi.
        else.
          format color col_negative intensified on.
          write:/(105) 'No userexits or BADis exist'.
        endif.
      else.
        format color col_negative intensified on.
        write:/(105) 'Transaction does not exist'.
      endif.
    at line-selection.
      data : wf_object type tadir-object.
      clear wf_object.
      get cursor field field1.
      check field1(8) eq 'WA_TADIR'.
      read table jtab with key obj_name = sy-lisel+1(20).
      move jtab-object to wf_object.
      case wf_object.
        when 'SMOD'.
          set parameter id 'MON' field sy-lisel+1(10).
          call transaction 'SMOD' and skip first screen.
        when 'SXSD'.
          set parameter id 'EXN' field sy-lisel+1(20).
          call transaction 'SE18' and skip first screen.
      endcase.
    Regards
    Pavan

  • BAPI for T.Code F-02

    Hi Dear Friends,
    Thanks in Advance.
    Is there any BAPI for the Transaction F-02.
    Regards;
    Sridhar.J

    Hi.
    Business Add-in
    050S008                                FIDCC1, FIDCC2 Inbound IDoc: Update Comparison Ledger
    BAS_CIN_LTAX1F02                       Tax interface
    BAS_CIN_MF05AFA0                       EWT - Downpayment Clearing - Tax transfer for CIN
    ISPLIT                                 Online Split: Cash Discount, Exchange Rate Differences
    I_AUTHORITY_ITEM                       Extended Authorization Check for Document Display (FB03)
    I_DOC_DISP_LI                          Diversion to Document Items (FB03)
    I_FB08_SUBST_BUDAT                     FB08: Check Posting Date for Reversal of FI Doc. with FB08
    I_GET_INV_PYMT_AMT                     BAdI for determining the payment amount for an invoice
    I_HEADER_SUB_1300                      Screen Enhancement for Document Header SAPMF05A
    I_PAYREF_BADI_010                      BAdI: Payment Reference Number
    I_RES_ITEM_CURRENCY                    Document of Residual Item with Invoice Currency
    I_TRANS_DATE_DERIVE                    Derive BKPF-WWERT from Other Document Header Data
    NVOIC_FI_INBOUND                       BADIs for Inbound IDoc INVOIC FI (Vendor Invoice)
    FESR000_BADI_001                       BAdI for Own Processing of POR Item
    VFZ                                    Replacement for Function Modules of Function Group FVFZ
    C_QUANTITY_GET                         Transfer of Quantities to Accounting - Customer Exit
    DJUST_NET_DAYS                         Change to Net Due Date
    ADI_ENJ_ALT_ADR                        Go to alternative vendor/customer data
    ADI_F040_SCREEN_600                    Screen Enhancement on F040 0600 Document Header
    ADI_FDCB_SUBBAS01                      Screen Enhancement 1 on FDCB Basic Data Screen (010, 510)
    ADI_FDCB_SUBBAS02                      Screen Enhancement 2 on FDCB Basic Data Screen (010, 510)
    ADI_FDCB_SUBBAS03                      Screen Enhancement 3 on FDCB Basic Data Screen (010, 510)
    ADI_FDCB_SUBBAS04                      Screen Enhancement 4 on FDCB Basic Data Screen (010, 510)
    ADI_FDCB_SUBBAS05                      Screen Enhancement 5 on FDCB Basic Data Screen (010, 510)
    ADI_PRKNG_NO_UPDATE                    BAdI for Deactivating Update of Parked Documents
    Enhancement/ Business Add-in            Description
    Enhancement
    FARC0002                                Additional Checks for Archiving MM Vendor Master Data
    F180A001                                Balance Sheet Adjustment
    F050S007                                FIDCCH Outbound: Influence on IDoc for Document Change
    F050S006                                FI Outgoing IDoc: Reset Clearing in FI Document
    F050S005                                FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
    F050S004                                FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
    F050S003                                FIDCC2: Change IDoc/do not send
    RFAVIS01                                Customer Exit for Changing Payment Advice Segment Text
    RFEPOS00                                Line item display: Checking of selection conditions
    RFKORIEX                                Automatic correspondence
    SAPLF051                                Workflow for FI (pre-capture, release for payment)
    F050S001                                FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
    F050S002                                FIDCC1: Change IDoc/do not send
    Regards.
    Jay

  • BAPI for vendor credit memo posting by FB65

    Hi guys,
    I need a BAPI to post vendor credit note by FB65.
    I am trying BAPI_ACC_DOCUMENT_POST, but I cannot find the fields to fill with the information we input at FB65 Payment tab, such as: Inv. Ref (document, year and item ).
    Could anybody help me?
    Cheers,
    Karla.

    HI ,
    Please Find below the relevant code to Fill the Fields while calling the BAPI for FB65
    step1.
    First of all fill the wa_bapiheader.
    *header data
        wa_bapiheader-username = sy-uname.
        wa_bapiheader-comp_code = wa_final-bukrs.
        wa_bapiheader-doc_date = sy-datum.
        wa_bapiheader-pstng_date = sy-datum.
        wa_bapiheader-doc_type = c_blart.
        wa_bapiheader-ref_doc_no = 'GROWPAY'.   "Can be the refrence text
        w_waers = wa_final-waers.
    Step2.
    Fill this internal table. i_currencyamount  and i_accountgl.
    i_final will be the Internal table conating all the Relevant data for Posting the Document.
    Loop at  i_final into wa_final.
    ADD 1 TO w_acc_lno.
        wa_accountgl-itemno_acc = w_acc_lno.        
        wa_accountgl-gl_account = wa_final-saknr.    "G/L Account
        wa_accountgl-plant = wa_final-werks.             " Plant
        wa_accountgl-costcenter = wa_final-kostl.       " Cost Center
        wa_accountgl-cond_type = wa_final-knumv.    "From EKKO for the Purchase Order
        wa_accountgl-po_number = wa_final-ebeln.    " Purchase Order no
        wa_accountgl-po_item = wa_final-ebelp.         " Line item in PO
        APPEND wa_accountgl TO i_accountgl.
        CLEAR : wa_accountgl.
        wa_currencyamount-itemno_acc = w_acc_lno.
        wa_currencyamount-currency = wa_final-waers.
        wa_currencyamount-amt_doccur = wa_final-kbetr.
        w_sum = w_sum + wa_final-kbetr.
        APPEND wa_currencyamount TO i_currencyamount.     " G/L line item
        CLEAR : wa_currencyamount.
    *item  data
          wa_accountpayable-itemno_acc = 1.
          wa_accountpayable-vendor_no = wa_final-lifnr.
          APPEND wa_accountpayable TO i_accountpayable.
    *Amount for the vendor line item.
          CLEAR : wa_currencyamount.
          wa_currencyamount-itemno_acc = 1.
          wa_currencyamount-currency = w_waers.
          wa_currencyamount-amt_doccur = 0 - w_sum.
          INSERT  wa_currencyamount INTO i_currencyamount INDEX 1.
    Step 3.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
              EXPORTING
                documentheader = wa_bapiheader
              TABLES
                accountgl           = i_accountgl
                currencyamount = i_currencyamount
                accountpayable = i_accountpayable
                return                 = i_result_out.
    i_result_out will conatin the messages returned by the BAPI.
        based on i_resuklt_out that is if the posting is Successful....call commit
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
                     Wait = X.
    Endloop.
    I hope the above code may solve your problem....Thanks
    Regards ,
    Sonu Krishna.
    Edited by: Sonu Krishna PV on Aug 6, 2009 11:03 AM

Maybe you are looking for

  • Bapi is used to 'post incoming payments (t-code F-28)'

    hi all can any one tell which bapi is used to 'post incoming payments (t-code F-28)'. thanks in advance, lokesh

  • Having trouble syncing

    I went to sync my iPad, and I updated the iTunes as it asked. Yet, at the same point each time, I get an error message saying my iPad has been disconnected. However it still says it is syncing on my actual iPad and there is no fault with the connecti

  • BSP Problem in EP

    Hi All, I am facing the BSP problem in the EP my problem is ... Business Server Page (BSP) error What happened? Calling the BSP page was terminated due to an error. SAP Note The following error text was processed in the system: BSP Exception: Das Obj

  • Add photos to an existing project

    Can I add new photos to an existing Aperture 3 project? I imported a number of images, named the project and it's in Aperture. I have now taken some additional shots fo the same subject, so can I import directly, or do I create a new project and "mer

  • E63: the Wifi connectivity problem

    Hi there! I have a Nokia E-63 phone and i am finding problems while trying to connect it to my home Wifi. Just to make my problem clear, here is some info about my connection: The wireless configuration is as shown here Wireless info. The ISP is Airt