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

Hi 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

Similar Messages

  • Short text and number of outline not maintained error in BAPI_ENTRYSHEET_CREATE

    Hi Experts,
    I am using BAPI BAPI_ENTRYSHEET_CREATE' for creation of service entry sheets.
    I passed below data into the respective parameters
    Entry Header Sheet -
    SHORT_TEXT                
    THIS IS SAMPLE TEXT
    PO_NUMBER                 
    231002130
    PO_ITEM                   
    00010
    And just executed BAPI, I am able to get the ENTRYSHEET NUMBER.
    Next I tried passing below data again
    Entry Header Sheet -
    SHORT_TEXT                
    THIS IS SAMPLE TEXT
    PO_NUMBER                 
    231002130
    PO_ITEM                   
    00010
    ENTRYSHEETSERVICES:
    QUANTITY                             
    10.000
    BASE_UOM                  
    AU
    And then executed - I am getting an error saying 'Short text and number of outline not maintained'.
    My input file to  BAPI contains the structure as  PO, Item Number, Short Text for Service Entry sheet and Quantity.
    Please suggest if any ideas.
    Regards,
    Rafi

    Hi 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

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

  • BAPI_ENTRYSHEET_CREATE : Error message SE134 -  please enter a price

    Hi All,
    I try to use this bapi to upload my Service Entry Sheet with given data.
    However, I encountered the above error message ' Please enter a price '.
    I've checked that i passed in the GR_PRICE value and all the required parameters (ENTRYSHEETACCOUNTASSIGNMENT, ENTRYSHEETSERVICES ENTRYSHEETSRVACCASSVALUES, HEADER) too.
    Does anyone encounter this problem?
    Hope to hear from you soon.
    Thank you.
    From,
    SW

    Hi,
    Thank you for your suggestion. The notes was alreay implemented earlier.
    i've found out the reason.... this is because, i passed in some value to entrysheetservices-pln_pckg and entrysheetservices-pln_line. it supposed to be set ast '00000000'.
    Regards,
    sw

  • 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

  • Error While Updating Classification Data - Error Message

    Hi,
    Has anyone encountered this error message while updating articles through ARTMAS04 IDOC. We have seen this error so many times and the only solve we could find is if the IDOC is reprocessed then it works fine. I definitely know that's not the solve but it is working temporarily.
    Any help would be greatly appreciated
    Thanks,
    Sri

    Rahul,
    Which function module or transaction are you trying to call?
    It looks like that this update only can happen when logged in to SAP itself.. Because it is trying to call the sap gui..
    Possible solutions you can find in following thread:
    Dump during BAPI_ENTRYSHEET_CREATE calling from Portal
    kind regards,
    Robin

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

  • Error while initiating the sap in my personal computer

    Dear Pals,
    I have installed sap package in my system, now days, it is giving following error, please help me to over come this problem:
    1. Error: In table TCPDB, there are "0" entries.  showing in syslog.
    2. most of the time disp+work.exe-sapservice R35
    94,816k to 97,100, 93,792K fluctating and taking 99% of CPU's usage.
    Please let me know the exact solution for this problem.
    even with the above problem, I could able to do work on sap on my system.
    Thanking you in anticipation.
    Regards
    Madhu Vaddi

    Rahul,
    Which function module or transaction are you trying to call?
    It looks like that this update only can happen when logged in to SAP itself.. Because it is trying to call the sap gui..
    Possible solutions you can find in following thread:
    Dump during BAPI_ENTRYSHEET_CREATE calling from Portal
    kind regards,
    Robin

  • Error during creation of entry sheet via BAPI

    Hi all,
    I have a problem with that bapi and that user exit. I can create a entry sheet with the bapi BAPI_ENTRYSHEET_CREATE and get it accepted using the flag BAPIESSRC-ACCEPTANCE of the header.
    But if i use the enhancement SRVEDIT in order to do a custom validation i get the following error during the creation of the entry sheet: "E SE 214 Error during update".
    Even if i don't do anything in the user exit (only activate it) i still get the message "Error during update". Anybody knows if there is a problem with that user exit? should i do something specific to use that user exit (it doesn't exist any documentation for the user)
    Anybody has solved the issue? Anyone knows another user exit to use in the moment of save the changes of the entry sheet?
    Many thanks in advance
    Aaron

    Hi John,
    Some of the structures you have to fill for the IDOC belongs to a  referencing ...X structure. For example structure BAPI1022_FEGLG002 and BAPI1022_FEGLG002X.                                                                               
    When you fill the capitalization dat (BAPI1022_FEGLG002-CAP_DATE = '19981231') it's necessary to fill the corresponding field (BAPI1022_FEGLG002X-CAP_DATE = 'X') to  specify that the content of the field should be transferred to the fixed asset. Otherwise it'll be not transferred and you'll get an error message instead.                                                 
    Regards Bernhard

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

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

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

    Hi 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

  • Problems with BAPI_ENTRYSHEET_CREATE

    Hi,
    I am using that function to fill several lines in a document.
    He puts the lines but the field costcenter - kostl is the same to every line but i am sending diferent kostl's in the function.
    It apears that he choses random number in the table sendt in the function and puts to every line.
    What could be the problem??
    i am using the code:
            LOOP AT it_am INTO wa_am WHERE xblnr = wa_am_i-xblnr
                                                   AND txz01 = wa_am_i-txz01.
              counter = counter + 1.
              it_eskn-pckg_no = pac.
              it_eskn-gl_account = it_account-g_l_acct.
              it_eskn-costcenter = wa_am-kostl.
              it_eskn-serial_no = counter.
              it_eskn-counter = counter.
              APPEND it_eskn.
              CLEAR v_quant.
              it_eskl-percentage = ( wa_am-tbtwr / v_quant ) * 100."wa_am_h-mkntm.
              it_eskl-pckg_no = pac.
              it_eskl-line_no = counter.
              APPEND  it_eskl.
            ENDLOOP.
          CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
            EXPORTING
              entrysheetheader            = wa_header
              testrun                     = mode
            IMPORTING
              entrysheet                  = num
            TABLES
              entrysheetaccountassignment = it_eskn
              entrysheetservices          = it_esll
              entrysheetsrvaccassvalues   = it_eskl
              return                      = it_return.
    in table it_eskn there are 100 lines with diferent kostl.
    tks in advanced

    ohhh....
    do i need to run the function  CONVERSION_EXIT_ALPHA_INPUT ??
    stupid error
    i will try...tks

  • Regarding BAPI_ENTRYSHEET_CREATE .

    Hi All,
    We are trying to create Service entry sheet using BAPI_ENTRYSHEET_CREATE using the follwonig code:
    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,
      i_accass 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,
      po_accass TYPE bapiekkn 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 = '4500146696'.
      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.
      wa_header-acceptance = 'X'.
      wa_header-doc_date   = '20080819'.
      wa_header-post_date  = '20080819'.
      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.
        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-quantity   = 1.
        bapi_esll-gr_price   = po_services-gr_price.
        bapi_esll-price_unit = po_services-price_unit.
        APPEND bapi_esll.
      ENDLOOP.
      LOOP AT po_accass .
        i_accass-gl_account = po_accass-g_l_acct.
        i_accass-bus_area = po_accass-bus_area.
        i_accass-costcenter = po_accass-cost_ctr.
        i_accass-co_area = po_accass-co_area.
        APPEND i_accass.
      ENDLOOP.
      CALL FUNCTION 'BAPI_ENTRYSHEET_CREATE'
        EXPORTING
          entrysheetheader            = wa_header
        IMPORTING
          entrysheet                  = ws_entrysheet_no
        TABLES
          entrysheetservices          = bapi_esll
          entrysheetaccountassignment = i_accass
          return                      = i_return.
    In debugging we get a proper value in the parameter ws_entrysheet_no , but when we check in ml81n usig this ws_entrysheet_no
    we get the error 'ws_entrysheet_no does not exists'.
    What is the reason?
    Thanks,
    Anubhav.

    Hi Pushkar,
    Even after using BAPI_TRANSACTION_COMMIT  , i am facing the same issue.
    But if remove the following code lines from the code in my previous post , i can see the SES in ml81n:
    wa_header-acceptance = 'X'.
    Please help,
    Anubhav.
    Edited by: Anubhav Jain on Aug 22, 2008 7:35 AM

  • Hi BAPI_ENTRYSHEET_CREATE Problem

    Hi abapers
    we have requirement to call BAPI_ENTRYSHEET_CREATE from JAVA throguh JCO.
    but the COMMIT is already writeen by sap inisde ABAP Source code.
    but when JCO called BAPI_ENTRYSHEET_CREATE Multiple times java people getting the error messgae as 'USER ALREADY PROCESSING PURCHASE ORDER'.
    i know that i can use 'BAPI_TRANSACTION_COMMIT' where WAIT = 'X' for BAPI which doesn't have inside Commit code.
    for BAPI_ENTRYSHEET_CREATE already commit is written.
    how can i avoid the above error message while calling form JAVA.
    thanks & Regards
    Ramesh

    Hi ramesh,
    pass the TESTRUN parameter as 'X' and run.
    the
    if the return table is empty or is with no errors, then use bapi_transaction_commit.
    else use the fm BAPI_TRANSACTION_ROLLBACK.
    Regards,
    ravi

Maybe you are looking for