Validations for Purchase REQ and Tracking number using badi

 

BADI - ME_PROCESS_REQ_CUST

METHOD - CHECK


* If the Purchase REQ is empty then raise a message 'Enter purchase REQ".

* If Tracking number is empty Then raise message "ENTER TRACKING NUMBER'.


METHOD if_ex_me_process_req_cust~check.

    cl_mm_pur_s4_pr_ext_helper=>get_purchase_requisition(
             EXPORTING
               io_purchaserequisition im_header
             IMPORTING
               es_pr_header           DATA(ls_pr_header)
               et_pr_items            DATA(lt_pr_items)
               et_pr_acctassignmt     DATA(lt_pr_acctassignmt).


    IF sy-uname  'TRNGAB63'.

      LOOP AT lt_pr_items INTO DATA(ls_pr_item).

        IF ls_pr_item-purreqnrequestor IS INITIAL.
          MESSAGE 'Please enter RequistionerTYPE 'E'.
        ELSEIF ls_pr_item-requirementtrack IS INITIAL.
          MESSAGE 'Please enter Tracking numberTYPE 'E'.

        ENDIF.
      ENDLOOP.

    ENDIF.

  ENDMETHOD.

Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).