cancel
Showing results for 
Search instead for 
Did you mean: 

Save customer field value in EBKN

former_member602116
Participant
0 Kudos

Hi,

We have a custom field for account assignment in EBKN (ME51N), however the inputted value for this custom field does not get saved in the table. Is it possible to update EBKN just before a purchase requisition is saved, so that the input for our custom field gets saved in table EBKN? Are there any user-exits or BADI I can use?

Thank you.

Regards,

Kath

Accepted Solutions (0)

Answers (3)

Answers (3)

raymond_giuseppi
Active Contributor
0 Kudos

Method POST doesn't allow any change to data, onmy provided to trigger other processes. (Data is protected from update as some update FM calls are already registred)

Could you consider

  • using a method such as CHECK or the PROCESS_ACCOUNTING
  • adding your field (correctly) to coding block so SAP will do the job
former_member602116
Participant
0 Kudos

Hi Raymond,

I have tried in method CHECK however, my_state->protect is still "X" in this method, thus no change is allowed. With regards to process_account, this method is not called for single account assignment pop-up input so this is also not possible.

Not sure if the field is incorrectly added to the coding block since the custom field value is actually saved for other types of purchase requisitions. (This type of PR allows the user to input the value directly on the single account assignment screen, if input is made here then the value is saved)

It is only when user tries to create a framework PR with an item category of B, that the value inputted in the custom field does not get saved. (This type of PR requires user to input the value on a pop-up screen for single account assignment, if input is made here, the value is not saved).

raymond_giuseppi
Active Contributor
0 Kudos

Check in your Customizing if this field is allowed with

  • (MM - Tr. OME9) The 'Account Assignment Category' (not item category) value (compare with a type without the problem)
  • (FI - Tr OBC4) The 'Field Status Group' of the G/L account

Is the pop-up a standard one (as triggered by a click on 'more' pushbutton) or a FM called in the BAdI implementation.

Is the Account assignment already locked in the transaction (e.g. following documents, too late to cprrect)

former_member602116
Participant
0 Kudos

Hi Raymond,

I am using the same Account assignment category of Order (Non Capital) and the same GL account for both types of requisition but only the type where a pop-up custom subscreen is called that the value does not get saved.

After inputting the values in the pop-up custom subscreen and upon pressing enter, the whole account assignment tab is now greyed out and not available for input (I also think this is why my_state->protect is "X" since modification is no longer allowed).

I also checked our code and for the requisition type where the value is saved, method PROCESS_ACCOUNT is called and I think this is why the value is saved into EBKN since it calls SET_EXKN method in our code.

raymond_giuseppi
Active Contributor
0 Kudos

Did you also use GET_EXKNX / SET_EXKNX in PROCESS_ACCOUNT?

former_member602116
Participant
0 Kudos

Update:

I am using the BADI ME_PROCESS_REQ_CUST and using Method POST to call set_exkn to save the custom field. However, in SET_EXKN and SET_EXKNX, there is this checking if my_state->protect is blank but

since my_state->protect is 'X' , the EBKN custom field is not being updated. I tried to force the value for my_state->protect to be blank and I was able to update the EBKN table. However, I do not know how to do this without forcing the data.

Any help would be much appreciated.

Thank you.

Prasoon
Active Contributor
0 Kudos

Hi,

You need to extend the table with the required custom field and then you may check the BAdI: ME_PROCESS_REQ_CUST to update the required data during save.

Refer the note: 611175 - ME_PROCESS_REQ_CUST: Documentation for detailed BAdI documentation.

Also refer the doc: Add Custom Field to Purchase Requisition – MEREQ001

Also check the note: 638849 - ME51N: User-defined fields are not transferred

Regards,

pataselano
Active Contributor
0 Kudos

The question is exit for EBKN.

The exit: MEREQ001 is for EBAN table only, not for EBKN.

I think no exit for EBKN table.

former_member602116
Participant
0 Kudos

Hi Prasoon,

Table is already extended to include the custom field. I am also using the BADI ME_PROCESS_REQ_CUST and using Method POST to call set_exkn to save the custom field. However, in SET_EXKN and SET_EXKNX, there is this checking

and since my_state->protect is 'X' , the EBKN custom field is not being updated. I tried to force the value for my_state->protect to be blank and I was able to update the EBKN table. However, I do not know how to do this without forcing the data.

Thank you.

Regards,

Kath