Skip to Content
avatar image
Former Member

Set EKPO-BSGRU while PO create through BADI/User exit

Hello Experts,

I a really stuck up with a problem of setting an Advance returns management Field EKPO-BSGRU while PO creation. I want to create a return STO. While creating Return STO manually through ME21N, I need to set the field Return reason (EKPO-BSGRU) to Z** (Example: Z77) when material, quantity and site is given in line item and enter is pressed before save.

I have tried setting this value through BADI 'ME_PROCESS_PO_CUST' and 'MSR_TRC' but these BADIs are not helping me out. Kindly let me know how to fulfill this requirement or I am getting wrong somewhere.

This field is made mandatory from configuration and user requirement is to set this field through ABAP code.

1) When I implemented ME_PROCESS_PO_CUST, process_item method, I am facing below issue.

Standard SAP is not allowing us to change reason code via BADI and message log is returning below information message:

Change reason for order could not be effected.

On further analysis of standard code, I found that standard SAP is checking the field status for BSGRU field.

If it is “-“ which means suppressed, it is overwriting changed value(Z**) with old value (blank) coming from transaction.

2) When I implemented MSR_TRC, GET_DEFAULT method of interface IF_EX_MSR_TRC, the value Z** is replaced with BLANK.

Kindly help, its really urgent for client. Correct answer will be rewarded.

Regards,

Titiksha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 20, 2017 at 04:35 AM

    Hi Titiksha,

    Any update on Advanaced returns management scenario or in general FOR PO header (EKKO)or PO item(EKPO) is interesting case.

    We faced similar issue and what you found out deep inside debugging , is the configuration Principle for field selection group inside standard code checking. The '+' / ' -' etc combination.Ans how SAP treats some fields as display only and some as input enabled.

    Actually the trick is you should not write any code in this case inside BADI.

    Place your business logic- Code inside EXIT only. This should work perfectly fine. We have done it for many requirements.(e.g.Override Returns Item and Confirmation Control for returns order- based om some logic)

    SMOD enhancement : MM06E005

    Implement EXIT ->EXIT_SAPMM06E_016

    Use call stack method: VALUE '(SAPLMEPO)EKPO' inside above exit implementation to assign the PO item reference.

    Regards,

    Avik

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 19, 2017 at 12:53 PM

    your information is contradictory

    first you said: This field is made mandatory from configuration

    and then you said: I found that standard SAP is checking the field status for BSGRU field. If it is “-“ which means suppressed....

    How can it be mandatory and suppressed at once?

    Add comment
    10|10000 characters needed characters exceeded