cancel
Showing results for 
Search instead for 
Did you mean: 

Journal Entry Ref2 automatic Update

millicentdark
Contributor
0 Kudos

Hi experts,

My customer wants the Journal entry row ref2 to be automatically updated with the Journal Entry TransId.

I was able to write a query to update for a period but i do not know how to make the ref2 updated automatically anytime a JE is created.

Urgent Response will be appreciated

Regards

Justice

Accepted Solutions (0)

Answers (5)

Answers (5)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Run below FMS and set it Ref2 by refresh regularly option. Then JE automatically updated ref2 field with transaction number.

SELECT T0.[TransId] FROM OJDT T0 WHERE T0.[Number]  = $[$5.0.0]

Thank you.

Former Member
0 Kudos

Hi Justice,

Create one UDF in Header level and use FMS to fill Trans Id in that field. After that go to

Admin-->Set up-->General-->Reference field Link

Open document which ever you want and you can map that UDF field into reference 2 column

millicentdark
Contributor
0 Kudos

Hi Harshal,

How best can i solve my request?

Former Member
0 Kudos

Hi Doku,

As per my knowledge, Update query is not allowed as per SAP. If any issues occur SAP will not give support.

Thanks,

Harshal

0 Kudos

Hi,

You can write post notification for this requirement.

millicentdark
Contributor
0 Kudos

Can you assist me with the post notification query on how to achieve my request.

0 Kudos

Hi,

Before run following Post Notification, you have to remove reference field links from Admin-Setup-General.

IF ((@object_type = N'30' ) and @transaction_type in (N'A',N'U'))

BEGIN

     DECLARE @Jentry NVARCHAR(1000)

     SET @Jentry= (SELECT T0.Number

  FROM OJDT T0

  

  WHERE T0.TransId=@list_of_cols_val_tab_del)

  UPDATE T0

  SET T0.Ref2 = @Jentry

  FROM OJDT T0 

  WHERE T0.TransId= @list_of_cols_val_tab_del

END