on 06-19-2017 1:16 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Titiksha,
I assume that you created CMOD project and it is active.Also you should not write code for this same filed inside BADI,otherwise as per SAP design it will overwrite,which you have already faced.
Inside exit try below code.
FIELD-SYMBOLS : <ls_ekpo> TYPE ekpo.
CONSTANTS : lc_field TYPE char20 VALUE '(SAPLMEPO)EKPO'.
ASSIGN (lc_field) TO <ls_ekpo>.
IF <ls_ekpo> IS ASSIGNED.
<ls_ekpo>-bsgru = 'Z7'.
ENDIF.
Regards,
Avik
Hello Avik,
Thanks a lot for your help. That is a correct answer. God bless! 🙂
Regards,
Titiksha
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Your post from 5th sep 2014 says below. Kindly refer below link.
https://archive.sap.com/discussions/thread/3615306
Field selection combination is ( mandatory + suppressed = suppressed)
In this way, it is finally suppressed. Kindly let me know your thoughts on this.
Regards,
Titiksha
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.