Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error while creation of service entry via BAPI_ENTRYSHEET_CREATE

Hi All,

I am struggling while creation of service entry using the BAPI, BAPI_ENTRYSHEET_CREATE. I am getting error ""No account assignment exists for service line 0000000010". I am passing the essr, eskn,eskl, esll structures as-

Please help sorting out what is the issue in the parameters, I am able to manually create an SER via ML81N though.

CALL FUNCTION 'BAPI_PO_GETDETAIL'

EXPORTING

PURCHASEORDER = WS_PO

ITEMS = 'X'

SERVICES = 'X'

IMPORTING

PO_HEADER = WA_PO_HEADER

TABLES

PO_ITEMS = PO_ITEMS

PO_ITEM_SERVICES = PO_SERVICES

RETURN = BAPI_RETURN_PO.

  • Entry sheet header

LOOP AT PO_ITEMS.

BAPI_ESSR-PO_NUMBER = PO_ITEMS-PO_NUMBER.

BAPI_ESSR-PO_ITEM = PO_ITEMS-PO_ITEM.

BAPI_ESSR-SHORT_TEXT = 'Sample'.

  • bapi_essr-acceptance = 'X'.

BAPI_ESSR-DOC_DATE = SY-DATUM. " wa_po_header-doc_date.

BAPI_ESSR-POST_DATE = SY-DATUM. "po_items-price_date.

IF PO_ITEMS-ACCTASSCAT = 'U'.

BAPI_ESSR-ACCASSCAT = 'K'.

ELSE.

BAPI_ESSR-ACCASSCAT = PO_ITEMS-ACCTASSCAT.

ENDIF.

BAPI_ESSR-PCKG_NO = PO_ITEMS-PCKG_NO.

APPEND BAPI_ESSR.

ENDLOOP.

LINE_NO = 1.

SERIAL_NO = 0.

LOOP AT PO_SERVICES. " WHERE NOT short_text IS INITIAL.

CLEAR BAPI_ESLL.

BAPI_ESLL-PCKG_NO = PO_SERVICES-PCKG_NO.

BAPI_ESLL-LINE_NO = LINE_NO.

BAPI_ESLL-EXT_LINE = PO_SERVICES-EXT_LINE.

BAPI_ESLL-OUTL_IND = PO_SERVICES-OUTL_IND.

BAPI_ESLL-SUBPCKG_NO = PO_SERVICES-SUBPCKG_NO.

BAPI_ESLL-SERVICE = PO_SERVICES-SERVICE.

BAPI_ESLL-BASE_UOM = PO_SERVICES-BASE_UOM.

BAPI_ESLL-UOM_ISO = PO_SERVICES-UOM_ISO.

BAPI_ESLL-PRICE_UNIT = PO_SERVICES-PRICE_UNIT.

BAPI_ESLL-FROM_LINE = PO_SERVICES-FROM_LINE.

BAPI_ESLL-TO_LINE = PO_SERVICES-TO_LINE.

BAPI_ESLL-SHORT_TEXT = PO_SERVICES-SHORT_TEXT.

BAPI_ESLL-PLN_PCKG = '2'.

BAPI_ESLL-PLN_LINE = LINE_NO.

APPEND BAPI_ESLL.

LINE_NO = LINE_NO + 1.

ENDLOOP.

    • Now we wanted to create SES based on entered Quantity & NetValue.

LOOP AT BAPI_ESLL.

IF BAPI_ESLL-LINE_NO = '2'.

BAPI_ESLL-QUANTITY = PO_SERVICES-QUANTITY.

BAPI_ESLL-GR_PRICE = WS_PR. "po_services-gr_price.

MODIFY BAPI_ESLL INDEX SY-TABIX TRANSPORTING QUANTITY GR_PRICE.

ENDIF.

ENDLOOP.

LOOP AT PO_ITEMS.

CLEAR BAPI_ESKL.

BAPI_ESKL-LINE_NO = 2.

BAPI_ESKL-SERNO_LINE = 1.

BAPI_ESKL-PERCENTAGE = 100.

BAPI_ESKL-SERIAL_NO = 1.

APPEND BAPI_ESKL.

SERIAL_NO = SERIAL_NO + 1.

BAPI_ESKN-GL_ACCOUNT = PO_ITEMS-MAT_GRP.

BAPI_ESKN-PCKG_NO = '2'.

BAPI_ESKN-SERIAL_NO = SERIAL_NO.

APPEND BAPI_ESKN.

ENDLOOP.

CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'

EXPORTING

ENTRYSHEETHEADER = BAPI_ESSR

TESTRUN = ''

IMPORTING

ENTRYSHEET = WS_ENTRYSHEET_NO

TABLES

ENTRYSHEETACCOUNTASSIGNMENT = BAPI_ESKN

ENTRYSHEETSERVICES = BAPI_ESLL

ENTRYSHEETSRVACCASSVALUES = BAPI_ESKL

RETURN = I_RETURN.

Thanks!!

Former Member
Not what you were looking for? View more on this topic or Ask a question