2016 Mar 05 5:50 AM
Dear All,
I am trying to restrict multiple condition type using Include MV45AFZZ.
It is working and we are also getting error message on click of SAVE button also.
But then when we press enter it is cumming out of tcode instead of going to edit mode.
Kindly help me to solve this.
"""""" Codding we have done for reference """""
Include MV45AFZZ
FORM USEREXIT_SAVE_DOCUMENT
Data: lv_cnt1 type i,
lv_cnt2 type i,
it_temp type table of komv.
CHECK sy-tcode = 'VA01' AND VBAK-AUART = 'ZPS' AND NOT xkomv[] IS INITIAL.
it_temp[] = xkomv[].
sort it_temp by kschl.
delete adjacent duplicates from it_temp comparing kschl.
lv_cnt1 = lines( it_temp ).
lv_cnt2 = lines( xkomv ).
if lv_cnt1 NE lv_cnt2.
message 'Duplicate entries exit' type ‘E’.
endif.
Thanks & Regards,
Dhaval Raval
Dear All,
I am trying to restrict multiple condition type using Include MV45AFZZ.
It is working and we are also getting error message on click of SAVE button also.
But then when we press enter it is cumming out of tcode instead of going to edit mode.
Kindly help me to solve this.
"""""" Codding we have done for reference """""
Include MV45AFZZ
FORM USEREXIT_SAVE_DOCUMENT
Data: lv_cnt1 type i,
lv_cnt2 type i,
it_temp type table of komv.
CHECK sy-tcode = 'VA01' AND VBAK-AUART = 'ZPS' AND NOT xkomv[] IS INITIAL.
it_temp[] = xkomv[].
sort it_temp by kschl.
delete adjacent duplicates from it_temp comparing kschl.
lv_cnt1 = lines( it_temp ).
lv_cnt2 = lines( xkomv ).
if lv_cnt1 NE lv_cnt2.
message 'Duplicate entries exit' type ‘E’.
endif.
Thanks & Regards,
Dhaval Raval
2016 Mar 08 9:51 AM
Read documentation in include source and online documentation and some (of many) threads in scn, you aren't allowed to update or even check data in this form, use USEREXIT_SAVE_DOCUMENT_PREPARE
- USEREXIT_SAVE_DOCUMENT_PREPARE
Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
Reference: User Exits in Sales / User Exits In Sales Document Processing
Regards,
Raymond
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |