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: 

IW31 or IW32 Work Order Create -> Component -> Purchasing ->Field GL_ACC

Former Member
0 Kudos

I need to populate, or change, the GL Account number in custom logic whenever either Work Order transaction - IW31 and IW32 - is executed under creating components when selecting the Purchasing button at the bottom. I would rather use a BADI than an exit, but if my only choice is an user-exit then I will. I have tried putting breakpoints in several processes in BADIs:

WORKORDER_UPDATE

IWO1_PREQ_BADI

IWO1_WKCTR_CHANGE

I have had no luck breaking into any of these when I am in the Purchasing screen of the IW32 after hitting enter. However, I do break into WORKORDER_UPDATE in the SAVE Process, but I need to break into the custom logic on an enter. To reiterate, my goal is to put custom logic that will replace a GL Account No., or create a GL Account No.

Thank-You.

7 REPLIES 7

Former Member
0 Kudos

Hello Tom,

There are no BADI's User Exits that will suite this requirement. Only option is to use the BAPI.

You can use the BAPI "BAPI_ALM_ORDER_MAINTAIN" . G/L Field will be on the T_COMPONENT table in the BAPI.

Hope this answers your question.

Thanks,

Greetson

Former Member
0 Kudos

I just found BADI MRO_CONTRACT. It is breaking there, I am dteremining if my fields are there. Thanks.

0 Kudos

Yes . Your field G/L Ledger Number fileld is there.

Method Name :- MRO_CONTRACT_COMPONENT_CHECK

Parameter Name RESBD_IMP.

Field Name : SAKNR.

But make sure it is satisfying your requirement.

Thanks,

Greetson

0 Kudos

It does Sir, however, when I read my custom table to get the new GL Account No. I tried both 'MOVE' and 'WRITE' to RESBD_IMP-SAKR. It populates with the new GL Account No., but the field goes blank as soon as it leaves the BADI process?

Any ideas?

A sincere Thank-You.

0 Kudos

Hello Tom,

This happened me once for me. As per the BADi Functionality it it is not allowed by the customer to modify particular fields that SAP will erace automatically during the exit of the BADI.

Other assumptions :-

If it is an inetrnal table then you need to use the modify statement to save the data back to the internal table. If thsi BADI is being called multiple times then it will be a structure and not an internal table. So what you are doing is correct. But SAP logic is erasing that value during exit of the BADI as it is not allowed.

Thanks,

Greetson

0 Kudos

Greetson, How did you resolve this issue? Is there a good spot for an enhancement or modification? Thanks.

Former Member
0 Kudos

Hi Tom,

You can meet your requirement through configuration.

Configure object "Create Default Value Profiles for External Procurement" in there you can maintain GL account or cost element then assign created profile to plant and order type through "Default Values for Task List Data and Profile Assignments".

Hope this helps.

Thanks and Best Regards,

Vhags