06-03-2015 8:01 AM
Hi Experts,
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.
With Regards,
Sudhir.
06-06-2015 6:41 AM
Hi All,
Solution Found.
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.
FM: FI_F4_MWSKZ
Code:
*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.
CLEAR ls_dynpread.
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'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpread
EXCEPTIONS
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
ENDIF.
*****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.
With Regards,
Sudhir.
06-06-2015 6:41 AM
Hi All,
Solution Found.
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.
FM: FI_F4_MWSKZ
Code:
*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.
CLEAR ls_dynpread.
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'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = lt_dynpread
EXCEPTIONS
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
ENDIF.
*****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.
With Regards,
Sudhir.