Skip to Content

FMS NOT WORKING CORRECTLY

Hi experts

I had created a FMS to join 2 UDF and the result should be pop up in Unit price in AP credit memo

1. U_GrdPrice

2.U_GrdAmt1

Both are Numeric type

The above given is the tables in SAP

if GrdPrice > 0 then the unit Price should be from Grade amount

Else unit price should be Grade Price

Also pls see my FMS Query

Regards

IF $[RPC1.U_GrdPrice] > 0
THEN $[RPC1.U_GrdPrice]
ELSE
$[RPC1.U_GrdAmt1]
End

untitled.png (5.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • if the GrdPrice = 0 then also GrdAmt1 value pop up

    also i get an error

    1). [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near the keyword 'THEN'. 2). [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Statement(s) could not be prepared. FMS execution failed on field '' with query name 'Test'

    when i copy AP Invoice to AP Credit Memo

    Regards

  • Hi,

    Could you please let us know in what way it is not working?

    Regards,

    Johan

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 04, 2017 at 02:04 PM

    SELECT

    CASE WHEN $[$38.U_GrdPrice.Number] > 0

    THEN $[$38.U_GrdPrice.Number]

    ELSE $[$38.U_GrdAmt1.Number]

    END as Price

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 04, 2017 at 05:09 PM

    Hi

    try this query:

    IF $[RPC1.U_GrdPrice]>0 THEN select $[RPC1.U_GrdPrice] ELSE select $[RPC1.U_GrdAmt1] 

    Kind regards

    Agustín Marcos Cividanes

    Add comment
    10|10000 characters needed characters exceeded