Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error 'SE117 General error during acceptance posting' in BAPI_ENTRYSHEET_CREATE

former_member459142
Participant
0 Kudos

Hi Experts,

I am trying to create Service entry sheet(ML81N) from PO for single line item  using BAPI_ENTRYSHEET_CREATE bapi.

Service entry is created but i am also getting error message 'SE117 General error during acceptance posting'.

i am not able to troubleshoot that problem . Kindly help me, below i am giving code which i did.

  CALL FUNCTION 'BAPI_PO_GETDETAIL'
    EXPORTING

      purchaseorder    = PO_NUMBER

      items            = 'X'
      services         = 'X'
    IMPORTING
      po_header        = wa_po_header
    TABLES
      po_items         = po_items
      po_item_services = po_services

      return           = bapi_return_po.


DELETE po_items WHERE PO_ITEM <> item.
SELECT SINGLE * INTO LW_EKPO FROM ekpo WHERE EBELN = PO_NUMBER

                                  AND EBELP = item.

SELECT SINGLE * from esll  INTO lw_esll WHERE PACKNO = LW_EKPO-PACKNO .
DELETE po_services WHERE PCKG_NO <> lw_esll-PACKNO and PCKG_NO <> lw_esll-SUB_PACKNO.
DELETE po_services WHERE EXT_LINE is INITIAL.

  wa_header-po_number = po_items-po_number.
  wa_header-po_item = po_items-po_item.

  wa_header-short_text = 'Sample'.
  wa_header-pckg_no = 1.
wa_header-doc_date = sy-datum.
wa_header-post_date = po_items-price_date.

wa_header-acceptance = 'X'.

  line_no = 1.
  bapi_esll-pckg_no = 1.
  bapi_esll-line_no = line_no.

  bapi_esll-outl_level = '1'.
  bapi_esll-outl_ind = 'X'.
  bapi_esll-subpckg_no = 2.
     bapi_esll-short_text = po_services-short_text.

  APPEND bapi_esll.


  LOOP AT po_services WHERE NOT short_text IS INITIAL.
    CLEAR bapi_esll.
  
line_no = line_no + 1.
    bapi_esll-pckg_no = 2.
    bapi_esll-line_no = line_no.
    bapi_esll-service = po_services-service.
    bapi_esll-quantity = po_services-quantity.
    bapi_esll-gr_price = po_services-gr_price.
    bapi_esll-target_val = po_services-gr_price.
    bapi_esll-price_unit = po_services-price_unit.
    bapi_esll-ext_line = '10'.
    APPEND bapi_esll.
  ENDLOOP.

  CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
  EXPORTING
  entrysheetheader = wa_header
* testrun = 'X'
  IMPORTING
  entrysheet = SERVCE_NO
  TABLES
* ENTRYSHEETACCOUNTASSIGNMENT =
  entrysheetservices = bapi_esll
* entrysheetsrvaccassvalues = i_service_acc
  return = LT_RETURN

* entrysheetservicestexts = i_service_text
* ENTRYSHEETHEADERTEXT =
.

  DATA: ws_wait TYPE bapita-wait.

  ws_wait = '3'.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT

    EXPORTING
      wait = ws_wait.

1 ACCEPTED SOLUTION

Private_Member_49934
Contributor
0 Kudos

Not much idea. But check out if the last reply of the the below thread makes sense to you

http://scn.sap.com/thread/707056

1 REPLY 1

Private_Member_49934
Contributor
0 Kudos

Not much idea. But check out if the last reply of the the below thread makes sense to you

http://scn.sap.com/thread/707056