on 04-10-2015 10:31 AM
Dear experts,
Is there any stored procedure to make the "dimension"(cost center) as mandatory field in the invoices and production orders?
Thanks& regards
Hiren
Hi Hiren,
You can check the below for AP Invoice: for other documents, you may change the table name and update the object type too:
To get the object type, you can refer:
SAP Business One Objects ID and Menu ID List - Business One - SCN Wiki
If
@transaction_type IN (N'A', N'U') AND (@Object_type = N'18')
begin
if
exists (SELECT T0.docnum FROM dbo.OPCH T0 INNER
JOIN
dbo.PCH1 T1 ON T1.DOCENTRY =
T0
.docENTRY
WHERE
t1.OcrCode is null
and
T0.DOCENTRY = @list_of_cols_val_tab_del)
select
@Error = 1, @error_message =
'You cannot add invoice without selecting the Cost Center!!'
End
Thanks,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Joseph,
For invoice it is working but for production order this SP is not working. could you please help me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For production order:
If
@transaction_type IN (N'A', N'U') AND (@Object_type = N'202')
begin
if
exists (SELECT T0.docnum FROM dbo.OPCH T0 INNER
JOIN
dbo.PCH1 T1 ON T1.DOCENTRY =
T0
.docENTRY
WHERE
t1.OcrCode is null
and
T0.DOCENTRY = @list_of_cols_val_tab_del)
select
@Error = 1, @error_message =
'You cannot Production order without selecting the Cost Center!!'
End
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nagarajan,
You would need to replace the OPCh and PCH1 tables in your TN
If
@transaction_type IN (N'A', N'U') AND (@Object_type = N'202')
begin
if
exists (SELECT T0.docnum FROM dbo.OWOR T0 INNER
JOIN
dbo.WOR1 T1 ON T1.DOCENTRY =
T0
.docENTRY
WHERE
t1.OcrCode is null
and
T0.DOCENTRY = @list_of_cols_val_tab_del)
select
@Error = 1, @error_message =
'You cannot Production order without selecting the Cost Center!!'
End
Thanks,
Joseph
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.