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: 

BAPI_ENTRYSHEET_CREATE, ACCEPTANCE of an Entry Sheet

Former Member
0 Kudos

I have some problems to accept an entry sheet using the bapi BAPI_ENTRYSHEET_CREATE.

I can create an Service Entry Sheet using this BAPI but if i try to put the value 'X' in the ACCEPTANCE field, in order to accept the service entry sheet, the BAPI returns a registration error.

Do you know if there is some specific rules to respect in order to accept a Service Entry Sheet via BAPI?

(If i try to accept the entry sheet created via BAPI using transaction ML81N everything goes OK!).

Thanks..

Antonio

12 REPLIES 12

Former Member
0 Kudos

Hi Antonio,

To use BAPI_ENTRYSHEET_CREATE you must meet the following conditions:

1. The PO_NUMBER (in structure ENTRYSHEETHEADER) must exist in table EKKO.

2. You must have sufficient rights for the following authorization objects: M_BEST_BSA, M_BEST_EKG, M_BEST_EKO and M_BEST_WRK.

3. You must fill the ENTRYSHEETHEADER structure and the ENTRYSHEETACCOUNTASSIGNMENT. The structure ENTRYSHEETSRVACCASSVALUES is optional.

4. You MUST make sure that ALL currency and price values are entered with the same currency used on the related purchase order.

When debugging, please check if the parameter 'FBGENDAT' has been set. This value contains the functiongroup (type RS38L_AREA) and functionmodule name (type RS38L_FNAM) of the BAPI you are calling. This is to make sure you are in the correct programming area with your program.

If this will not work for you, try to use function module MS_CREATE_SERVICE_ENTRY_MULTI (that does the same).

Regards,

Rob.

0 Kudos

Hi Rob,

whe have verified all your conditions...but we can not

ACCEPT the entry sheet yet.

If i create an Entry sheet via BAPI (without the acceptance flag) evrything it's OK.

If i put the acceptance flag...the BAPI returns a "Registration Error"....

..have you some other suggetions about this problem?

Thank you very much

Antonio

Former Member
0 Kudos

Hello All ,

Could you help me in using BAPI_ENTRYSHEET_CREATE ,

for us ,The SES is being created , but there are no service items in that.

I tried using MS_CREATE_SERVICE_ENTRY_MULTI but the same result.

I am using this with a PO,line item and Service details.

and the data i am sending will be some what similar as below.

1) t_essr-lblni = '1'.

t_essr-erdat = '10.10.2005'.

t_essr-aedat = '10.10.2005'.

t_essr-lwert = 20.

t_essr-uwert = 20.

t_essr-ebeln = 'ES01000476'.

t_essr-ebelp = '00020'.

2) t_esll-introw = '1'.

t_esll-package = 'X'.

t_esll-frompos = '1'.

t_esll-ktext1 = 'Test Kes - from bapi - qqq'.

3) t_eskl-menge = 1.

t_eskl-wproz = 100.

t_eskl-act_menge = 20.

4) t_eskn-packno = '1'.

Could you please suggest the usage of the BAPI/the FM .

with best regards

Kesari.

0 Kudos

hello all,

i'm looking for a guide for import / export param for the BAPI entry sheet.

can anyone help me?

eliana

Former Member
0 Kudos

Did any one finally figure out what are the mandatory inputs to different tables and structures for BAPI_ENTRYSHEET_CREATE to work ?

Is there a way to create ENTRYSHEET based on a PO / WO

with all items copied, just by giving the PO / WO number and a few more parameters instead of listing all the items again ? (Using BAPI_ENTRYSHEET_CREATE or any other BAPI, but should be remote-enabled)

Thanks great guys and gals for your help to the SAP community !

0 Kudos

Did u got any updates on this??.

Appreciate if any one ever done SERVICE SHEET CHANGE functionality?. I didnot find BAPI to do this..

Regards

Uday

0 Kudos

Hi,

Check the below code to create the Service Entry sheet using the BAPI_ENTRYSHEET_CREATE.

REPORT ypra_sample42.

DATA: wa_header TYPE bapiessrc,

i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,

ws_entrysheet_no TYPE bapiessr-sheet_no,

i_service TYPE bapiesllc OCCURS 0 WITH HEADER LINE,

i_service_acc TYPE bapiesklc OCCURS 0 WITH HEADER LINE,

i_service_text TYPE bapieslltx OCCURS 0 WITH HEADER LINE,

i_account TYPE bapiesknc OCCURS 0 WITH HEADER LINE,

ws_pack_no TYPE packno.

DATA: ws_po TYPE bapiekko-po_number,

po_items TYPE bapiekpo OCCURS 0 WITH HEADER LINE,

po_services TYPE bapiesll OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF wa_po_header OCCURS 1.

INCLUDE STRUCTURE bapiekkol.

DATA: END OF wa_po_header.

DATA: BEGIN OF bapi_return_po OCCURS 1.

INCLUDE STRUCTURE bapireturn.

DATA: END OF bapi_return_po.

DATA: serial_no LIKE bapiesknc-serial_no,

line_no LIKE bapiesllc-line_no.

DATA: bapi_esll LIKE bapiesllc OCCURS 1

WITH HEADER LINE.

ws_po = '4300000051'.

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.

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.

serial_no = 0.

line_no = 1.

bapi_esll-pckg_no = 1.

bapi_esll-line_no = line_no.

bapi_esll-outl_level = '0'.

bapi_esll-outl_ind = 'X'.

bapi_esll-subpckg_no = 2.

APPEND bapi_esll.

LOOP AT po_services WHERE NOT short_text IS INITIAL.

line_no = line_no + 1.

CLEAR bapi_esll.

  • MOVE-CORRESPONDING po_services TO bapi_esll.

  • bapi_esll-gr_price = '456'.

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-price_unit = po_services-price_unit.

APPEND bapi_esll.

ENDLOOP.

CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'

EXPORTING

entrysheetheader = wa_header

  • testrun = 'X'

IMPORTING

entrysheet = ws_entrysheet_no

TABLES

  • ENTRYSHEETACCOUNTASSIGNMENT =

entrysheetservices = bapi_esll

  • entrysheetsrvaccassvalues = i_service_acc

return = i_return

  • entrysheetservicestexts = i_service_text

  • ENTRYSHEETHEADERTEXT =

.

break gbpra8.

LOOP AT i_return.

ENDLOOP.

DATA: ws_wait TYPE bapita-wait.

ws_wait = '3'.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = ws_wait.

Regards,

Prakash.

0 Kudos

There is no BAPI to change ENTRY SHEET.

What SAP suggested is to write a BDC on ML81 .

0 Kudos

Hi,

I am able to create an entry sheet using the logic provided by u.But for few line items,it throws an error as "No account assignment exists for service line 0000000010".Do we have to fill the structure "ENTRYSHEETACCOUNTASSIGNMENT"?If we have to fill it,what are the required fields to be populated?

Please help....

0 Kudos

Hi all,

Could you please help me. I am looking for the import file format and structure to import a service entry sheet.

it would help me a lot

Thanks!

Jyoti

0 Kudos

Hi all,

1. A good guide to know how to pass the BAPI parameters is SAP Note 420334.

2. I'm having the inverse problem posted here: I dont want to create Entry Sheet accepted and when I pass the ACCEPTANCE field empty, results in a dump "Exception condition "INVALID_DYNPRONAME" raised.". If I fill the ACCEPTANCE fill (with 'X'). the BAPI works fine and creates the Entry Sheet.

Does anyone know why is happening this?

Regards.

Gregory.

Former Member
0 Kudos

Hi Antonio,

Adding to the Code I sent, if you pass

wa_header-doc_date = sy-datum.

wa_header-post_date = sy-datum

wa_header-acceptance = 'X'.

in the header. Entrysheet is getting accepted.

Try it.

Regards,

Prakash.