Service Entry sheet with BAPI

Hello,
I want to create service entry sheet with BAPI_ENTRYSHEET_CREATE. can anyone tell me step by step process like what data I need to maintain in which table?

Hi,
REPORT test_program.
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.
Thanks,
Krishna...

Similar Messages

  • Creating Service entry sheet using bapi  BAPI_ENTRYSHEET_CREATE

    Hello Guys,
    I  am trying to create a service entry sheet for single line item only using bapi  BAPI_ENTRYSHEET_CREATE.
    its is creating Service entry document but not populating the line item  for me (here only one line item for me).
    If you guys have sample code (how the poupulate the internal tables)  could you please send it across?.
    Thanks in Advance..
    Steevan

    Hi,
    Creating Service entry sheet using bapi  BAPI_ENTRYSHEET_CREATE
    For creating service entry sheet follow below link and it helps to you.
    http://wiki.sdn.sap.com/wiki/display/ABAP/CreatingServiceEntrySheetusing+BAPI
    Regards,
    Sekhar

  • Service Entry Sheets with respect to PO

    Hi,
    Please let me know how we can create service entry sheets with respect to Purchase Orders in MM.
    Can we default the details of PO if we give PO reference in ML81N in MM.
    Thanks,
    Vijay

    I think this possible with Lm01.
    - When you issue the components through SC vendor, you create delivery via ME2O.
    - Configure LM01 as such you can stage with respect to the delivery and load it. Check with technical team. you dont need to have WM or PP module to use LM01 as we used LM01 without these modules.
    Or if you want to use just 311 movement type using goods issue, you should make use of the item text or header text in Good issue screen to refer the PO number

  • Create Service entry sheet using BAPI in SAP

    Hi
    Experts,
    Scenario : SES will be created in third party system , once it created, txt file will be generated and placed in their server.We will be writing a program
    to pick that file and post SES in ECC using BAPI ( Idoc is not available to create SES i believe).
    I will be using BAPI_ENTRYSHEET_CREATE to create SES sheet but we dont have service masters and creating unplanned service entry sheet.
    I will be checking by passing the values manually in BAPI to create SES.
    I am passing PO no, line no and qty, value and other details to create SES.
    It is creating SES with only header data. it is not updating line item details.
    I am missing some parameters to be passed to create SES using BAPI I feel.
    I need your help to create SES using BAPI.
    What are the details to be passed to create SES in SAP using BAPI.
    Regards,
    Suresh.A

    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

  • 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

  • BAPI to unaccept service entry sheet

    Hello,
    I have created and accepted service entry sheet using BAPI "BAPI_ENTRYSHEET_CREATE". Now i have requirement where I need to unaccept already accepted service entry sheet. Can any one provide me the BAPI which will help me in resolving this issue.
    Thanks in advance

    Hello, Gregory...
    Hi Guillermo,
    I've tryed with this FM by 2 ways:
    - Manually: deletes the Entry Sheet.
    - Programatically: didnt do anything, gives the error: E SE 214 Error during update.
    I only want to revoke the acceptance, I dont want to delete the Entry Sheet.
    Could you tell me how to that?
    Regards.
    Gregory.
    Im facing a similar problem executing BBP_ENTRYSHEET_CANCEL, in my process I execute BAPI_ENTRYSHEET_CREATE after then I recieve the error...
    I think it is some trash in execution context....

  • Can not delete service entry sheet having Items with zero quantity

    Dear Experts ,
    I am having one service entry sheet with many line items out of which some line items are having quantity zero. Now when trying to delete the service entry sheet , system is asking to fill the quantity . since there are already some other service entry sheets through which full quantity equal to Purchase order quantity for that service line item has been already entered , the system is giving message "quantity exceeds"  if even quantity 0.01 is entered for namesake to allow delete of entire SES.
    The user had saved this service entry sheet & left it as it without acceptance for long time , it is required to be deleted as whole.
    Please advise how it can be deleted as system is not allowing it to delete & asks quantity to be filled NOW where  quantity had been entered zero while previously saving .
    Thanks in advance ,
    Regards,
    Anil Shanbhag

    Hi ,
    The SES has all line items with WBS elements , the idea to delete the SES is to free-up the budget which is commited due to creation of this SES.
    I have tried deleting individual line items in SES ,but system gives error "enter quantity" where line item quantity is zero. there are few such line items with quantity zero out of total 26 line items in the SES.
    I want to know whether Blocking of SES at header level will free-up the budget as it is the basis purpose for deleting SES , which i think may not serve the purpose.
    Kindly advise.  Thanks for your inputs.
    Warm Regards,
    Anil

  • Error while creating service entry sheet

    Hi Experts,
    I am trying to create service entry sheets using bapi 'BAPI_ENTRYSHEET_CREATE'  for a purchase order with multiple line items. The bapi creates SES for the first line item but gives error 'User xxxxxx already processing purchase order nnnnnnnnnn' for the rest of all. Tried using 'COMMIT AND WAIT' after bapi call but it's not working.
    Kindly help me out with the solution.
    Regards,
    B.Siddhesh

    Hi Siddhesh,
    Please use below code before calling the 'BAPI_ENTRYSHEET_CREATE' to unlock the PO.
    Hope this is helpful.
    **Delete the Lock objects EKKO Header PO.
         CALL FUNCTION 'ENQUEUE_READ'
           EXPORTING
             GNAME  = 'EKKO'
             GARG   = ''
             GUNAME = SY-UNAME
           TABLES
             ENQ    = ENQ
           EXCEPTIONS
             OTHERS = 0.
         IF NOT ENQ IS INITIAL.
           DESCRIBE TABLE ENQ LINES SY-TFILL.
           CHECK SY-TFILL > 0.
           CALL FUNCTION 'ENQUE_DELETE'
             EXPORTING
               SUPPRESS_SYSLOG_ENTRY = 'X'
             IMPORTING
               SUBRC                 = RC
             TABLES
               ENQ                   = ENQ.
         ENDIF.
    **Delete the Lock objects EKPO Header PO.
         CALL FUNCTION 'ENQUEUE_READ'
           EXPORTING
             GNAME  = 'EKPO'
             GARG   = ''
             GUNAME = SY-UNAME
           TABLES
             ENQ    = ENQ
           EXCEPTIONS
             OTHERS = 0.
         IF NOT ENQ IS INITIAL.
           DESCRIBE TABLE ENQ LINES SY-TFILL.
           CHECK SY-TFILL > 0.
           CALL FUNCTION 'ENQUE_DELETE'
             EXPORTING
               SUPPRESS_SYSLOG_ENTRY = 'X'
             IMPORTING
               SUBRC                 = RC
             TABLES
               ENQ                   = ENQ.
         ENDIF.
    Reward if helpful.
    Regards,
    Shakeel Ahmed

  • Creating Service Entry Sheet without using Service Master/Service lines

    We are invoking the BAPI_EntrySheet_Create to create the service entry sheet. We are currently facing this issue...
    1) For assigned PO's, we are getting the PO item and Account assignment information from BAPI_PO_GetDetail. We are using these values to populate the parameters/tables to invoke BAPI_EntrySheet_Create. For population the Entrysheetservices table, we are not using information from Service Master/Service lines but use the information we get from an external system to populate the Service lines(ESLL). We do not provide a Package No/Service information when invoking the BAPI but populate the service lines with short text, quantity, Gross price etc without service information like package no, outline indicator etc. The BAPI creates a service enty sheet successfully(this is without the SES Acceptance indicator not being set) but when we lookup the SES# from ML81n transaction the ESLL details lines are not displayed.
    When displaying the SES using transaction ML81N, the header information is displayed correctly but the lines are not displayed. The Header information is correctly populated in ESSR table and detail is also populated in ESLL table. I think the cross reference information is correctly set in ESLH table to pull up the detail when ML81N as it is missing the package/sub pack information.
    Your expert advise in resolving this issue is very much appreciate. Please advise.

    Hi,
    Creating Service entry sheet using bapi  BAPI_ENTRYSHEET_CREATE
    For creating service entry sheet follow below link and it helps to you.
    http://wiki.sdn.sap.com/wiki/display/ABAP/CreatingServiceEntrySheetusing+BAPI
    Regards,
    Sekhar

  • How to create a service entry sheet for a purchase order acct assmt = U

    I need to create a service entry sheet using bapi BAPI_ENTRYSHEET_CREATE for a purchase order with account assignment category as 'unknown' (U).I am able to create SE sheet for a purchase order if account assignment is maintained in PO but our requirement is susch that at the tme of PO creation they dont assign Acct assgnment cat but want SE sheet to be entered with category 'P' and WBS elemnt . I tried to pass the asscount assgnment category in the header data as 'P' and entered WBS element in table it_services. I am getting error message
    'No account assignment exists for serviceu2019. any help in this regard is highly appreciated.

    can u create it SE entry  manually  without A/c assignment  ?.
    regards
    Prabhu

  • Service entry sheet in accepted status without line item

    Hi all,
    Service entry sheet 927080 has acceptance indicator enabled. The revoke
    of acceptance is not possible for this entry sheet. Service line item
    is not available in this service entry sheet. Refered PO has the status
    Services are delivered, waiting for invoice verification. While doing
    invoice verification, Error appears No (suitable) item found for
    purchase order.
    Service entry sheet is having non-editable status since acceptance
    indicator is enabled. The same cannot be revoked.
    On going thru the header change document, user has deleted the line
    item. Item change document is not available. It has change document
    no. -
    25 with time 16.16 and -
    27 with time 16:15.
    Kindly advice, how to do rectify the Service entry sheet with service
    line item.
    Rgds
    Suddy

    Hi all,
    Any advice.
    Rgds...Suddy

  • WBS Commitment during service entry sheet

    Dear SAP Guru,
    I have one query related with punching of service entry sheet with reference to PO of proejct WBS.
    I have made one service PO with accnt.assignment category P and item category D, i have assigned one WBS element in account assignment tab.
    Now I am entering service entry sheet w.r.t. this service PO, the service entry is posted.Acceptance is still pending.
    so no accountng docs.is generated.
    Now I have made again One similar PO by taking the same WBS as taken is previous PO.
    While entering SES, System is allowing to punch the service entry sheet. Is this possible?
    Are there any committment created by SAP w.r.t WBS if we are entering SES with same WBS again and again?
    Is there any logic,report or transaction available in SAP?
    Regards,
    Ravi

    Hi,
    Please check the below links..
    Total Commitment Report for Cost Centres, WBS & Orders
    /thread/1393246 [original link is broken]
    http://help.sap.com/saphelp_ides/helpdata/en/fd/45af5d9d6411d189b60000e829fbbd/content.htm
    Hopt it may help you..
    Kuber

  • 99 items in service entry sheet

    Hello,
    Concerning the transfer of shipment cost items to MM / FI.
    This is what's described in notes notes 333656 and 198678:
    If you transfer more than 99 account assignment lines to MM, than more than one service entry sheet will be created.
    Why this is build up that way? Why not just create 1 service entry sheet for all lines?
    Is there a way to avoid that more than 1 service entry sheet is created if more than 99 account assignment lines are transferred? Can you change the maximum number of items in a service entry sheet from 99 to 999 items?
    e.g. if you transfer a shipment cost item with 320 account assignment lines, it should not be split up into
        -    3 service entry sheets with 99 items
        -    1 service entry sheet with 23 items
    BUT only one service entry sheet should be created with 320 lines...
    The reason why this is needed in our case is that we recenty changed the cost distribution from the item categories from "delivery"-level to "delivery item"-level. Because of this change, there are many more account assignment lines per shipment cost item and we get more than 99 account assignment lines per shipment cost item. In some reporting programs (Z*-programs) which do not take into account that one shipment cost item can be transferred into more than one service entry sheet? It's a huge work to correct these reporting programs...
    kr,
    Alexander

    Hi Alexander,
    According to the standard system design there is a limit for up to 99 DIFFERENT account assignment lines per whole service      
    entry sheet document (not per service line in SES).
    This is due to technical limitation of the field ESKN-ZEKKN of type NUMC(lenght 2).  I am sorry that I can not provide you a solution within the standard for your problem.
    As a workaround, you need to split the services in such a way that you have less then 100 different account assignment combinations.
    If you believe that this feature is in general interest of other SAP users, you may apply to get in touch with a SAP User Group ( i.e. DSAG        
    or ASUG) in order to check the feasibility for opening a development  request, aiming to enhance SAPs product portfolio offering for future        
    releases. Further details about this could be found in the link               
    http://service.sap.com/rollin                                                                               
    Please see the note:                                                     
    11      Requested function not contained in standard system                   
    Regards,
    Edit

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

  • Release startegy of Service Entry Sheet

    I configured release strategy for Service entry sheet with Release code 08.
    When i actually go to ML81N to release the same, i get same code in the drop down but when i select the same (08), it gives me "error  Release with code 08 not possible", instead it allows only to release the same with Release code R1 which is the code for Purchase Requisition.
    What could be the problem ?
    Regards,
    Shail

    Hi,
    I have just configured two release strategies for entry sheet's and they work correctly in our development sandpit. when I moved these to the test client, the config is showing correctly but the internal tables have not updated properly.
    This gives me the same error, but that is because the system cant actually find the release code.
    Is this the same problem you are having? If so I can post the solution for you.
    Cheers,
    Tim

Maybe you are looking for