BAPI_ENTRYSHEET_CREATE
Hi,
I am using BAPI_ENTRYSHEET_CREATE to create service entries in ML81N. Once the entry sheet is created I want to see the account assignment of service line with "Distribution on Quantity Basis". However, the BAPI creates it by percentage distribution. Please let me know what else needs to be done to get the distribution on quantity basis.
Here is how I am filling the tables of the BAPI.
ENTRYSHEETHEADER
BEGDATE ENDDATE PCKG_NO SHORT_TEXT PO_NUMBER PO_ITEM DOC_DATE POST_DATE
21.04.2014 27.04.2014 0000000001 ROB SCHROEDER W/E 04/21/2014 4500436511 00016 06.05.2014 06.05.2014
ENTRYSHEETACCOUNTASSIGNMENT
PCKG_NO SE GL_ACCOUNT WBS_ELEM COUNTER
0000000001 01 42100100 T.3000491.02.00.00 00000001
0000000001 02 42100100 T.3000491.01.01.90 00000000
0000000001 03 42100100 T.3000491.02.00.00 00000000
0000000001 04 42100100 T.3000491.02.00.00 00000000
ENTRYSHEETSERVICES
PCKG_NO LINE_NO EXT_LINE OUTL_LEVEL SUBPCKG_NO SERVICE QUANTITY BASE_UOM UOM_ISO PRICE_UNIT GR_PRICE SHORT_TEXT DISTRIB PERS_NO
0000000001 0000000001 0000000000 X 0000000002 0.000 0 0.0000 1
0000000002 0000000002 0000000010 0000000000 40.000 HRS HRS 1 10.0000
RSCHROEDER - STD 04/21/2014 1 90000011
0000000002 0000000003 0000000020 0000000000 8.000 HRS HRS 1 15.0000
RSCHROEDER - OT 04/21/2014 1 90000011
0000000002 0000000004 0000000030 0000000000 8.000 HRS HRS 1 20.0000
RSCHROEDER - OT 04/21/2014 1 90000011
ENTRYSHEETSRVACCASSVALUES
PCKG_NO LINE_NO SE PERCEN SE QUANTITY NET_VALUE
0000000002 0000000002 01 37.5 01 15.000 0.00
0000000002 0000000002 02 62.5 02 25.000 0.00
0000000002 0000000003 03 100.0 03 8.000 0.00
0000000002 0000000004 04 100.0 04 8.000 0.00
Three entry sheets are created as shown in 1st Screenshot. If I get into the account assignment of line 10, I get the values shown in screenshot 2.
NOTE:- While entering values to table ENTRYSHEETSRVACCASSVALUES I tried keeping the field PERCEN as blank but that didn't help as well. I get an error -
E 06
408 Please enter account assignment
Thanks,
Rakesh
Looking for any help...
Similar Messages
-
I need to create service entry sheet ( SES ) using input data from text file through BAPI_ENTRYSHEET_CREATE.
If the input contains service line items, which are not present in PO, it should be treated as an unplanned service and correspondingly 'unplanned' indicator is to be set on ML81N ( Service netry sheet ) display.
I want to make an entry unplanned if the input field external no. ( Field: BAPIESLLC-EXT_LINE ) is not matching with external no. field of corresponding purchase order to which the SES refers.
The BAPI works fine for all cases except one. If the unplanned service line contains field SERVICE_NO value which is matching with a SERVICE_NO in PO, it is invariable treated by BAPI as 'PLANNED'. ie. BAPI decides whenther a service line is planned or unplanned based on SERVICE_NO only.
For eg. Let a PO contains one service line with SERVICE_NO value 1008505.
If SES input file contains 2 service entries with SERVICE_NO value 1008505.
While creating SES, the BAPI should treat first entry as 'planned' and second line as 'unplanned'.
But while running the program, both lines are created as 'Planned' only, since SERVICE_NO value 1008505 exists in the PO.
I need to set the service line planned/unplanned through my prgram, overriding the automatic setting up of BAPI_ENTRYSHEET_CREATE.
Hope this clarifies my requirement.
Grateful if somebody cam provide a solution.
Thanks & Regards,
ManjuDo NOT USE BAPI_SALESORDER_CREATEFROMDATA, that FM is obsolete!
Use BAPI_SALESORDER_CREATEFROMDAT1 .
To build a reference to your contract you have to supply ORDER_HEADER_IN.
Here´s a sample:
MOVE:
gs_vbak-vbeln TO ls_bapisdhd1-refobjkey,
gs_vbak-vbeln TO ls_bapisdhd1-ref_doc,
gs_vbak-vbtyp TO ls_bapisdhd1-refdoc_cat,
gs_vbak-auart TO ls_bapisdhd1-refdoctype.
also gothrouh the links
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2b-%2bsimple%2bprogram%2bto%2bcreate%2bsales%2border%2busing%2bbapi -
How to change Service Item using BAPI_ENTRYSHEET_CREATE.
Hi All,
There's a requirement for me to upload/ Create Entry Sheet using BAPI_ENTRYSHEET_CREATE from the source file.
The Header was given to me but the Service Item, they would like the flexibility to change the existing lines that was adopted from ML81N.
Eg of the file.
Header given:-
PO NO
Po Item
Short Text
Ext Entry Sheet No
Service Location
Period Start
Period End ....n so on
Service Item given:-
Service Line (Extrow)
Service Order Qty (Memge)
Ext Service No (EXTSRVNO)
The objective of this file is
1) Create Service Entry Sheet (using Header)
2) Adopt the Service Item
3) Change Service Item (using Service Item)
Could anyone guide me how to do it? If Using BAPI_ENTRYSHEET_CREATE...is actually creating it with full details of the upload file. but given to me, t requrement is they would like to create n change the item.
Appreciates your help.
Thank you.
Regards,
Sheena WeeHi ,
If you are trying to test the FM through TCode SE37 then it will not give you the desired output.Do one thing create a test program and there you call the FM with your data.I hope in this way you can solve the issue.
Regards,
Sarbajit. -
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!!The issue resolved now by passing the following parameters-
EntrySheet header-
BAPI_ESSR-PO_NUMBER = PO_NUMBER.
BAPI_ESSR-PO_ITEM = PO_ITEM.
BAPI_ESSR-SHORT_TEXT = as entered by user
BAPI_ESSR-ACCEPTANCE = u2018Xu2019 or space.
BAPI_ESSR-DOC_DATE = Todayu2019s date.
BAPI_ESSR-POST_DATE = Todayu2019s date.
BAPI_ESSR-PCKG_NO = '0000000001'.
Entry Sheet Account Assignment-
BAPI_ESKN-COSTCENTER = Cost Center
BAPI_ESKN-WBS_ELEMENT = WBS element
BAPI_ESKN-AUFNR = Order
Entry Sheet Services-
Unplanned line-
BAPI_ESLL-PCKG_NO = '0000000001'.
BAPI_ESLL-LINE_NO = LINE_NO (000001).
BAPI_ESLL-EXT_LINE = '0000000000'.
BAPI_ESLL-OUTL_LEVEL = 0.
BAPI_ESLL-OUTL_IND = 'X'.
BAPI_ESLL-SUBPCKG_NO = '0000000002'.
Planned line-
BAPI_ESLL-LINE_NO = LINE_NO (000002).
BAPI_ESLL-PCKG_NO = '0000000002'.
BAPI_ESLL-SUBPCKG_NO = '0000000000'.
BAPI_ESLL-EXT_LINE = '0000000010'.
BAPI_ESLL-SERVICE = '0000000000'.
BAPI_ESLL-OUTL_LEVEL = 0.
BAPI_ESLL-OUTL_IND = ' '.
BAPI_ESLL-QUANTITY = as entered by user
BAPI_ESLL-BASE_UOM = PO_SERVICES-BASE_UOM.
BAPI_ESLL-GR_PRICE = as entered by user
BAPI_ESLL-PLN_PCKG = '0000000000'.
BAPI_ESLL-PLN_LINE = '0000000001'.
Entry Sheet Service access values-
BAPI_ESKL-LINE_NO = '2'.
BAPI_ESKL-PCKG_NO = '0000000002'.
BAPI_ESKL-PERCENTAGE = '100'.
Thankyou! -
Dump during BAPI_ENTRYSHEET_CREATE calling from Portal
Hi,
I am getting dump during creation of Service Entry Sheet using the 'BAPI_ENTRYSHEET_CREATE' when triggering it from Portal end. But if I directly call the FM from ECC6.0 with the same passing values it gives me the success meassage. The dump only occurs when I am triggering it from Portal via another custom RFC funtion module.
I have checked in ST22 and the message text is like ....." Exception condition "GUI_NO_MODE_AVAILABLE" raised."
Also have checked the SAP Note1271652 and have suggested to apply kernel patch 184. But kernel patch 185 already been applied as our basis team have confirmed. Can you please help me out of this situaion.
Thanks & Regards,
ApurbaHi,
I came across this issue and have blogged a solution that gets round it for our purposes. This may help:
http://community.altiusconsulting.com/blogs/adamadshead/archive/2009/09/24/bex-analyzer-s-file-upload-bug-when-integrated-with-sap-portal.aspx
Regards,
Adam -
How to use BAPI_ENTRYSHEET_CREATE
Iam new to use BAPI_ENTRYSHEET_CREATE.
What are the mandatory fields that should be passed to it to create SES ( Service Entry Sheet ).
The data given to me is:
Purchase Ord number,
Activity Number,
Rate,
Quantity,
External Number.
Is the above data is enough to create SES.
Please give me the valuble information as early as possible.Check the below code:
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 = '4300000066'.
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-acceptance = 'X'.
wa_header-doc_date = sy-datum.
wa_header-post_date = sy-datum.
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. -
Creation of service entry using BAPI_ENTRYSHEET_CREATE
Hi Experts,
I have a requirement to create a service entry using BAPI with multiple account assignments. It can be distributed by quantity or percentage. Please give sample code.
Thanks,
LalynHi,
Please go through the function module BAPI_ENTRYSHEET_CREATE documentation and the documentation available in importing, exporting, tables on the right hand side with green buttons. Then you can able to know how to use this bapi. -
Populate document header text in SES by bapi BAPI_ENTRYSHEET_CREATE
Hi,
I am using BAPI BAPI_ENTRYSHEET_CREATE to create a service entry sheet. But I am not able to populate the document header text (bktxt) in acceptance tab in service entry sheet header in ML81N.
Can anybody help me what I need to pass to this BAPI in order to populate this field.
Thanks,
MainakHey Mainak,
I am aware that the question was posted by you long back, but I am replying so that other readers probably can benefit from the answer below -
I faced the similar issue recently in one of the projects. The solution that i have opted is as below -
1. I leveraged the changing parameter 'ESSR' work area of the user exit 'EXIT_SAPLMLSR_010'. This user exit is internally called via BAPI_ENTRYSHEET_CREATE.
2. You can export the value of 'ESSR-BKTXT' field to memory ID from the calling program and import it within this user exit and pass it to changing parameter ESSR.
Hope this helps to other readers!
- Thanks,
Urvi. -
Problem with BAPI_ENTRYSHEET_CREATE
Hi Experts,
In my upload program for Service Entry Sheet (ML81N) i am using BAPI_ENTRYSHEET_CREATE.I am reading all the PO related information (like PO, item, quantity, gross price, network, activity etc) from a flat file.Program is successfully creating the Service Entry Sheet, but the problem is that it is not picking the network value from the flat file, instead it is picking network value from the PO.
I am populating the bapi structures as follows:
Refresh iEsll.
Refresh iEskn.
***To populate Header Data of Entry Sheet(BAPIESSRC)
Clear wEssr.
wEssr-pckg_no = c1.
wEssr-short_text = short text from flat file
wEssr-po_number = PO from flat file
wEssr-po_item = PO Item from flat file
wEssr-location = Location from flat file
wEssr-doc_date = sy-datum.
wEssr-post_date = sy-datum.
wEssr-acceptance = cX.
***To populate Services Data of Entry Sheet(BAPIESLLC)
Clear wEsll.
wEsll-pckg_no = c1.
wEsll-line_no = c1.
wEsll-ext_line = c0.
wEsll-outl_level = c0.
wEsll-outl_ind = cX.
wEsll-subpckg_no = c2.
Append wEsll To iEsll.
Loop At flat file data.
***To populate Services Data of Entry Sheet(BAPIESLLC)
lExt = lExt + 10.
lLine = lLine + 1.
Clear wEsll.
wEsll-pckg_no = c2.
wEsll-line_no = lLine.
wEsll-ext_line = lExt.
wEsll-outl_level = c0.
wEsll-subpckg_no = c0.
wEsll-quantity = quantity from flat file
wEsll-base_uom = UOM from flat file
wEsll-gr_price = Gross price from flat file
wEsll-pln_pckg = Package from PO
wEsll-pln_line = Package line from PO
wEsll-short_text = Item Short Text from flat file
wEsll-tax_code = Tax code from flat file
Append wEsll To iEsll.
***To populate Account Assignment Data of Entry Sheet(BAPIESKNC)
Clear wEskn.
wEskn-pckg_no = c1.
wEskn-serial_no = c1.
wEskn-network = Network from flat file
wEskn-activity = Activity from flat file
wEskn-gl_account = GL Account from flat file
Append wEskn To iEskn.
Clear wSes1.
EndLoop.
CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
EXPORTING
ENTRYSHEETHEADER = wEssr
TESTRUN = pTest
IMPORTING
ENTRYSHEET = wSnum
TABLES
ENTRYSHEETACCOUNTASSIGNMENT = iEskn
ENTRYSHEETSERVICES = iEsll
ENTRYSHEETSRVACCASSVALUES = iEskl
RETURN = iMsg.
Could anyone please let me know what needs to be done to resolve this.
Thanks
AnilHi,
Thanks a lot for the reply.
Still im not able to clear the error 'Error during update'.
Im passing following parameters to BAPI_ENTRYSHEET_CREATE.
Refresh iEsll.
Refresh iEskn.
***To populate Header Data of Entry Sheet
Clear wEssr.
wEssr-po_number = wSes-ebeln.
wEssr-po_item = wSes-ebelp.
wEssr-short_text = wSes-txz01.
wEssr-location = wSes-dlort.
wEssr-person_int = sy-uname.
wEssr-pckg_no = 1.
wEssr-doc_date = sy-datum.
wEssr-post_date = sy-datum.
wEssr-acceptance = cX.
wEssr-fin_entry = cX.
***To populate Services Data of Entry Sheet
Clear wEsll.
wEsll-pckg_no = 1.
wEsll-line_no = 1.
wEsll-ext_line = 0.
wEsll-outl_level = '0'.
wEsll-outl_no = '1'.
wEsll-outl_ind = cX.
wEsll-subpckg_no = c2.
wEsll-pln_line = 123.
wEsll-short_text = wSes-ktext1.
wEsll-quantity = wSes-menge.
wEsll-base_uom = wSes-meins.
wEsll-gr_price = wSes-tbtwr.
wEsll-tax_code = wSes-mwskz.
Append wEsll To iEsll.
***To populate Account Assignment Data of Entry Sheet
Clear wEskn.
wEskn-pckg_no = '1'.
wEskn-network = wSes-nplnr.
wEskn-activity = wSes-vornr.
wEskn-gl_account = wSes-sakto.
Append wEskn To iEskn.
Could you please let me know where i am doing wrong.
Thanks once again.
Regards,
Vinny -
BAPI_ENTRYSHEET_CREATE returns "No service items selected"
I was wondering if anybody could help. Does anybody have an example using BAPI_ENTRYSHEET_CREATE? I would appreciate it.
Hi Vivek,
You may want to check this include program <b>LMEW5F02</b> and <b>LMLSXF31</b>.
They have implementation for this BAPI.
Hope this will help.
Regards,
Ferry Lianto -
BAPI BAPI_ENTRYSHEET_CREATE - Service Entry Sheet - MM
Hi all,
I am trying to create a service entry sheet using the BAPI - BAPI_ENTRYSHEET_CREATE.
However the BAPI is executed and the service entry sheet is created OK
but in ML81N it shows the message SE001.
The problem occurs only when the PO have 2 items and the entry sheet is for 2o. item.
When the PO have 1 item the my routine is OK.
can anyone suggest any solution for this ...
From now, thanks.
my code:
form create_SES.
data: SUBPCKG_NO type ESLL-SUB_PACKNO,
LINE_NO type BAPIESLLC-LINE_NO.
data: begin of WA_PO_HEADER occurs 1.
include structure BAPIEKKOL.
data: end of WA_PO_HEADER.
data: PO_ITEMS type BAPIEKPO occurs 0 with header line,
PO_SERVICES type BAPIESLL occurs 0 with header line.
data: begin of PO_RET occurs 0.
include structure BAPIRETURN.
data: end of PO_RET.
data: ENTRYSHEET type BAPIESSR-SHEET_NO.
data: IT_ESSR like BAPIESSRC occurs 0
with header line.
data: IT_ESKN like BAPIESKNC occurs 0
with header line.
data: IT_ESLL like BAPIESLLC occurs 0
with header line.
data: IT_ESKL like BAPIESKLC occurs 0
with header line.
data: begin of IT_RET occurs 0.
include structure BAPIRET2.
data: end of IT_RET.
call function 'BAPI_PO_GETDETAIL'
exporting
PURCHASEORDER = IT_FRS_C-FRS_PO " for example 4500016194
ITEMS = 'X'
SERVICES = 'X'
importing
PO_HEADER = WA_PO_HEADER
tables
PO_ITEMS = PO_ITEMS
PO_ITEM_SERVICES = PO_SERVICES
RETURN = PO_RET.
loop at PO_RET where TYPE = 'E' or TYPE = 'A'.
return. " ERROR in PO
endloop.
loop at PO_ITEMS.
if PO_ITEMS-PO_ITEM <> 20. " <<<<< atention for this: only item 20 in PO
read table PO_SERVICES with key PCKG_NO = PO_ITEMS-PCKG_NO.
SUBPCKG_NO = PO_SERVICES-SUBPCKG_NO.
delete PO_SERVICES where PCKG_NO = SUBPCKG_NO.
delete PO_SERVICES where PCKG_NO = PO_ITEMS-PCKG_NO.
delete PO_ITEMS.
endif.
endloop.
loop at PO_ITEMS.
IT_ESSR-PO_NUMBER = PO_ITEMS-PO_NUMBER.
IT_ESSR-PO_ITEM = PO_ITEMS-PO_ITEM.
IT_ESSR-PCKG_NO = PO_ITEMS-PCKG_NO.
IT_ESSR-ACCEPTANCE = IT_FRS_C-FRS_ACEITE. " begin of my data = ' '
IT_ESSR-DOC_DATE = IT_FRS_C-FRS_DTDOC. " = ''
IT_ESSR-POST_DATE = IT_FRS_C-FRS_DTLANCA. " = ''
IT_ESSR-REF_DOC_NO = IT_FRS_C-FRS_REFER. " = '12345-67'
IT_ESSR-SHORT_TEXT = IT_FRS_C-FRS_TXT. " = ''
IT_ESSR-EXT_NUMBER = IT_FRS_C-FRS_NROEXT. " = ''
IT_ESSR-LOCATION = IT_FRS_C-FRS_LOCAL. " = ''
IT_ESSR-BEGDATE = IT_FRS_C-FRS_DTINI. " = ''
IT_ESSR-ENDDATE = IT_FRS_C-FRS_DTFIM. " = ''
IT_ESSR-PERSON_INT = IT_FRS_C-FRS_ENCINT. " = ''
IT_ESSR-PERSON_EXT = IT_FRS_C-FRS_ENCEXT. " end of my data = ''
if PO_ITEMS-ACCTASSCAT = 'U'.
IT_ESSR-ACCASSCAT = 'K'.
else.
IT_ESSR-ACCASSCAT = PO_ITEMS-ACCTASSCAT.
endif.
append IT_ESSR.
endloop.
LINE_NO = 1.
loop at PO_SERVICES.
clear IT_ESLL.
IT_ESLL-SHORT_TEXT = PO_SERVICES-SHORT_TEXT.
IT_ESLL-QUANTITY = PO_SERVICES-QUANTITY.
IT_ESLL-SERVICE = PO_SERVICES-SERVICE.
IT_ESLL-PCKG_NO = PO_SERVICES-PCKG_NO.
IT_ESLL-LINE_NO = LINE_NO.
IT_ESLL-EXT_LINE = PO_SERVICES-EXT_LINE.
IT_ESLL-OUTL_IND = PO_SERVICES-OUTL_IND.
IT_ESLL-SUBPCKG_NO = PO_SERVICES-SUBPCKG_NO.
IT_ESLL-PLN_PCKG = PO_SERVICES-PLN_PCKG.
IT_ESLL-PLN_LINE = PO_SERVICES-PLN_LINE.
IT_ESLL-BASE_UOM = PO_SERVICES-BASE_UOM.
IT_ESLL-UOM_ISO = PO_SERVICES-UOM_ISO.
IT_ESLL-PRICE_UNIT = PO_SERVICES-PRICE_UNIT.
IT_ESLL-FROM_LINE = PO_SERVICES-FROM_LINE.
append IT_ESLL.
LINE_NO = LINE_NO + 1.
endloop.
call function 'BAPI_ENTRYSHEET_CREATE'
exporting
ENTRYSHEETHEADER = IT_ESSR
TESTRUN = ' '
importing
ENTRYSHEET = ENTRYSHEET
tables
ENTRYSHEETACCOUNTASSIGNMENT = IT_ESKN
ENTRYSHEETSERVICES = IT_ESLL
* ENTRYSHEETSRVACCASSVALUES = IT_ESKL
RETURN = IT_RET
* ENTRYSHEETSERVICESTEXTS =
* ENTRYSHEETHEADERTEXT =
endform.Did you not search? Google has 3600 hits for BAPI_ENTRYSHEET_CREATE
the second hit is a wiki from SCN with sample coding
the third hit has a link to a OSS note with a promising title 420334 - BAPI_ENTRYSHEET_CREATE: Model for creation -
Error in BAPI_ENTRYSHEET_CREATE
Hi,
I am uploading data through BAPI_ENTRYSHEET_CREATE to create service entry sheet. we have tested the same through se37 and from there it is working fine. but when test the same throgh program it is giving the SES number but in return it is saying 'Error During Update'.
I dont know why this error is coming when i upload throug program.
Can any one give me solution for this ASAP . And wt r the required parameters in BAPI_ENTRYSHEET_CREATE.
Waiting for ur reply....
Regards,
SrinathHi All,
I resolved this. Please refer screen shots below for solution
Below screen shots show about the data to be passed to BAPI_ENTRYSHEET_CREATE
Regards,
Rafi -
How to run BAPI_ENTRYSHEET_CREATE
Hi all,
I want to run BAPI_ENTRYSHEET_CREATE for service entry sheet creation. When I am running this bapi it gives me the errors. Can u please tell me the required parameters to run this bapi
thanks
chetanHi Viji,
thanks for the reply, but can u please tell me what should be the fields which I pass into tables.
I have PO number, Item number, Quantity but there might be some more parameters, so please tell these.
chetan
Message was edited by:
chetan vishnoi -
BAPI_ENTRYSHEET_CREATE: WBS default in multiple distribution
Hi,
I am trying to create SES using BAPI_ENTRYSHEET_CREATE for PO line having multiple account assignment distributed with percentage. For e.g.,
Following WBS are attached to PO line 6500010013 00010.
I-000262.01.02.01
I-000262.01.02.02
I-000262.01.02.03
I-000262.01.02.04
I-000262.01.02.05
I-000262.01.02.06
When I pass WBS element I-000262.01.02.03 to the BAPI during SES creation, the SES gets created for WBS I-000262.01.02.01.
Would anyone please help me to know why BAPI behaves in such a way. I see same behaviour when I generate a BDC recording for ML81N transaction.
Thanks in advance.
Regards,
Aparna Alashe.Hi,
Check SAP Note 536835 and 986683.
The function module calls PSPNUM_EXTERN_TO_INTERN_CONV and external number has to be passed to this BAPI.
Hope it helps.
Sujay -
Examples on values to be given for bapi_entrysheet_create
hi ,
just have a problem through the bapi i am able to create the entry sheet but the material , i mean the line items are not created.Here is an example of values given to various import/tables parameters of BAPI 'BAPI_ENTRYSHEET_CREATE'.
Hope this will help you.
<u><b>ENTRYSHEETHEADER</b></u>
PCKG_NO 0000000001
SHORT_TEXT TEST
PO_NUMBER 4500017443
PO_ITEM 00010
BLOCK_IND
SCORE_TIME 0
SCORE_QUAL 0
DOC_DATE 12.10.2005
POST_DATE 12.10.2005
REF_DOC_NO
ACCASSCAT F
COMM_NO
USER_FIELD
ACCEPTANCE X
<u><b>ENTRYSHEETACCOUNTASSIGNMENT</b></u>
PCKG_NO 0000000001
SERIAL_NO 01
GL_ACCOUNT 417000
BUS_AREA 9900
COSTCENTER 9010
SD_DOC
ITM_NUMBER 000000
ASSET_NO
SUB_NUMBER
ORDER
CO_AREA 2000
TO_COSTCTR
TO_ORDER
TO_PROJECT
COST_OBJ
PROF_SEG 0000000000
PROFIT_CTR 3402
<u><b>ENTRYSHEETSERVICES</b></u> (two lines)
PCKG_NO 0000000001
LINE_NO 0000000001
EXT_LINE 0000000000
OUTL_LEVEL 0
OUTL_NO
OUTL_IND X
SUBPCKG_NO 0000000002
SERVICE
SERV_TYPE
EDITION 0000
SSC_ITEM
EXT_SERV
QUANTITY 0,000
BASE_UOM
UOM_ISO
OVF_TOL 0,0
OVF_UNLIM
PRICE_UNIT 0
GR_PRICE 0,0000
FROM_LINE 1
TO_LINE
PCKG_NO 0000000002
LINE_NO 0000000002
EXT_LINE 0000000020
OUTL_LEVEL 0
OUTL_NO
OUTL_IND
SUBPCKG_NO 0000000000
SERVICE 3000000000017
SERV_TYPE
EDITION 0000
SSC_ITEM
EXT_SERV
QUANTITY 2,000
BASE_UOM AU
UOM_ISO PCE
OVF_TOL 0,0
OVF_UNLIM
PRICE_UNIT 1
GR_PRICE 100 000,0000
FROM_LINE
TO_LINE
SHORT_TEXT WINDOW INSTALLATION
<u><b>ENTRYSHEETSRVACCASSVALUES</b></u>
PCKG_NO 0000000002
LINE_NO 0000000002
SERNO_LINE 01
PERCENTAGE 100,0
SERIAL_NO 01
QUANTITY 2,000
NET_VALUE 100 000,00
Maybe you are looking for
-
My husband and I recently got married and we both have our own laptops and iPods with our own individual iTunes library. We would like to share the music we have downloaded over the years. I have read several discussions on the forums and think maybe
-
Burning a slideshow directly from iPhoto
Folks, I am wondering if it is possible to burn a slideshow to a DVD directly from iPhoto, or if you have to export the slideshow to iDVD and then burn? Secondly, I tried to export to iDVD last night and when the export was done, I received a message
-
HT4061 forgot my passcode and cant get into my phone
I have forgotten my passcode and cannot get into my phone
-
Trying to install Visio 2010 add-in for rack server virtualization - fails
I am running Visio 2010 Professional 32-bit. I am running it on a Windows 7 Enterprise machine, 64 bit. I am trying to install the Visio 2010 Add-In for Rack Server Virtualization. When running the installer I get the following message: "Setup can
-
View all computers on network?
Does anyone know of an application to view all computers on a network? Thanks, Kristin.