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

empty ls_

Former Member
0 Likes
817

hi, my report dont have output...

REPORT ZNALOG.

tables: bseg, bsid,bkpf.

data: datum type sy-datum.

data: bschl type bseg-bschl.

data: gjahr(4),

budat type bkpf-budat.

data: lt_bkpf type table of bkpf,

lt_bseg type table of bseg,

ls_bkpf type bkpf,

ls_bseg type bseg.

data: begin of ls_nalog,

POZ type BUZEI,

KUNNR type KUNNR,

BELNR type BELNR_D,

BLDAT type BLDAT,

DUG type ZDUG,

POT type ZPOT,

SAL type ZSAL,

VAL type WAERS,

AUGBL type AUGBL,

BROJ type SAKNR,

end of ls_nalog.

data: lt_nalog like ls_nalog occurs 0,

lt_bsid type table of bsid,

lv_sumpot like BSID-DMBTR,

lv_sumdug like BSID-DMBTR,

lv_pot like BSID-DMBTR,

lv_dug like BSID-DMBTR,

hilisx(2) type C.

SELECTION-SCREEN: BEGIN OF BLOCK EKR1 WITH FRAME.

parameters: p_bukrs type knb1-bukrs DEFAULT 'ZS01'.

SELECTION-SCREEN: END OF BLOCK EKR1.

select-options: s_blart for bkpf-blart no-display.

start-of-selection.

move: 'I' to s_blart-sign, 'EQ' to s_blart-option.

move 'KR' to s_blart-low.

append s_blart.

move 'RE' to s_blart-low.

append s_blart.

move sy-datum to gjahr.

budat = sy-datum - 1 .

select * from bkpf into table lt_bkpf

where bukrs = p_bukrs

and gjahr = gjahr

and budat = budat

and blart in s_blart.

loop at lt_bkpf into ls_bkpf.

select * from bseg into table lt_bseg

where belnr = bkpf-belnr

and gjahr = bkpf-gjahr.

if bschl = '31'.

move ls_bseg-dmbtr to ls_nalog-pot.

else.

move ls_bseg-dmbtr to ls_nalog-dug.

endif.

move ls_bseg-buzei to ls_nalog-poz.

move ls_bseg-lifnr to ls_nalog-dug.

move ls_bkpf-bldat to ls_nalog-bldat.

APPEND Ls_nalog to lt_nalog.

endloop.

*break-point.

*ULINE.

WRITE: / 'Pozition ',

17 'KONTO',

32 'wndor. ',

43 'descript',

58 'Datum dok.',

69 'number',

75 'Valuta',

88 'no.dok',

95 'credit',

105 'debit',

125 'sum'.

ULINE.

loop at lt_nalog into ls_nalog. " output screen.

WRITE: / ls_nalog-poz,

17 ls_bkpf-belnr,

32 ls_nalog-BROJ,

22 ls_nalog-BELNR,

58 ls_nalog-BLDAT,

95 ls_nalog-DUG,

105 ls_nalog-POT,

122 ls_nalog-SAL.

endloop.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
775

nick ,just change ur select condition as follows and then see if u have any data,if yes yes then u can recheck ur conditions (in where clause) ..also u can go to se11 and cross check the tables BKPF and BSEG and give the same condition there in the selection screen and see if data exists for them or not..it seems there something wrong with conditions..

reward if helpfull

select * from bkpf into table lt_bkpf

where bukrs = p_bukrs.

*and gjahr = gjahr "commented

*and budat = budat

*and blart in s_blart.

and

select * from bseg into table lt_bseg

where belnr = bkpf-belnr.

*and gjahr = bkpf-gjahr. "commented

6 REPLIES 6
Read only

Former Member
0 Likes
775

Hi Nick,

In the below selection , whats the variables <b>gjahr</b> and <b>budat</b> contains?

I hope these two fields are initial. So the selection is not picking any infromation.

select * from bkpf into table lt_bkpf

where bukrs = p_bukrs

and gjahr = gjahr

and budat = budat

and blart in s_blart.

Regards,

Sunil

Read only

Former Member
0 Likes
775

put a break point at statement

select * from bkpf into table lt_bkpf

where bukrs = p_bukrs

and gjahr = gjahr

and budat = budat

and blart in s_blart.

check out if it gives any selection and if the Internal table It_bkpf updated by any value or not .

Read only

Former Member
0 Likes
775

Hi Nick,

if i understand your code, i think you will all entries in BSEG

which have the BUDAT from yesterday. Think about, that

yesterday is the 1.1. (Newyear). Do you have look

in the BSEG (BKPF) via SE16 (SE16N) if there is any entry for

your condition?

Hope it helps.

Regards, Dieter

Read only

Former Member
0 Likes
775

Hi Nick,

You debugg the code:

loop at lt_bkpf into ls_bkpf.

select * from bseg into table lt_bseg

where belnr = bkpf-belnr

and gjahr = bkpf-gjahr.

if bschl = '31'.

move ls_bseg-dmbtr to ls_nalog-pot.

else.

move ls_bseg-dmbtr to ls_nalog-dug.

endif.

move ls_bseg-buzei to ls_nalog-poz.

move ls_bseg-lifnr to ls_nalog-dug.

move ls_bkpf-bldat to ls_nalog-bldat.

APPEND Ls_nalog to lt_nalog.

I think data is not coming here.

Regards

Kannaiah

Read only

Former Member
0 Likes
776

nick ,just change ur select condition as follows and then see if u have any data,if yes yes then u can recheck ur conditions (in where clause) ..also u can go to se11 and cross check the tables BKPF and BSEG and give the same condition there in the selection screen and see if data exists for them or not..it seems there something wrong with conditions..

reward if helpfull

select * from bkpf into table lt_bkpf

where bukrs = p_bukrs.

*and gjahr = gjahr "commented

*and budat = budat

*and blart in s_blart.

and

select * from bseg into table lt_bseg

where belnr = bkpf-belnr.

*and gjahr = bkpf-gjahr. "commented

Read only

Former Member
0 Likes
775

Hi Nick,

i think there is another problem like this.

loop at lt_bkpf into ls_bkpf.

select * from bseg into table lt_bseg

where belnr = <b>bkpf-belnr</b>

and gjahr = <b>bkpf-gjahr</b>.

change it to this:

loop at lt_bkpf into ls_bkpf.

select * from bseg into table lt_bseg

where belnr = <b>ls_bkpf-belnr</b>

and gjahr = <b>ls_bkpf-gjahr</b>.

You loop over lt_bkpf into ls_bkpf

therefore you have to use ls_bkpf-belnr and ls_bkpf-gjahr.

Regards, Dieter