cancel
Showing results for 
Search instead for 
Did you mean: 

ESLL-DEL/ACT_MENGE/ACT_WERT/NOT UPDATE WHEN DELETE ENTRYSHEET

former_member249594
Participant
0 Kudos

Dear Friends:

We developed a program to perform service entry against purchase order, the functionality of this program is just similar with transaction code Ml81N. In this customized program, the standard function module MS_DELETE_SERVICE_ENTRY_MULTI is invoked to perform the entry sheet deletion(Because we can not find a BAPI for entry sheet deletion). And we use the BAPI BAPI_ENTRYSHEET_CREATE to perform entry sheet creation. Actually the program works well in the past one year, but at the end of last year( Maybe on 2010-12-29), a strange behaviour occured.

Ths User A create the entry sheet by costomized program, and the User B found that the data in the entry sheet is wrong input, so he deleted(By customized program, at this point MS_DELETE_SERVICE_ENTRY_MULTI was invoked) the entry sheet, and ask User A to create a new one again. But when the User A create the entry sheet and save it( At this time BAPI_ENTRYSHEET_CREATE is invoked), an error mesage SE 149 is issued from BAPI_ENTRYSHEET_CREATE .

After we deug and the progra and check the data base table, we found below symptoms:

1/ The deletion flag(ESLL-DEL) of sub-package is not set in table ESLL;

2/ The quantity and amount of deleted entry sheet is not deducted from the ESLL-ACT_MENGE and ESLL-ACT_WERT of package of corresponding purchase order item. And same as ESKL-ACT_MENGE.

This problem is infrequence(Only once as far as I post this thread), and we try to simulate this problem for many times but failed.

We check the OSS notes and find symptom described in note 757951 is similar with our case, but it just metion program in ESKL , I am not sure it is a proper solution to our probelm, and I am not very sure the problem is a bug of customized program or SAP standard program or somethis else.

The highest support package of our SAP software component SAP_APPL is SAPKH50009.

Below is the code for delete entry sheet.


  METHOD delete_entrysheet.
    DATA: ls_syst TYPE syst.
    DATA: ls_eessr TYPE eessr,
          lt_eessr TYPE TABLE OF eessr,
          lt_essr TYPE TABLE OF essr,
          ls_essr TYPE essr.

    IF entrysheet_detail-header-delete_ind EQ yes.
      ls_syst-msgno = '041'.
      ls_syst-msgty = message_collector->s_message_parameters-success.
      ls_syst-msgv1 = mlmain-exmnr.
      message_collector->get_message( ls_syst ).
      CLEAR ls_syst.
    ELSE.

      ls_essr-lblni = entrysheet_detail-header-sheet_no.
      ls_essr-bktxt = mlmain-bktxt.
      APPEND ls_essr TO lt_essr.

      CALL FUNCTION 'MS_DELETE_SERVICE_ENTRY_MULTI'
        EXPORTING
          i_authority_check   = yes
          i_revoke_acceptance = yes
          i_budatum           = mlmain-budat
        TABLES
          t_essr              = lt_essr
          t_messr             = lt_eessr.
      LOOP AT lt_eessr INTO ls_eessr
                    WHERE msgid NE 'SE'
                    AND   msgno NE '110'.
        MOVE-CORRESPONDING ls_eessr TO ls_syst.
        message_collector->get_message( ls_syst ).
      ENDLOOP.

      IF sy-subrc NE 0.
        LOOP AT lt_eessr INTO ls_eessr.
          MOVE-CORRESPONDING ls_eessr TO ls_syst.
          message_collector->get_message( ls_syst ).
        ENDLOOP.
      ENDIF.

      CLEAR ls_syst.
    ENDIF.

    IF message_collector->check_error_occurs( ) EQ yes.
      mlmain-error_flag = yes.
      ROLLBACK WORK.
      EXIT.
    ELSE.
      CLEAR: mlmain-exmzt,
             mlmain-exmwr,
             mlmain-exmfs,
             mlmain-incrt,
             mlmain-exmnr,
             mlmain-exmpy,
             mlmain-exmnr.
      CLEAR: entrysheet_detail-header_text.
      mlmain-exmzt = yml_status_is_tech_comfirm.

      update_contract_exm( ).

      ls_syst-msgno = '054'.
      ls_syst-msgty = message_collector->s_message_parameters-information.
      ls_syst-msgv1 = mlmain-pcnum.
      ls_syst-msgv2 = mlmain-deptm.
      ls_syst-msgv3 = mlmain-gjahr.
      ls_syst-msgv4 = mlmain-monat.
      message_collector->get_message( ls_syst ).
      CLEAR ls_syst.
      COMMIT WORK AND WAIT.
    ENDIF.
  ENDMETHOD.                    "delete_entrysheet

Can any friends give me some idea on this problem?? Thank you very much in advance.

Joe

Best Regards

2011-01-10

Edited by: Gangrong Chen on Jan 10, 2011 7:05 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Aksel
Participant
0 Kudos

Same problem.

Did you find any solution?

former_member249594
Participant
0 Kudos

Any Comments?

Aksel
Participant
0 Kudos

Maybe this sapnote: 757951

Clemenss
Active Contributor
0 Kudos

Hi Gangrong,

if someone else is maintaining the object, you can not delete it at the same time without data inconsistency.

You must set an enqueue lock first, do you?

Regards,

Clemens

former_member249594
Participant
0 Kudos

Hi Clemens,

Yes, of cause, all the related objects, such as purchase order, entrysheets and customized objects, are set the enqueue locks when the user is performing deletion or creation, and I am sure the enqueue locks work well.

In my option, I am afraid that my problrm mentioned above is to related to enqueue lock, becaue the entry sheet is created by User A and deleted by User B at different time.

Best Regards

Joe