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

Similar Messages

  • BAPI for service entry sheet

    Hi !
    The user wants to accept services entry sheet in mass, I'm looking for a BAPI to do that ...do you know some?
    I found :
    BAPI_ENTRYSHEET_CREATE       
    BAPI_ENTRYSHEET_DELETE       
    BAPI_ENTRYSHEET_GETDETAIL    
    BAPI_ENTRYSHEET_GETLIST      
    BAPI_ENTRYSHEET_GETRELINFO   
    BAPI_ENTRYSHEET_RELEASE      
    BAPI_ENTRYSHEET_RESET_RELEASE
    Obs.: Its not to release ..its just to accept the service entry sheet (the green flag in the ml81n).
    Thanks,
    Rodrigo

    Hi,
    fin_entry = 'X'.
    above mentioned flag indicator in header level enter remove acceptance indicator and try  . . .
    i hope this will help
    regards
    srini

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

  • 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

  • BAPi to approve service entry sheet

    Hi All,
    I want to approve a service entry sheet
    I am using the BAPi - BAPI_ENTRYSHEET_CREATE, I am able to create a service entry sheet but unable to approve it.
    Please let me know if there is a BAPi- for approving a service entry sheet.
    Regards
    Shiva

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

  • BAPI for approving service entry sheets

    Hi All,
    I want to approve a service entry sheet
    I am using the BAPi - BAPI_ENTRYSHEET_CREATE, I am able to create a service entry sheet but unable to approve it.
    Please let me know if there is a BAPi- for approving a service entry sheet.
    Regards
    Shiva

    Hi,
    Try this BAPI " BAPI_SERVICE_CREATE ".
    Regards
    Milan

  • BAPI to change data in a service entry sheet

    Hi all,
    We would like to change data in already created service entry sheet.
    Please let us know any BAPIs on this regard.
    Thanks and regards,
    Shiva

    Hi,
    Here are the BAPI's
    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
    Regards
    Sudheer

  • 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

  • BAPI service entry sheet

    Hi,
       i am creating service entry sheet for service PO through BAPI_ENTRYSHEET_CREATE.I am getting a pop up with message "Buffer table not up to date".But while creating manually this pop up is not coming.I have checked both set of datas at header level table, it is same.how to rectify this problem.
    regards,
    Manesh.R

    Thanx EDIT,
                          i refered this note and followed the steps given, now  the system is throwing a new error maintain service "Line 0000000010: please specify a service".
    These are the fields that i've maintained:
    EntrysheetHeader:
    PCKG_NO :   0000000001
    SHORT_TEXT   :BAPI FOR ENTRY SHEET UPLOAD
    PO_NUMBER     :2009200084
    PO_ITEM            : 00010
    DOC_DATE                09/22/2010
    POST_DATE               09/22/2010..
    ACCEPTANCE :        X
    ENTRYSHEETSERVICES:
    For the service package:
    PCKG_NO       : 0000000001
    LINE_NO         : 0000000001
    EXT_LINE         :0000000000
    OUTL_LEVEL 0
    OUTL_IND:          X
    SUBPCKG_NO    :0000000002
    For planned service:
    PCKG_NO    0000000002
    LINE_NO    0000000002
    EXT_LINE     0000000010
    SUBPCKG_NO     0000000000
    SERVICE      5002
    QUANTITY   8.00
    GR_PRICE    120 ...
    PLN_PCKG 0000003065(ESLL-PACKNO)
    PLN_LINE 0000000001(ESLL-INTROW)
    Do i need to maintain any other fields ?

  • Changing Service Entry Sheet - Call Transaction / BAPI / etc

    Dear all,
    I need to create a program in order to change data  in service entry sheets services or/and delete services. I wanted to use a BAPI but I can not find one for changing data (only for creating). Trying to use call transaction for transaction ML81N has been nearly impossible due to positioning issues. (It is an Enjoy transaction and acts differently when in batch input mode). The old transaction ML81 also has this positioning problem.
    Has anybody ever done this and has any tips?
    Regards

    Hi,
    The below BAPI's are avilable for transaction ML81N
    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
    Regards
    Sudheer

  • BAPI for Automatic Good Recipt refer to Service Entry Sheet

    Hello Experts,
    I need to create an automatic GR document after the SES creation/acceptance through importing time sheets from CATS to MM-SRV using transaction CATM. When doing so, the service entry sheet is created and after the acceptance is automatically set by the EXIT_SAPLMLSR_010, but the GR document is not created. Is there a BAPI for the automatic creation of the GR document?
    Thank you
    Mario F.

    Hi,
    I think you should check this in ML81N. You try to post and check the error there. Not all the errors are reported back in you scenario.
    cheers,
    Sanjeev

  • Regarding BAP -BAPI_ENTRYSHEET_RELEASE for Service Entry Sheet

    Dear Support,
       As we have implemented the BAPI -BAPI_ENTRYSHEET_RELEASE for Releasing the Service
    Entry Sheet automatically.
    But if we release the Service Entry Sheet Mannualy then at the month end we can able to change the
    Posting period after closing of periovious period but in this BAPI system is not able to change the
    Posting Date after the Closing of Period at the Month End, So we are facing a big Problem.
    So pls provide the Solution So that our problem can be resolve.
    Thanks
    MK

    hi
    you have to apply your logic to the bapi and correct the coding for the closed period

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

Maybe you are looking for

  • HP Digital Imaging Monitor not seeing Photosmart C6280 on network.

    I have put my Photosmart C6280 All-in-One printer on my wired network, and the HP Digital Imaging Monitor does not see the printer any longer.  Why?

  • Cat 500 disabled port state

    I have a couple of Cat 500 express routers in a two building network connected with wireless access points. I had a wireless drop to due to a user unplugging the wireless AP and my switch put my port into disale state "due to traffic only passing in

  • Roles and user (SUIM)

    how to find the roles of a transaction and who use(d) the tcode

  • Missing sidecar - remove missing file status

    I have raw files that had metadata written to XMP sidecar files, the XMP are now missing, and I don't want to have LR create new sidecar files. The files show up as missing in the catalog. How can I get rid of the missing status and the little "metad

  • Presets or Bookmarks

    Is there a way to preset or bookmark the Internet Radio Stations in iTunes? I would like one click access. If anyone knows, I would appreciate it... J iMac G4   Mac OS X (10.4.3)