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>

Similar Messages

  • BAPI for Open production orders

    Hi All,
    Any BAPI for open production orders?.... Using BAPI i want to upload open production orders informatiomations.... Please help
    Thanks & Regards
    Santhosh

    Hi,
       Please check the following BAPI,
    Goto BAPI tcode, select hierarchical tab
      Production orders,ProductionOrder ,ProdOrdConfirmation , RCVPRORDCF and check the BAPIs

  • Bapi for Open Projects Cost in PS

    HI,
    I need a bapi or funcation module for Open Projects Cost in PS .
    thanks.

    Hi,
    Refer this :
    http://www.sapbapi.com/bapi-list/

  • BAPI for Open Sales Order

    Experts,
    I need a BAPI for list of Sales order against which the invoice has not been generated.  I need to pass date and bapi shall return list of sales order that are not invoiced.
    Thanks
    Harsh

    Hi Frederic
    Sure it does.
    Actually I want to send data from SAP to some .net application. I thought using BAPI would make the job easier.
    Anyways thanks.
    Regards
    Harsh

  • BAPI for open bal for GL?

    Can anyone know the std SAP function module/BAPI that is being able to leverage for calculating the Open Balance of a GL Account?
    Thanks in advance
    Kumar

    hi kumar
    For period wise balances we have the following two BAPI functions. Check whether you can reuse the code written in these BAPI's.
    BAPI_GL_GETGLACCPERIODBALANCES
    BAPI_GL_ACC_GETPERIODBALANCES
    Also look at program RFBUSU00.
    Regards
    naveen

  • BAPI for clear open item in FI module

    Hiu2026
    Anybody knows if there is a BAPI for clear open item in FI module?
    Manually we can use F-03 or F-04 for clearing open item.

    http://www.se80.co.uk/sapfms/b/bapi/bapi_ctraccontractaccount_clr.htm

  • BAPI:Create sales order from an existing open sales order for open items

    Dear All,
    Could any one suggest me any BAPI that can create sales order from an existing OPEN sales order for OPEN items. since we are closing all open orders and creating new orders with reference to existing open orders.   please suggest, its would be great help.
    Regards,
    Reddy

    hi suresh,
    we are changing tax procedure from formula to condition based, so this is the reason we have close all the open orders and recreate in TAXINN procedure, it is going to be large number of records( open orders), so....
    Regards,
    Reddy

  • List OF  Dependent ,Beneficiary,Investment for open enrollment by bapis..

    Hi,
    I wanted a know if there is a bapi  to get the  Dependent ,Beneficiary,Investment for open enrollmen benifit by bapis..
    Thank's

    Hi Brian,
    This is not webdynpro related question, try to post at specified forum.
    Try to search before posting.. u get from google or sdn.. I think u are looking HR related BAPIS..
    Go through this..
    http://saphrexpert.blogspot.com/2009/01/list-of-hr-bapirfcs-part-3.html
    Cheers,
    Kris.

  • Bapi for uploading opening balances for AUC

    Hi All experts,
    I want Bapi for uploading opening balances for AUC.
    Please help me its urgent.

    hi ,
    try
    BAPI_GL_GETGLACCBALANCE - closing balance of G/L account for a chosen year.
    BAPI_GL_GETGLACCCURRENTBALANCE - closing balance of G/L account for the current year
    BAPI_GL_GETGLACCPERIODBALANCES - Posting period balances for each G/L account.

  • Bapi or method for opening and closing quantity of material

    Hi Friends,
    Is there any Bapi or Method for Opening and Closing Balence quantity of material
    plz tell me if any.
    Thanks And Regards.
    Devalla T Kr.

    Hi ,
    try this one.
    https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action&pageid=15856
    from this code u need to ignore Ztables.
    regards
    Prabhu

  • BAPI for uploading SUBCON open purchase Order

    Hi,
    Can any one tell me a BAPI for creating SUBCON Purchase order....

    Hello,
    BAPI_PO_CREATE and BO: BUS2012.
    BAPIEKPOC = ITEM_CAT (3 - Subcontracting)
    <b>Rewrad points</b>
    Regards

  • LSMW for Open Production Order Creation

    Hi all,
    I want to migrate open production orders from legacy system to the other SAP system. Please let me know how should I do it?
    I tried using the idoc method with  Message type LOIPRO and the Basic Type LOIPRO01 but the it gives a error that No process code for message type LOIPRO. I guess this is a Outbound Idoc.
    Next I tried searching for a BAPI for prodcution orders. I found the BAPI,   BAPI_PRODORD_CREATE. But it does not contain all the fields I need. Also this BAPI cannot be used in LSMW as it ALE message type does not exist for it.
    So please let me know how can I use the idoc method to create the production order as I have all the fields required in the idoc basic type. Also please share if any other method is there to upload the data.
    Regards,
    Mozila

    We had to use BAPIs to upload the production orders.
    It was not possible with LSMW.

  • Bapi for vendor payment with details of tunover and blocked payment

    Dear all
    I want to know whether any BAPI available for the details of vendor payment made and the open item with  blocked payment (with the reason for the blocked payment) and the turnover of the vendor for a particular fiscal year...................
    The client want to get the output as mentioned below.
    e.g...
    PO no : 45629810
    Inv.No : 73409 (Vendor's Invoice no.)
    Payment : Paid amt with date and details
    Payment : Outstanding (Due and Over Due with no.of days)
    Blocked Payment : Amt with the reason for blocking the payment.
    Turn Over : Total turn over for that fiscal year.
    This is an urgent req. from my client,i will be very grateful if any one can  help me over this issue ..............
    Appreciate for any relevant answers and suggestion ...........
    I am in ECC 6.0
    Regards
    Praveen

    Hello Raj,
    Unfortunately there is no BAPI for payment detals and other company code data. The only possibility is via direct input (external data transfer).
    Please have a look at the following Easy-Access-path:
    SAP Menu
    -> Accounting
      -> Bank Applications
       -> Loans Management
        -> Environment
         -> External Data Transfer
    Within this menu entry you find diverse functions. Please start the function KCLJ to transfer data. Before you can do this you need to
    prepare the transfer by creating your own transfer structure and so on. You can get further information on what to do here by navigating to
    "Help   > Application help" within transaction KCLJ. From here you get to the right area of SAP library.
    Thanks Amber

  • Data migration for open PO & PR

    Hi All,
    How to do the data migration for Open PO & Open PR ?
    Thanks
    pabi

    You can BAPI "BAPI_REQUIREMENT_CREATE" for PR creation from data.
    BAPI_PO_CREATE for PO creation.
    Regards
    Sanjay Kohli

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

Maybe you are looking for

  • Hi, urgent!!  I can`t see my Projct panel anymore! How can I get it back?

    when i started the project i set up a project panel. At one point it was gone. I Perhaps i deleted or closed it, I don`t know. How can i open it up again? In the pulldown "window"   "Project"  has a hook, but I don`t see the Panel. Simple thing actua

  • OrgChart 3.0 SP1

    Product Information Name OrgChart Version 3.0 SP1 Build 0701040400 Hi we are having problems bringing the the objects that where created with the language spanish. On listing we are only getting 8 results for a search that in R/3 is getting a lot of

  • Xcelsius 2008 : BO XI SSL ISSUE

    Post Author: FLugand CA Forum: Xcelsius and Live Office BO XI R2 SP2 with SSL certificate. We have an issue with IE and the URL button. The URL doesn't load. https://server:8443/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDo

  • Does FCP perform better than adobe premiere elements on a MacBook Pro?

    does FCP perform better than adobe premiere elements on a MacBook Pro? Background: * just trying to decide what to go for re video editing app with more features than iMovie * last time I'd tried Adobe Premiere Elements on my MacBook (but it was befo

  • Zen Xtra probl

    Hi, I've had my Zen Xtra 40 gig for almost a year now, and have had no problems, except for the fact that i'd get static in the right earbud every once in awhile, but now I've encountered a really big problem. Every single song i play, comes out like