Application Development 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: 

Update GL Account number in account assignment PO

Former Member
0 Kudos
575

Dear Guru's,

I have a requirement to replace proposal gl account in PO after item is entered, this requirement it's because of for several document type they need to map the gl account into other account but didn't want to use config. It's frustating but this got to be done.

I have tried using EXIT_SAPMM06E_016 but looks like value changed after the exit.

If there is no other way I'm gonna use spot as my last resort, please help

4 REPLIES 4

eduardo_hinojosa
Active Contributor
0 Kudos
108

Hi

Have you see badi ME_PROCESS_PO_CUST method PROCESS_ACCOUNT?

Regards

Eduardo

0 Kudos
108

Hi ,

Just to add more to Hinojosa reply you can set the GL account details as below:

In ME_PROCESS_PO_CUST BADI use the below code in method PROCESS_ACCOUNT

DATA: IT_ACC TYPE MEPOACCOUNTING.

*First inorder to get your header details to get the document type get the Item corresponding item

CALL METHOD IM_ACCOUNT->GET_ITEM " get item

RECEIVING

RE_ITEM = IM_ITEM.

*Then from the item get the correponding header

LS_OBJ = IM_ITEM->GET_HEADER( ). "get header

LS_MEPOHEADER = LS_OBJ->GET_DATA( ). "get header data

Now in LS_MEPOHEADER you will get the document type details.

*Then inoder to set the G/L account use the below part

*to get the account details

CALL METHOD IM_ACCOUNT->GET_DATA

RECEIVING

RE_DATA = IT_ACC.

*change/set the G/L

IT_ACC-g/l account = .....

  • to set the same

CALL METHOD IM_ACCOUNT->SET_DATA

exporting

RE_DATA = IT_ACC.

Regards,

Deepak.

Former Member
0 Kudos
108

Hi Eduardo,

Thanks ffor the reply, I have tried BADI that you suggest and its event is before the exit that I previously use.

Its solved now I'll use spot as last resort.

Regards,

AT

Former Member
0 Kudos
108

Points rewarded