Enhancement on Tcode ME31L (Scheduling Agreement) for Tax Code field
My requirement is to validate/populate an error message on Tax Code regarding ME31L (Scheduling Agreement).
As I have to validate after SAVE button, I'm using BADI: ME_PURCHDOC_POSTED.
Inside Implementation, my code was working fine and getting the proper error message.
But when ever error message is been trigger, the rest of fields in the TCode were getting ERASED. Find the Screen shots below.
Before Save: Fields and Check boxes are fine
After Save: Fields and Check boxes were erased
Kindly let me know how to restrict the fields and check boxes from getting erased.
1. Use BADI: ME_PURCHDOC_POSTED and also
2. Use Exit: EXIT_SAPLMMDA_001 (But here screen will get locked when getting an error msg).
3. In case of previous Tax Code is repeating/not clear, go with a Z Implementation before endform.
In Program -> SAPMM06E -> Perform -> uebernahme_infosatz.
4. As the screen getting locked,to pick up the F4 value of Tax Code, go with another Z Implementation.
*Getting the F4 help value into the Tax Code
DATA:ls_dynpread TYPE dynpread,
lt_dynpread TYPE TABLE OF dynpread,
p_fieldname TYPE dynfnam,
p_fieldvalue TYPE dynfieldvalue.
p_fieldname = 'EKPO-MWSKZ'.
p_fieldvalue = e_mwskz.
MOVE p_fieldname TO ls_dynpread-fieldname.
MOVE p_fieldvalue TO ls_dynpread-fieldvalue.
APPEND ls_dynpread TO lt_dynpread.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
dyname = sy-repid
dynumb = sy-dynnr
dynpfields = lt_dynpread
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
* Implement suitable error handling here
*****In case of necessary***********
5. At last, find the PBO place where the screen is getting locked, change from screen active to in
active with proper validation.