Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PROBLEM WHILE RETRIEVING DATA

Former Member
0 Likes
501

I NEED HELP IN THIS SQL QUERY :

SYNTATICALLY IT IS CORRECT BUT WHEN WE EXECUTE IT ,IT IS GOING TO DUMP.

TYPES: BEGIN OF ty_fndtab,

RBUKRS LIKE ZDLC2T-RBUKRS, " COMPANY CODE

RACCT LIKE ZDLC2T-RACCT, " DOCUMENT ACCOUNT NUMBER

RZZSLOB LIKE zdlc2t-rzzslob, " LINE OF BUSSINESS

RZZBSA LIKE ZDLC2T-RZZBSA, " PROFIT CENTE

RBLART LIKE ZDLC2T-RBLART, " DOCUMENT TYPE

RMVCT LIKE ZDLC2T-RMVCT, " LEDGER TYPE

  • zzfundno LIKE zdlc2t-zzfundno,

hslvt LIKE zdlc2t-hslvt,

hsl01 LIKE zdlc2t-hslvt ,

hsl02 LIKE zdlc2t-hslvt,

hsl03 LIKE zdlc2t-hslvt,

hsl04 LIKE zdlc2t-hslvt,

hsl05 LIKE zdlc2t-hslvt,

hsl06 LIKE zdlc2t-hslvt,

hsl07 LIKE zdlc2t-hslvt,

hsl08 LIKE zdlc2t-hslvt,

hsl09 LIKE zdlc2t-hslvt,

hsl10 LIKE zdlc2t-hslvt,

hsl11 LIKE zdlc2t-hslvt,

hsl12 LIKE zdlc2t-hslvt,

END OF ty_fndtab.

DATA: it_fndtab TYPE STANDARD TABLE OF ty_fndtab,

wa_fndtab LIKE LINE OF it_fndtab.

SELECT RBUKRS RACCT RZZSLOB

SUM( hslvt ) SUM( hsl01 ) SUM( hsl02 )

SUM( hsl03 ) SUM( hsl04 ) SUM( hsl05 )

SUM( hsl06 ) SUM( hsl07 ) SUM( hsl08 )

SUM( hsl09 ) SUM( hsl10 ) SUM( hsl11 )

SUM( hsl12 ) APPENDING TABLE it_fndtab

from zdlc2t WHERE

RBLART = 'ZS' AND

RYEAR = p_year AND

RBUKRS = wa_skb1-bukrs

  • AND RACCT = WA_SKB1-SAKNR

GROUP BY rbukrs racct RZZSLOB.

CAN ANY ONE TELL ME WHAT MIGHT BE THE PROBLEM.

3 REPLIES 3
Read only

Former Member
0 Likes
480

Hi may be this ...

TYPES: BEGIN OF ty_fndtab,

RBUKRS LIKE ZDLC2T-RBUKRS, " COMPANY CODE

RACCT LIKE ZDLC2T-RACCT, " DOCUMENT ACCOUNT NUMBER

RZZSLOB LIKE zdlc2t-rzzslob, " LINE OF BUSSINESS

<b>RZZBSA LIKE ZDLC2T-RZZBSA, " PROFIT CENTE

RBLART LIKE ZDLC2T-RBLART, " DOCUMENT TYPE

RMVCT LIKE ZDLC2T-RMVCT, " LEDGER TYPE</b>

  • zzfundno LIKE zdlc2t-zzfundno,

hslvt LIKE zdlc2t-hslvt,

hsl01 LIKE zdlc2t-hslvt ,

hsl02 LIKE zdlc2t-hslvt,

hsl03 LIKE zdlc2t-hslvt,

hsl04 LIKE zdlc2t-hslvt,

hsl05 LIKE zdlc2t-hslvt,

hsl06 LIKE zdlc2t-hslvt,

hsl07 LIKE zdlc2t-hslvt,

hsl08 LIKE zdlc2t-hslvt,

hsl09 LIKE zdlc2t-hslvt,

hsl10 LIKE zdlc2t-hslvt,

hsl11 LIKE zdlc2t-hslvt,

hsl12 LIKE zdlc2t-hslvt,

END OF ty_fndtab.

DATA: it_fndtab TYPE STANDARD TABLE OF ty_fndtab,

wa_fndtab LIKE LINE OF it_fndtab.

SELECT RBUKRS RACCT RZZSLOB

SUM( hslvt ) SUM( hsl01 ) SUM( hsl02 )

SUM( hsl03 ) SUM( hsl04 ) SUM( hsl05 )

SUM( hsl06 ) SUM( hsl07 ) SUM( hsl08 )

SUM( hsl09 ) SUM( hsl10 ) SUM( hsl11 )

SUM( hsl12 ) APPENDING TABLE it_fndtab

from zdlc2t WHERE

RBLART = 'ZS' AND

RYEAR = p_year AND

RBUKRS = wa_skb1-bukrs

  • AND RACCT = WA_SKB1-SAKNR

GROUP BY rbukrs racct RZZSLOB.

Hi the structure you declare using TYPE contains more data then your select query..

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
480

hi

good

did you analyse your dump? if you feel that the syntax is correct and it is returning the correct value than i would suggest you to analyse the dump,i hope you ll get the solution.

thanks

mrutyun^

Read only

Former Member
0 Likes
480

i think we need to use in codintion between statments.

thanks