User encounters error (Found duplicate CM Number! Please re-process) when updating CM.
Cause:
The CM number to be used already exists.
Solution:
- Take note of last CM number in A/R System tailoring
- Check cm_number in a_sales_rtn_header for last cm_number
- Update last CM number in A/R System tailoring
- Run queries below to check tables:
- -- a_sales_rtn_header
select *
from a_sales_rtn_header with (nolock)
where cm_number = 'Put CM Number with issue here'
-- a_sales_rtn-detail
select *
from a_sales_rtn_detail with (nolock)
where sales_rtn_no in ('Affected SR No. from above query')
-- a_open_payment
select *
from a_open_payment with (nolock)
where payment_doc_no = 'Put CM Number with issue here'
-- a_open_item
select *
from a_open_item with (nolock)
where doc_no = 'Put CM Number with issue here'
-- a_output_tax
select *
from a_output_tax with (nolock)
where doc_no = 'Put CM Number with issue here'
-- a_doc_reg
select *
from a_doc_reg with (nolock)
where doc_no_fr = 'Put CM Number with issue here'
-- a_gl_oeb_trans
select *
from a_gl_oeb_trans with (nolock)
where doc_no = 'Put CM Number with issue here'
-- a_open_acr_appl_to
select *
from a_open_acr_appl_to with (nolock)
where payment_doc_no = 'Put CM Number with issue here'
-- a_bilhst_header
select *
from a_bilhst_header with (nolock)
where doc_no in ('Affected SR No. Refer to query for a_sales_rtn_header')
-- a_bilhst_detail
select *
from a_bilhst_detail with (nolock)
where doc_no in ('Affected SR No. Refer to query for a_sales_rtn_header') - Run script below to update cm status of sales return and delete CM number with issue on a_output_tax.
- UPDATE a_sales_rtn_header
SET cm_status = 'N',
cm_number = NULL,
cm_by = NULL
WHERE sales_rtn_no IN ('Affected SR No. Refer to query for a_sales_rtn_header') - DELETE
FROM a_output_tax
WHERE doc_no = 'Put CM Number with issue here'
No comments:
Post a Comment