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

report inside - programmer outside

Former Member
0 Likes
1,957

Hi ,

plz check my code , its syntacically correct but i was unable to retrieve the data

REPORT zdc_rep_bdc_as01_test .

TABLES : anla,

ra02s,

anlz,

anlb.

**************************************************************

  • D A T A D E C L A R A T I O N

**************************************************************

data : begin of it_anla occurs 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

txt50 LIKE anla-txt50,

menge like anla-menge,

aktiv like anla-aktiv,

end of it_anla.

data : begin of it_anlz occurs 0,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

end of it_anlz.

data : begin of it_anlb occurs 0,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

end of it_anlb.

DATA : BEGIN OF i_itab OCCURS 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

nassets LIKE ra02s-nassets,

txt50 LIKE anla-txt50,

menge(18), " like anla-menge,

meins LIKE anla-meins,

aktiv(10)," like anla-aktiv,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

END OF i_itab.

selection-screen begin of block b1 with frame title text-001.

parameter : p_bukrs like it_anla-bukrs.

selection-screen end of block b1.

START-OF-SELECTION.

PERFORM retrieve_data.

PERFORM display_data.

&----


*& Form retrieve_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = it_anla-bukrs.

*check not it_anla[] is initial.

*select gsber kostl werks stort from anlz into table it_anlz

*for all entries in it_anla where bukrs = it_anla-bukrs.

*

*check not it_anla[] is initial.

*select ndjar ndper from anlb into table it_anlb

*for all entries in it_anla where bukrs = it_anla-bukrs.

endform. " retrieve_data

&----


*& Form display_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_data.

write 😕 it_anla-anlkl, it_anla-bukrs, it_anla-txt50, it_anla-menge,

it_anla-aktiv,

it_anlz-gsber, it_anlz-kostl,

it_anlz-werks, it_anlz-stort, it_anlb-ndjar, it_anlb-ndper.

*

endform. " display_data

Edited by: Julius Bussche on Aug 18, 2008 7:56 AM

23 REPLIES 23
Read only

Former Member
0 Likes
1,915

Hi,

you need to loop before you can display the datas.

loop at it_anla.

PERFORM display_data.

endloop.

regards

Nicole

Read only

0 Likes
1,915

i have done it but when we r executing no output but processing is going

Read only

0 Likes
1,915

Hi,

copy this:

REPORT zdc_rep_bdc_as01_test .

TABLES : anla,

ra02s,

anlz,

anlb.

**************************************************************

*D A T A D E C L A R A T I O N

**************************************************************

data : begin of it_anla occurs 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

txt50 LIKE anla-txt50,

menge like anla-menge,

aktiv like anla-aktiv,

end of it_anla.

data : begin of it_anlz occurs 0,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

end of it_anlz.

data : begin of it_anlb occurs 0,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

end of it_anlb.

DATA : BEGIN OF i_itab OCCURS 0,

anlkl LIKE anla-anlkl,

bukrs LIKE anla-bukrs,

nassets LIKE ra02s-nassets,

txt50 LIKE anla-txt50,

menge(18), " like anla-menge,

meins LIKE anla-meins,

aktiv(10)," like anla-aktiv,

gsber LIKE anlz-gsber,

kostl LIKE anlz-kostl,

werks LIKE anlz-werks,

stort LIKE anlz-stort,

ndjar LIKE anlb-ndjar,

ndper LIKE anlb-ndper,

ndjar1 LIKE anlb-ndjar,

ndper1 LIKE anlb-ndper,

END OF i_itab.

selection-screen begin of block b1 with frame title text-001.

parameter : p_bukrs like it_anla-bukrs.

selection-screen end of block b1.

START-OF-SELECTION.

PERFORM retrieve_data.

break-point.

PERFORM display_data.

*&----


*& Form retrieve_data

*&----


*text

*----


*

*--> p1 text

*<-- p2 text

*----


form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = p_bukrs.

*check not it_anla[] is initial.

*select gsber kostl werks stort from anlz into table it_anlz

*for all entries in it_anla where bukrs = it_anla-bukrs.

*

*check not it_anla[] is initial.

*select ndjar ndper from anlb into table it_anlb

*for all entries in it_anla where bukrs = it_anla-bukrs.

endform. " retrieve_data

*&----


**& Form display_data

*&----


*

*text

*----


*

*--> p1 text

*<-- p2 text

*----


form display_data.

loop at it_anla.

write 😕 it_anla-anlkl, it_anla-bukrs, it_anla-txt50, it_anla-menge,

it_anla-aktiv,

it_anlz-gsber, it_anlz-kostl,

it_anlz-werks, it_anlz-stort, it_anlb-ndjar, it_anlb-ndper.

*

endloop.

endform.

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,915

hi,

Chech this code

form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = p_bukrs. "itab-burks.

With regards

Always Learner

Read only

Former Member
0 Likes
1,915

Hi Friend,

Change the Select Statement WHERE Condition

Check this:

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = p_bukrs.

And Moreover, you need to maintain a loop-endloop to display the data.

Regards,

Chandra Sekhar

Read only

0 Likes
1,915

i have done it but when we r executing no output but processing is going

Read only

0 Likes
1,915

Hi,

set a break-point after the select-statement and take a look if the internal table is filled.

If not, your select is false.

Nicole

Read only

0 Likes
1,915

Hi Friend,

You need to use loop-endloop to display the data.

form display_data.

loop at it_anla

write 😕 it_anla-anlkl, it_anla-bukrs, it_anla-txt50, it_anla-menge,

it_anla-aktiv,

it_anlz-gsber, it_anlz-kostl,

it_anlz-werks, it_anlz-stort, it_anlb-ndjar, it_anlb-ndper.

endloop.

endform. " display_data

Regards,

Chandra Sekhar

Read only

0 Likes
1,915

Hi Friend,

I am getting the output with loop-endloop.

Regards,

Chandra Sekhar

Read only

0 Likes
1,915

Hi i kept breah point on select stmt ok

filling the data into first internal table ie it_anla

but when cursor come to 2nd internal table ie it_anlz using the for all entries not getting data and is going to dump

once check my for all entries stmt

Read only

0 Likes
1,915

Hi i kept breah point on select stmt ok

filling the data into first internal table ie it_anla

but when cursor come to 2nd internal table ie it_anlz using the for all entries not getting data and is going to dump

once check my for all entries stmt

Read only

Former Member
0 Likes
1,915

You have to do two things :

1. remove condition WHERE bukrs = it_anla-bukrs

use WHERE bukrs = p_bukrs.

2. Loop before displaying

Read only

0 Likes
1,915

i have done it but when we r executing no output but processing is going

Read only

0 Likes
1,915

Hi i kept breah point on select stmt ok

filling the data into first internal table ie it_anla

but when cursor come to 2nd internal table ie it_anlz using the for all entries not getting data and is going to dump

once check my for all entries stmt

Read only

0 Likes
1,915

put sy-subrc aftr select

if sy-subrc eq 0.

loop at table.

endif.

You put the loop for displaying the data .

Read only

0 Likes
1,915

use INTO CORRESPONDING FIELDS OF TABLE

Read only

0 Likes
1,915

once check this i am not getting

form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = p_bukrs.

if not it_anla[] is initial.

select gsber kostl werks stort from anlz into corresponding fields of

table it_anlz for all entries in it_anla where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select ndjar ndper from anlb into corresponding fields of table it_anlb

for all entries in it_anla where bukrs = it_anla-bukrs.

endif.

endform. " retrieve_data

Read only

0 Likes
1,915

once check this

form retrieve_data.

select anlkl bukrs txt50 menge aktiv from anla into corresponding

fields of table it_anla

where bukrs = p_bukrs.

if not it_anla[] is initial.

select gsber kostl werks stort from anlz into corresponding fields of

table it_anlz for all entries in it_anla where bukrs = it_anla-bukrs.

check not it_anla[] is initial.

select ndjar ndper from anlb into corresponding fields of table it_anlb

for all entries in it_anla where bukrs = it_anla-bukrs.

endif.

endform. " retrieve_data

Read only

0 Likes
1,915

>

> once check this i am not getting

>

this is your code.. so you do it.

SDN is not a coaching center.

pk

Read only

0 Likes
1,915

hello , my code was executing but not getting data that is my doubt ok if u can clarify it u do otherwise dont send that kind of answers

Read only

0 Likes
1,915

tch tch tch.. watch the drama unfold..

pk

Update: Julius on the prowl

Edited by: prashanth kishan on Aug 18, 2008 10:00 AM

Read only

0 Likes
1,915

>otherwise dont send that kind of answers

I choose this option.

Read only

0 Likes
1,915

Please use meaningfull subject titles and read [the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting further.

History has shown that keeping to "the rules" improves the answers, and that the opposite is also true.

Cheers,

Julius