‎2008 Aug 18 7:51 AM
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
‎2008 Aug 18 7:53 AM
Hi,
you need to loop before you can display the datas.
loop at it_anla.
PERFORM display_data.
endloop.
regards
Nicole
‎2008 Aug 18 8:03 AM
i have done it but when we r executing no output but processing is going
‎2008 Aug 18 10:07 AM
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.
‎2008 Aug 18 7:55 AM
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
‎2008 Aug 18 8:00 AM
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
‎2008 Aug 18 8:04 AM
i have done it but when we r executing no output but processing is going
‎2008 Aug 18 8:07 AM
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
‎2008 Aug 18 8:07 AM
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
‎2008 Aug 18 8:16 AM
Hi Friend,
I am getting the output with loop-endloop.
Regards,
Chandra Sekhar
‎2008 Aug 18 8:17 AM
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
‎2008 Aug 18 8:17 AM
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
‎2008 Aug 18 8:00 AM
You have to do two things :
1. remove condition WHERE bukrs = it_anla-bukrs
use WHERE bukrs = p_bukrs.
2. Loop before displaying
‎2008 Aug 18 8:03 AM
i have done it but when we r executing no output but processing is going
‎2008 Aug 18 8:18 AM
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
‎2008 Aug 18 8:18 AM
put sy-subrc aftr select
if sy-subrc eq 0.
loop at table.
endif.
You put the loop for displaying the data .
‎2008 Aug 18 8:23 AM
‎2008 Aug 18 8:28 AM
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
‎2008 Aug 18 8:29 AM
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
‎2008 Aug 18 8:30 AM
>
> once check this i am not getting
>
this is your code.. so you do it.
SDN is not a coaching center.
pk
‎2008 Aug 18 8:34 AM
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
‎2008 Aug 18 8:58 AM
tch tch tch.. watch the drama unfold..
pk
Update: Julius on the prowl
Edited by: prashanth kishan on Aug 18, 2008 10:00 AM
‎2008 Aug 18 9:04 AM
>otherwise dont send that kind of answers
I choose this option.
‎2008 Aug 18 9:05 AM
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