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,
Lalyn

Hi,
    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.

Similar Messages

  • 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!

  • Prevent auto creation of service entry sheet

    Dear friends,
    I am using maint plan for creating service entry sheets automatically. I am using framework order where I give the validity period. Now when I try to generate service entry sheets through the plans after the end of validity period given in framework order,the system is allowing creation of service entry sheets. Is it possible to prevent a maint plan triggering a service entry sheet if the call date for the service entry sheet to be generated falls outside the validity period given in framework order.
    best regds
    Arun

    Arun,
    This doesn't suprise me...
    I'm not sure if there is a standard solution, but you could do this via user-exit/BADI (see [here|http://www.sapfans.com/forums/viewtopic.php?p=648307] under maintenance plans )
    PeteA
    [www.pjas.com]

  • Dump during creation of service entry sheet (ML81N)

    Dump during creation of service entry sheet (ML81N)
    Hi,
    ML81N>Select PO>Enter>goto entry sheet create (empty page)>service entry sheet displayed with internal no. assigned >click tab "service selection">Input PO No.--> enter (here we get Dump ABAP RUNTIME ERROR "TABLE_INVALID_INDEX").
    This is happening only for some POs. What can be the problem?. Is this has something to do with SAP database ???
    - rahul

    Hi,
    it could have the cause that the note 1113220 was missing from your system or that data are inconsistent in your PO.
    If you implemented 1113220 and you still get the dump, please check in transaction ST22 the run time error long text to the dump:
    Parts:
    - How to correct the error?
    - Information on where terminated
    - Source Code Extract -> if you set a breakpoint before the line where the error occured, you could debug the process.
    - Active Calls/Events: if you have an own program displayed here, please check first your program wether it has caused the issue.
    If these do not help to find out the problem cause, please open a SAP ticket and include all of the relevant information regarding the dump.
    Regards,
    Edit

  • How to create 'Planned service line' using BAPI_ENTRYSHEET_CREATE? Pl. help

    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,
    Manju

    Do 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 Wee

    Hi ,
    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.

  • Restrict creation of Service Entry Sheet if the Date is Prior to PO Date

    Hi,
       I need to restrict from posting a Service Entry Sheet whose Document date and Posting Date are Prior to the Document date of a Puchase Order...Can any one please suggest...
    Regards,
    Sabita

    Hi,
    Better to go release streatgy in SES Release. Give the right of revoke to some other as per business.
    also
    make the error in
    Application Area SE , system msg 155    Not possible to cancel release with code & as error
    Restrict the user with release Code and release Grp in M_SRV
    Regards,
    Pardeep Malik

  • Creation of Service POs using BAPI_PO_CREATE1

    Hi Friends,
    I am trying to create service POs through BAPI (BAPI_PO_CREATE1). I am facing different errors like Please maintain service or limits eve though I am providing the details in POSERVICES. Can any one suggest me the fields which we have to provide for creating the service POs.
    I am using this BAPI in LSMW.
    Thanks,
    Gagan Chodhry

    Check this it may help u.
    DATA: BEGIN OF po_header OCCURS 0.
    INCLUDE STRUCTURE BAPIEKKOC.
    DATA: END OF po_header.
    DATA: BEGIN OF po_iteam OCCURS 10.
    INCLUDE STRUCTURE BAPIEKPOC.
    DATA: END OF po-items.
    DATA: BEGIN OF PO_ITEM_SCHEDULES OCCURS 0.
    INCLUDE STRUCTURE BAPIEKET.
    DATA: END OF PO_ITEM_SCHEDULES.
    DATA: BEGIN OF I_BAPIRETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRETURN.
    DATA: END OF I_BAPIRETURN.
    CALL FUNCTION 'BAPI_PO_CREATE'
    EXPORTING
    PO_HEADER = PO_HEADER
    SKIP_ITEMS_WITH_ERROR = 'X'
    TABLES
    PO_ITEMS = PO_ITEMS
    PO_ITEM_SCHEDULES = PO_ITEM_SCHEDULES
    RETURN = I_BAPIRETURN
    EXCEPTIONS
    OTHERS = 1.
    Regards

  • Service entry sheet creation thru bapi for multiple line items

    HI All,
    WE are using BAPI_ENTRYSHEET_CREATE bapi for the creation of service entry sheet against service PO.
    We are able to create the service entry sheet successfully with single sevice line item using this bapi,but when we are going for multiple service line items in item services tab in aPO, we are able to create the service entry sheet with only one service line item although there are 4 service line items in the item service tab in the po.
    We know that this bapi cannot support more than one po line item as it has provision for only one line item at the header leavel in the bapi
    will be rewarded for the best solution.
    Regards,
    velu

    Hi,
    Do you know the note 420334?. There you have very useful information.
    Best Regards,
    Arminda Jack

  • Is a BAPIBadi available for uploading data to create Service Entry Sheet?

    Dear MM Gurus,
    Users are currently entering Service PO and creating Service Entry sheet for the Subcontractor consultants  (using Transaction code - ML81N) by referring to the Service PO.
    Due to the high amount of data, the users do not want to create Service Entry sheet using ML81N.
    Rather, they have the flat files containing approved timesheet data of the consultants every month and want to upload the flat files. Is there any BAPI or BADI available for uploading such data monthly, to create a Service Entry sheet automatically? Is this feasible?
    Do other companies follow this procedure? Any ideas/suggestions are welcome.
    thanks
    M

    Hello ,,,
    BAPI_ENTRYSHEET_CREATE
    Take the help of ABAPER and write a upload progrme for creation of Service entry sheet.
    Mahesh Naik

  • Service no in service entry sheet

    Hi all,
    we are creating a unplanned service po and creating the service entry sheet against it .We have a requirement  that after the creation of service entry sheet with the service line items with description alone ,can we able to chnage the service entry sheet to  the service no in these same line items before the approval process. We are not able to incorporate these changes in the same service line item.
    we were able to add it in the different service line item.
    Regards,
    velu

    Hi,
    Service entry sheet number we cannot able to change because using T-code ML81N and give PO no and doing service process, first the service entry sheet number generated and then we have given actual service qty.
    So, we are not able to change service entry sheet no.
    Better, deleted service entry sheet and make new service entry sheet for the particular PO.
    Hope, it is clear for you.
    Regards,
    K.Rajendran.

  • Revoke Acceptance of Service Entry sheet

    Hi Experts,
    I am trying to delete an already accepted Service entry sheet using the standard BAPI_EntrySheet_Delete. But I have to revoke the acceptance of the service entry sheet prior to deletion of SES. I am aware that we can manually revoke the acceptance of service entry sheet by using ML81N but I have no idea if there is a BAPI or function module by which I can revoke the acceptance of SES before deletion of SES by BAPI_EntrySheet_Delete. Please help.
    Thanks,
    Gopi.S

    There are no BAPI for Revoke available as ECC5.0
    BAPI_ENTRYSHEET_CHECK          Check Service Entry Sheet                              
    BAPI_ENTRYSHEET_CREATE         Create Entry Sheet                                     
    BAPI_ENTRYSHEET_DELETE         Delete Entry Sheet                                     
    BAPI_ENTRYSHEET_GETDETAIL      Display Detailed Data on Entry Sheet                   
    BAPI_ENTRYSHEET_GETLIST        List Entry Sheets                                      
    BAPI_ENTRYSHEET_GETRELINFO     Detailed Release Information Relating to Entry Sheet   
    BAPI_ENTRYSHEET_RELEASE        Release Entry Sheet                                    
    BAPI_ENTRYSHEET_RESET_RELEASE  Cancel Release of Entry Sheets

  • Invoice & Service entry against PO

    Hi All,
    I need BAPIs for creation of invoice against purchase order and creation of service entry against purchase order. Please let me know at the earliest.
    Regards,
    Lad.

    See example of creating service entry sheet....
    http://anu-sapdiary.blogspot.com/2007/10/using-bapi-bapientrysheetcreate-to.html
    http://abapeasy.blogspot.com/2008/02/bapientrysheetcreate.html

  • BAPI to Accept an already existing service entry sheet

    Hi,
    Please let me know a BAPI to accept an already existing entry sheet.
    i.e set 'X' to the acceptance indicator for an existing entry sheet
    Regards
    Shiva

    Hi,
       Read the documentation in se37 and use apprapiate among all.
    BAPI_ENTRYSHEET_CHECK Check Service Entry Sheet
    BAPI_ENTRYSHEET_CREATE Create Entry Sheet
    BAPI_ENTRYSHEET_DELETE Delete Entry Sheet
    BAPI_ENTRYSHEET_GETDETAIL Display Detailed Data on Entry Sheet
    BAPI_ENTRYSHEET_GETLIST List Entry Sheets
    BAPI_ENTRYSHEET_GETRELINFO Detailed Release Information Relating to Entry Sheet
    BAPI_ENTRYSHEET_RELEASE Release Entry Sheet
    BAPI_ENTRYSHEET_RESET_RELEASE Cancel Release of Entry Sheets
    <b>Reward points</b>
    Regards

  • PLN PCK No in BAPI for service entry

    Hi,
    I am creating service entries via BAPI_ENTRYSHEET_CREATE for planned services.
    If I am using one PO line item then I am able to create service entries with proper PLN_PCK number and all.
    But if I use mutliple line items in PO(not sublines) then PLN PCK number are not correct and I am getting message 'buffer table not upto date' in the service entry.
    Anybody who has done this please help me.
    Thanks.
    Edited by: PS on May 24, 2010 11:38 PM

    hi,
    have you used the commit function too in se37, then only the values get updated.
    se37- bapi_entrysheet_create
    select header-- function module---> test sequence.
    here you enter the two function modules -Bapi_entrysheet_create,bapi_transaction_commit.
    do the same procedure as followed by you before in addition to this.
    REgards,
    velu

Maybe you are looking for

  • Doubt in Selection-Screen for Program type "Function Group"

    Hi Gurus, I created a Function group in that i created one screen and writtem the Screen flow logic. In that screen I called a Function module "COMPLEX_SELECTIONS_DIALOG" For Creating a selection-Screen. The code snippet is like below. CASE ok_code .

  • Formatting Error.. illegal request...Buffer Underrun

    Hi All.. I'm having trouble burning an FCP 5 to DSP 4. I have correctly exported the files to Mpeg-2, using both the File--Export--QuickMoive etc, and/or using Compressor. I usually get(something like this) Fomatting Failed. Unable to format disc, il

  • R12 db growth

    Hello all, We have a fresh R12 install since May-09 and it's DB actual size is 250 Gb. We have estimated a 600 Mb daily growth and need to know if that's somewhere close to a normal install. To give you an idea of our installation: Modules -> GL, AP,

  • SQL Developer  Version 1.5.1 Build MAIN-5440 Imported Connections missing

    I have a problem using SQL Developer Version 1.5.1 Build MAIN-5440. I have successfully imported connections from my previous version of SQL Developer. After I restart, all the connections I have imported has been gone. I tried to import the connecti

  • Disable the default "Start my camera" button for rtc WebcamPublisher

    Hello, I notice in the samples that WebCamera displays the cam. Is there an easy way of disabling the "Start my camera" button? I wish to control this from the app itself. <rtc:WebCamera width="65%" height="396" id="webCamPub"/> I notice in the WebCa