Fetch G/L and Cost center while creating PR

In this scenario GL account and cost center fetched to CMOD (includes)

    DATA : li_items TYPE mmpur_accounting_list,
                  lw_items TYPE mmpur_accounting_type,
                  ls_acct  TYPE exkn.
  DATA: l_f_refer TYPE REF TO if_purchase_requisition_item.
  IF im_req_item IS NOT INITIAL.
       CALL METHOD im_req_item->if_acct_container_mm~get_items
           RECEIVING
               re_items = li_items.

      IF NOT li_items IS INITIAL.
         LOOP AT li_items INTO lw_items.
             CALL METHOD lw_items-model->get_exkn
                 RECEIVING
                    re_exkn = ls_acct.
         ENDLOOP.
    ENDIF.
  ENDIF.

* ls_acct have GL and cost center data.
* im_req_item is import parameter in function module.


******************************Thank You***************************

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+ ).