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: 

Trying to change values in PROCESS_ACCOUNT of BADI IF_EX_ME_PROCESS_PO_CUST

Former Member
0 Kudos

Hello Experts,

My requirement is on certain conditions to change the tax code of all services in a purchase order(me21n). I've been using process_account and this is my code:


  data accounting TYPE mepoaccounting.

        CALL METHOD IM_account->get_data
          RECEIVING
            re_data = accounting.

        accounting-mwskz = 'LK'.

        CALL METHOD IM_account->set_data( accounting ).

        CALL METHOD IM_account->get_data
          RECEIVING
            re_data = accounting.

As you can see I'm using get_data to see if the changes are being made, and here everything is ok. Afterwards along the standard program the new values aren't set. Here is some code that I found after the badi processed that is not being executed:

Method:


CALL METHOD me->if_flush_transport_mm~start

After using the macro the function isn't being called because l_account is initial.


      mmpur_dynamic_cast l_account <queue>-handle.
      IF NOT l_account IS INITIAL.
        CALL FUNCTION 'MEPOBADI_PROCESS_ACCOUNT'

Could this be the problem? For some reason when in me21n the value continues empty and no changes are made, I've tried changing other accounting values but to no avail.

Does anybody have an ideia?

Thanks and regards

David

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

I believe the system avoids to change the data of certain fields, i.e. it replaces the original value if it tries to change by BADI

Max

7 REPLIES 7

Former Member
0 Kudos

Hi

I believe the system avoids to change the data of certain fields, i.e. it replaces the original value if it tries to change by BADI

Max

0 Kudos

Thank you max for the quick reply,

Yes I thought this was it also, but after some research it seems that the data that can't be changed are in the structures MEPOITEM_TECH and MEPOSCHEDULE_TEC. None of which has the field mwskz. What is strange is that I am not able to change any kind of service value.

David

0 Kudos

Hi

U should check the META field by method FIELDSELECTION_ITEM

Max

0 Kudos

I've never used the method FIELDSELECTION_ITEM, are you suggesting that I check the value of the parameteres passed in this BADI method? I've tried to se if it passes by this method by adding a break-point and changing a few values , but it didn't pass by this method.

Could you please explain more?

Thanks

David

0 Kudos

Hello again,

This is an important issue, if anyone could help. I've tried also to change the data in process_item or process_header, but the result is an infinite cycle that gives the error MEPO151:

An endless loop occurred during the processing of the Business Add-In ME_PROCESS_PO_CUST. The system terminated the processing.

Procedure for System Administration

Check whether standard fields are changed in the implementation of the Business Add-In ME_PROCESS_PO_CUST.

Changes to standard fields that are part of the Include structure

MEPOITEM_TECH and/or MEPOSCHEDULE_TECH are generally not allowed. In

addition, no field values that are not changeable through the field

settings in the Enjoy transactions can be changed in the BAdI. Correct

the implementation accordingly.

As I've said before MEPOITEM_TECH and MEPOSCHEDULE_TECH do not have mwskz as a non modifiable field. Where can I see the field setting of enjoy transactions to see if it is related to this problem? Does anyone have any ideia?

Thanks and regards

David

0 Kudos

I also encountered the same error when I try to overwrite the delivery date ekpo-eeind. I also posted another post. Have you found a solution for this?

0 Kudos

I had the problem that the change of the field GSBER was not updated with set_data.

The reason was that the field control (see view V_T163K) for the field was set to "display only" which prohibited the change.

So, if you have problems with updating - checking the field control might help.

Regards, Martin