‎2007 May 17 6:01 PM
I am trying to develop a interactive report. If the user clicks the kunnr in the basic list,
the detail list should display order details of that customer.
*&---------------------------------------------------------------------*
*& data declaration *
*&---------------------------------------------------------------------*
data: begin of itab occurs 0,
kunnr type kna1-kunnr,
name1 type kna1-name1,
land1 type kna1-land1,
end of itab.
data: begin of jtab occurs 0,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
netwr type vbak-netwr,
end of jtab.
*&---------------------------------------------------------------------*
*& selecting and display data for basic list *
*&---------------------------------------------------------------------*
select kunnr
name1
land1
from kna1 into table itab.
loop at itab.
write:/10 itab-kunnr,
35 itab-name1,
70 itab-land1.
endloop.
hide itab-kunnr.
*&---------------------------------------------------------------------*
*& selecting and display data for detail list *
*&---------------------------------------------------------------------*
at line-selection.
case sy-lsind.
when '1'.
select vbeln
erdat
netwr
from vbak into table jtab where kunnr = itab-kunnr.
loop at jtab.
write:/10 jtab-vbeln,
35 jtab-erdat,
70 jtab-netwr.
endloop.
endcase.
However what the kunnr I select I am getting same order details in the detail list
How to fix this error.
‎2007 May 17 6:07 PM
Hi
Move the <b>hide itab-kunnr.</b> into the loop..endloop
write it after write statement of customer fields in the basic list.
Reward points if useful
Regards
Anji
‎2007 May 17 6:04 PM
See the below code:
&----
*& data declaration *
&----
data: begin of itab occurs 0,
kunnr type kna1-kunnr,
name1 type kna1-name1,
land1 type kna1-land1,
end of itab.
data: begin of jtab occurs 0,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
netwr type vbak-netwr,
end of jtab.
&----
*& selecting and display data for basic list *
&----
select kunnr
name1
land1
from kna1 into table itab.
loop at itab.
hide itab-kunnr.
write:/10 itab-kunnr,
35 itab-name1,
70 itab-land1.
endloop.
&----
*& selecting and display data for detail list *
&----
at line-selection.
case sy-lsind.
when '1'.
select vbeln
erdat
netwr
from vbak into table jtab where kunnr = itab-kunnr.
loop at jtab.
write:/10 jtab-vbeln,
35 jtab-erdat,
70 jtab-netwr.
endloop.
endcase.
Hide should use in within loop and before write statment in loop condition
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 17 6:06 PM
move your statement hide itab-kunnr. inside the loop.
loop at itab.
write:/10 itab-kunnr,
35 itab-name1,
70 itab-land1.
hide itab-kunnr.
endloop.
‎2007 May 17 6:06 PM
am trying to develop a interactive report. If the user clicks the kunnr in the basic list,
the detail list should display order details of that customer.
&----
*& data declaration *
&----
data: begin of itab occurs 0,
kunnr type kna1-kunnr,
name1 type kna1-name1,
land1 type kna1-land1,
end of itab.
data: begin of jtab occurs 0,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
netwr type vbak-netwr,
end of jtab.
&----
*& selecting and display data for basic list *
&----
select kunnr
name1
land1
from kna1 into table itab.
loop at itab.
write:/10 itab-kunnr,
35 itab-name1,
70 itab-land1.
hide itab-kunnr.
endloop.
&----
*& selecting and display data for detail list *
&----
at line-selection.
case sy-lsind.
when '1'.
select vbeln
erdat
netwr
from vbak into table jtab where kunnr = itab-kunnr.
loop at jtab.
write:/10 jtab-vbeln,
35 jtab-erdat,
70 jtab-netwr.
endloop.
endcase.
However what the kunnr I select I am getting same order details in the detail list
How to fix this error.
‎2007 May 17 6:07 PM
Hi
Move the <b>hide itab-kunnr.</b> into the loop..endloop
write it after write statement of customer fields in the basic list.
Reward points if useful
Regards
Anji
‎2007 May 17 7:04 PM
How do I trigger events like top-of-page and end-of-page for different lists here.
‎2007 May 17 7:13 PM
for header - use top-of-page during line selection for secondary list
‎2007 May 17 7:28 PM
I am able to define "Top-of-pag" for first detail list.
How to define for the second detail list
‎2007 May 17 7:41 PM
write down top-of-page during line-selection
see the example code :
top-of-page during line-selection.
perform write_top_of_page.
data: v_repid like sy-repid.
write: / sy-datum, sy-uzeit,
70 'Freshdirect Order Summary Report - '.
if radio1 = 'X'.
write ' COS only'.
elseif radio2 = 'X'.
write ' Non-COS only'.
else.
write ' Non-COS and COS'.
endif.
v_repid = sy-repid.
call function 'Z_WRITE_SELECTION_SCREEN'
exporting
repid = v_repid
exceptions
report_not_found = 1
others = 2.
if p_split = 'X'.
if v_vbtyp = 'M' or v_vbtyp = 'N' or
v_vbtyp = ' '.
write: /(100) 'Invoiced in Time Period' color col_heading.
else.
write: /(100) 'Returns in Time Period' color col_heading.
endif.
else.
write: /(100) 'Net Invoiced in Time Period (invoiced - returned)'
color col_heading.
endif.
skip 1.
write: / 'Profit Center'(001),
32 ' Sales'(002),
' COGS'(003).
write: ' Gross Margin'(007),
' Invoices'(004),
' Line Items'(005),
' Picks'(008),
'Quantity Billed '(006),
' Packs'(009).
new-line.
uline.
endform. " write_top_of_page
‎2007 May 17 7:44 PM
I am sorry Seshu
I could not understand code.
Can you come with a simple example
‎2007 May 17 7:50 PM
write down below code after top-of-page.
top-of-page during line-selection.
write:/ ' material # '.
‎2007 May 17 8:49 PM
hi ,
try like this.
top-of-page.
write : / 'First Page Report'.
top-of-page during line-selection.
if sy-lsind = '1'.
write : / 'Second page report'.
endif.
regards
sarath