Tuesday, November 3, 2009

IDOC Data Display and Delete

There are two usefull functions for display and delete IDOC data.

First function which displays a single idoc data is no different than we02 transaction. It displays idoc data using a tree structure.

      call function 'EDI_DOCUMENT_DATA_DISPLAY'
        exporting
          docnum               = gv_docnum
        exceptions
          no_data_record_found = 1
          others               = 2.
      if sy-subrc NE 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.






The ohter function which deletes given idoc data helps you to remove idoc related data from edidc , edids and
edi40 (OR edi30c OR edidoc , for older versions) . However you can do it using we11 transaction. Using the standart reports is always recomended. There may be much more idoc related data to remove like application log. Here i just give you an opinion about the function modules behaviour.

          call function 'EDI_DOCUMENT_DELETE'
          exporting
            document_number        = gv_docnum
          exceptions
            idoc_does_not_exist    = 1
            document_foreign_lock  = 2
            idoc_cannot_be_deleted = 3
            not_all_tables_deleted = 4
            others                 = 5.
        if not sy-subrc is initial.
          message id sy-msgid type 'I' number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

No comments:

Post a Comment