‎2009 Sep 14 2:18 PM
Hello all,
I know the question was already posted before but since I haven't found the answer to it, here it is again.
We need to create a new service entry sheet and we are using the FM BAPI_ENTRYSHEET_CREATE. It is important to remark that the field header-acceptance should be EMPTY. We are passing all the tables and it is creating the entry sheet, but the thing is that it's creating it without any service item.
So if anyone knows how to fix this I would really appreciate the help.
Thanks in advance.
‎2009 Sep 14 3:03 PM
Hi,
Have you passed all three table parameters?
We create a service entrysheet with line items with saved status. Probably you might missing some fields.
call function 'BAPI_ENTRYSHEET_CREATE'
exporting entrysheetheader = w_header
testrun = testrun
no_commit = testrun
importing entrysheet = w_sheet_no
tables entrysheetservices = i_services
entrysheetaccountassignment = i_accountasignment
entrysheetsrvaccassvalues = i_srvaccess
return = i_return.
thanks,
Venkat
‎2009 Sep 14 3:12 PM
Hi Venkat,
Thanks for your replay, yes we are passing all three tabs and still the entry sheet is created without service line.
Regards.
‎2009 Sep 14 4:41 PM
The problem is probably how you fill the parameters, so could you explain what fields you fill with what value?
‎2009 Sep 14 6:17 PM
Hi Sandra,
Here is how we fill the tables:
w_header-po_number = w_po_items-po_number.
w_header-po_item = w_po_items-po_item.
w_header-begdate = sy-datum.
w_header-enddate = sy-datum.
w_header-pckg_no = '1'.
w_header-person_int = sy-uname.
w_header-person_ext = sy-uname.
w_header-short_text = 'Sample'.
w_header-accasscat = 'K'.
w_header-doc_date = sy-datum.
w_header-post_date = sy-datum.
w_header-ref_doc_no = 'Sample'.
w_header-ref_doc_no_long = 'Sample'.
*REMEMBER WE DO NOT WANT THE FIELD ACCEPTANCE = X.
* Assume we read first line of table ESLL for that PO item
w_bapi_esll-pckg_no = 1.
w_bapi_esll-line_no = line_no.
w_bapi_esll-outl_level = '0'.
w_bapi_esll-outl_ind = 'X'.
w_bapi_esll-subpckg_no = '2'.
w_bapi_esll-quantity = w_po_services-quantity.
APPEND w_bapi_esll
TO i_bapi_esll.
w_account_values-line_no = line_no.
w_account_values-serial_no = '1'.
w_account_values-quantity = w_po_services-quantity.
APPEND w_account_values to i_bapi_eskl.
* Assume we read the following lines of ESLL
line_no = line_no + 1.
CLEAR w_bapi_esll.
w_bapi_esll-pckg_no = '2'.
w_bapi_esll-line_no = line_no.
w_bapi_esll-service = w_po_services-service.
w_bapi_esll-quantity = w_po_services-quantity.
w_bapi_esll-gr_price = w_po_services-gr_price.
w_bapi_esll-price_unit = w_po_services-price_unit.
w_bapi_esll-short_text = w_po_services-short_text.
w_bapi_esll-outl_ind = space.
w_bapi_esll-pln_pckg = '2'.
w_bapi_esll-pln_line = line_no.
APPEND w_bapi_esll
TO i_bapi_esll.
w_account_values-line_no = line_no.
w_account_values-serial_no = '1'.
w_account_values-quantity = w_po_services-quantity.
APPEND w_account_values to i_bapi_eskl.
* Assume we read the line in table EKKN
w_bapi_eskn-costcenter = w_ekkn-kostl.
w_bapi_eskn-gl_account = w_ekkn-sakto.
w_bapi_eskn-order = w_ekkn-ebeln.
w_bapi_eskn-pckg_no = '1'.
w_bapi_eskn-serial_no = '1'.
APPEND w_bapi_eskn to i_bapi_eskn.
CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
EXPORTING
entrysheetheader = w_header
testrun = space
IMPORTING
entrysheet = v_entrysheet_no
TABLES
entrysheetaccountassignment = i_bapi_eskn
entrysheetservices = i_bapi_esll
entrysheetsrvaccassvalues = i_bapi_eskl
return = i_bapi_return.
‎2009 Sep 14 6:56 PM
Too difficult for me to see the problem. Could you check your parameters against the detailed description of the [BAPI_ENTRYSHEET_CREATE wiki|http://wiki.sdn.sap.com/wiki/display/Snippets/BAPI_ENTRYSHEET_CREATEwithmulit-accounting]