Quantcast
Viewing all articles
Browse latest Browse all 3184

SRM Purchase Approval note not updated

Hi Techies,

 

I was trying add SRM PO approval note at header during the approval process but I could not get success.

 

below is the source code for Approval note add at header in SRM PO approval process

 

Source Code :

 

 

 

DATA:mo_pdo TYPE REF TO /sapsrm/if_pdo_base.

 

DATA:lo_pdo_po_text    TYPE REF TO /sapsrm/if_pdo_do_longtext.

 

 

 

TRY.

         CALL METHOD /sapsrm/cl_pdo_factory_po_adv=>get_instance

           EXPORTING

             iv_header_guid  = wa_header-guid

             iv_mode         = 'APPROVAL'

             iv_process_type = 'ECPO'

             iv_wiid         = iv_wiid

             iv_user_id      = iv_agent

           RECEIVING

             ro_instance     = mo_pdo.

       CATCH /sapsrm/cx_pdo_wf_mode_ban .

       CATCH /sapsrm/cx_pdo_wrong_bus_type .

       CATCH /sapsrm/cx_pdo_pd_read_error .

       CATCH /sapsrm/cx_pdo_lock_failed .

       CATCH /sapsrm/cx_pdo_no_authorizatio .

       CATCH /sapsrm/cx_pdo_parameter_error .

       CATCH /sapsrm/cx_pdo_status_error .

       CATCH /sapsrm/cx_pdo_incons_user .

       CATCH /sapsrm/cx_pdo_abort .

       CATCH /sapsrm/cx_pdo_error .

     ENDTRY.


     lo_pdo_po_text ?= mo_pdo.

 

CALL METHOD lo_pdo_po_text->update_longtext

            EXPORTING

              iv_p_guid          = wa_header-guid

              iv_tdid            = 'NOTM'

              iv_tdspras         = sy-langu

              iv_tdformat        = 'X'

              iv_text_preview    = lv_note

*          CHANGING

*            co_message_handler =

              .

*         CATCH /sapsrm/cx_pdo_abort .

*        ENDTRY.



      mo_pdo->submit_update( CHANGING co_message_handler = mo_pdo_message_consumer ).

 

COMMIT WORK.

       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.


Please suggest me and explain where I did mistake .

 

thanks in Advance


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>