cancel
Showing results for 
Search instead for 
Did you mean: 

FMS on UDF to based on Base document type

Former Member
0 Kudos

Hi All

I need to populate a UDF on an AR Invoice if the invoice is based on a sales order.

if its based on a Delivery note, it should be blank and the user needs to input info in that field.

However it's not working so well, as it populates it even when i copy from a delivery.

I didnt use the docnum = docentry in my where clause because the docnum and docentry is not the same.

SELECT DISTINCT 'from Mill' from OINV T0 inner join INV1 T1 on T0."DocEntry" = T1."DocEntry"

where T1."BaseType" = '17'

Any advise on where to change?

Should i join on the DLN1 table as well?

Thank you

Jerusha

Accepted Solutions (0)

Answers (2)

Answers (2)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Link sales order and AR invoice.

Thanks.

Former Member
0 Kudos

Use the below one when you use FMS in row level

select case when $[$38.43.0]='17' then 'From Mill' else '' end

Former Member
0 Kudos

Use this for Header level

select case when (select top 1 v1.basetype from inv1 v1 inner join oinv v on v.docentry=v1.docentry

where v.docnum=$[oinv.docnum])='17' then 'From Mill' else '' end

Former Member
0 Kudos

Hi Bharathiraja

Thank you for this..Had to convert the syntax to work in HANA.

Its just in SAP.. when I click to get a value in the field..it bring up the actual query and not the result.

Will have a look and see.

you put me on the right track though.

thank you.

Former Member
0 Kudos

Hi,

You should use 3rd option after pressing Alt+Shift+F2, also refer the below link

https://www.packtpub.com/books/content/working-user-defined-values-sap-business-one

Former Member
0 Kudos

FMS for HANA DB

select case when (select top 1 v1.basetype from inv1 v1 inner join oinv v on v.docentry=v1.docentry

where v.docnum=$[oinv."Docnum"])='17' then 'From Mill' else '' end