Skip to Content
avatar image
Former Member

results not getting returned in procedure but in sql console returning

Dear Gurus

Our version is HANA SP 83.

this one query i have written in a procedure

tgt_qty=select a.vkorg,a.auart,a.kunnr,c.zname1,b.matnr,c.zmaktx,b.WERKS,c.mtart,

  sum(case when (b.VRKME = 'MT' or b.VRKME='TO') then b.zMENG*umziz else b.zMENG*UMZIN end) as conqty, 0 del_qty

  from sapagd.vbak a, sapagd.vbap b, (select a.zkunnr,a.zname1,a.zmatnr,a.zmaktx, b.mtart

  from sapagd.zhd_rep a, sapagd.mara b

  where a.zmatnr = b.matnr

  order by a.zkunnr,a.zmatnr) c

  where a.vbeln = b.vbeln

  and a.vkorg = :p_vkorg

  and a.auart = 'ZTLP'

  and a.GUEBG >= :p_lfdatf

  and a.GUEEN <= :p_lfdatt

-- and a.audat between :p_lfdatf and :p_lfdatt

  and a.kunnr = c.zkunnr

  and b.matnr = c.zmatnr

  group by a.vkorg,a.auart,a.kunnr,c.zname1,b.matnr,c.zmaktx,b.VRKME,b.werks,c.mtart

When I run it in the procedure  shows no rows returned.

These are the definition of the variable

in p_vkorg nvarchar(4),

in p_lfdatf date,

in p_lfdatt date

call "AKMENON"."ZSD_HADE_REP"(p_vkorg=>'1000',p_lfdatf=>'20150101',p_lfdatt=>'20151231',hade_rep=>?)

I debugged the procedure it is not returning any rows.

When I run the same in sql window with these values

and a.vkorg = '1000'

and a.GUEBG >= '20150101'

and a.GUEEN <= '20151231'

it returns the results.

What could be the issue

Thanks and Regards.

Arun Kumar Menon

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 12, 2015 at 03:58 PM

    Solved just converted the parameter to to_dats(p_lfdatf)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12, 2015 at 03:45 PM

    When I removed the date filtering from the query it returned results.

    via call call "AKMENON"."ZSD_HADE_REP"(p_vkorg=>'1000',p_lfdatf=>'20150101',p_lfdatt=>'20151231',hade_rep=>?)

    Is there a way i have to pass dates to the procedure.

    thanks and regards

    Arun Kumar Menon

    Add comment
    10|10000 characters needed characters exceeded