Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Declare FMS query not working

Hi,

Declare @PayType as NVarchar(15)

select  @PayType='cashAcct'

  Begin

  select distinct t0.U_exptype, t0.U_glcode, t0.u_gldesc from [@GLD] t0 inner join [@OGLG] t1 on t0.docentry=t1.docentry where t1.u_paytype='Cash' and t1.u_cbcode=$[OVPM.cashAcct] and t0.u_outpay='Y'

If @PayType='TrsfrAcct'

  select distinct t0.U_exptype, t0.U_glcode, t0.u_gldesc from [@GLD] t0 inner join [@OGLG] t1 on t0.docentry=t1.docentry where t1.u_paytype='Transfer' and t1.u_cbcode=$[OVPM.TrsfrAcct] and t0.u_outpay='Y'

  End

My first FMS query is working fine but second condition not working.

Please suggest where is the mistake.

Regards,

Mukesh Singh

Tags:
Former Member
Former Member replied

Hi,

Thanks for your suggestion.

We done FMS different way, please find the FMS query.

if $[OVPM.cashAcct] !=0

select distinct

t0.U_exptype, t0.U_glcode, t0.u_gldesc from [@GLD] t0

inner join [@OGLG] t1 on t0.docentry=t1.docentry

where  t0.u_outpay='Y' and t1.u_cbcode=$[OVPM.CashAcct] AND t1.u_paytype='Cash'

else if $[OVPM.cashAcct] =0

select distinct

t0.U_exptype, t0.U_glcode, t0.u_gldesc from [@GLD] t0

inner join [@OGLG] t1 on t0.docentry=t1.docentry

where  t0.u_outpay='Y' and t1.u_cbcode=$[OVPM.TrsfrAcct] AND t1.u_paytype='Transfer'

Regards,

Mukesh Singh

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question