on 2019 Sep 05 12:30 PM
Hi,
I would like to know for updating ref2 in journal entry when I update the NumAtCard field in A/R invoice.
My problem is
when I update NumAtCard in A/R invoice, didn't update Ref2 field in journal entry.
I also want to update there.
Please advise me how I should do.
Thanks.
Thanks, I have solved as follow. Now it's working fine.
IF (@object_type in (13,14) and @transaction_type in (N'A',N'U'))
BEGIN
Update OJDT set Ref2 = T0.NumAtCard
From OINV T0 inner join OJDT T1 on T0.DocEntry = T1.BaseRef
Update OJDT set Ref2 = T0.NumAtCard
From ORIN T0 inner join OJDT T1 on T0.DocEntry = T1.BaseRef
End
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can update by standard B1 feature go to administration and reference field links select your marketing document and it will show you mapping and configure mapping rule for Customer/Vendor reference to ref2 in JE. See the below image you will understand.
Avoid using update queries as by using such queries you may loose support from SAP as per SAP's support policy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear
Below just an example, you modify as per your requirement and hope you know SQL:
IF ((@object_type = N'13' ) and @transaction_type in (N'A',N'U'))
BEGIN
DECLARE @ExciseNum NVARCHAR(1000)
SELECT@ExciseNum=COALESCE(@ExciseNum+ ',','') + ISNULL(Cast(A.DocNum as Nvarchar(100)),'') FROM( select Distinct T5.DocNum From OINV T0
LEFT OUTER JOIN INV1 T1 ON T0.DocEntry = t1.docentry
LEFT OUTER JOIN DLN1 t2 on T1.BaseEntry = T2.DocEntry and T1.BaseType = t2.ObjType and T1.BaseLine = t2.LineNum
Left Outer Join ODLN T3 on t3.DocEntry = t2.DocEntry Left Outer Join OEI1 T4 on t4.BaseEntry = t3.DocEntry and t4.BaseLine = t2.LineNum and t2.ObjType = t4.BaseType
Left Outer Join OOEI T5 on T4.DocEntry = T5.DocEntry WHERE
T0.DocEntry=@list_of_cols_val_tab_del )A
UPDATET4 SETT4.U_OEINo = @ExciseNum FROMOINV T4 WHERET4.DocEntry = @list_of_cols_val_tab_del
END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear,
I tried as follow. But fail. Guide me,please.
If ((@object_type = N'13') and @transaction_type in (N'A',N'U'))
BEGIN
DECLARE @RefNum NVARCHAR(100)
Set @RefNum = (select COALESCE(@RefNum+ ',','') + ISNULL(Cast(A.NumAtCard as Nvarchar(100)),'')
from (select T0.NumAtCard from OINV T0 inner join OJDT T1 On T0.TransId = T1.TransId
where T0.TransId = @list_of_cols_val_tab_del)A)
Update OJDT Set OJDT.Ref2 = @RefNum where OJDT.TransId = @list_of_cols_val_tab_del
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
8 | |
6 | |
5 | |
5 | |
5 | |
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.