Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Problem in getting Cost center while creating PR

Former Member
0 Likes
909

Hi,

My requirement is as follows,

While creating PR, I need to validate based on document type and Cost center in account Assignment Tab.

For this I searched and found the BADI - ME_PROCESS_REQ_CUST.

In th above BADI, I am able to get Items data from PROCESS_ITEM method and cost center from PROCESS_ACCOUNT method.

My Issue is

For Service documents types PROCESS_ACCOUNT method is not being called and I am not able to get cost center value.

Thanks and Regards,

Pavan.

1 ACCEPTED SOLUTION
Read only

atul_mohanty
Active Contributor
0 Likes
772

Hi

Please check the following

DATA :   li_items TYPE mmpur_accounting_list,
             lw_items TYPE mmpur_accounting_type,
             lw_exkn  TYPE exkn.


   IF im_item IS NOT INITIAL.


   CALL METHOD im_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 = lw_exkn.


* Check the value of Cost Center with lw-exkn-KOSTL


    ENDLOOP.

ENDIF.

   ENDIF.

OR

Check the User Exit EXIT_SAPLMLSP_030 / EXIT_SAPLMLSP_031 may help you.

Hi,

My requirement is as follows,

While creating PR, I need to validate based on document type and Cost center in account Assignment Tab.

For this I searched and found the BADI - ME_PROCESS_REQ_CUST.

In th above BADI, I am able to get Items data from PROCESS_ITEM method and cost center from PROCESS_ACCOUNT method.

My Issue is

For Service documents types PROCESS_ACCOUNT method is not being called and I am not able to get cost center value.

Thanks and Regards,

Pavan.

3 REPLIES 3
Read only

former_member302911
Active Participant
0 Likes
772

HI Pavan,

you can retrieve accounting data also from the PROCESS_ITEM.

This is possible using Method IF_ACCT_CONTAINER_MM~GET_ITEMS of IM_ITEM Object.

Regards,

Angelo.

Read only

atul_mohanty
Active Contributor
0 Likes
773

Hi

Please check the following

DATA :   li_items TYPE mmpur_accounting_list,
             lw_items TYPE mmpur_accounting_type,
             lw_exkn  TYPE exkn.


   IF im_item IS NOT INITIAL.


   CALL METHOD im_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 = lw_exkn.


* Check the value of Cost Center with lw-exkn-KOSTL


    ENDLOOP.

ENDIF.

   ENDIF.

OR

Check the User Exit EXIT_SAPLMLSP_030 / EXIT_SAPLMLSP_031 may help you.

Read only

0 Likes
772

Hi,

Thanks for the answer.