‎2007 Oct 04 7:14 AM
hi all
how r u?
i have made a report which shows the following output
doc no----
matirial no
now i want to show the doc no detail
so i want to try that
when i clik on doc no it shud save only doc no
and when i click on matirial number then it shud save only matrial number
i hav tried read line but it saves the whole line
and also can we know which field of the line has been selected???
plz explain with eamples and step by step
points wil b rewarded.
regards
‎2007 Oct 04 7:18 AM
Hi
Sure, check this example. This will only allow selection on lines items = 1
report zrich_0002 no standard page heading.
data: iekpo type table of ekpo with header line.
data : cursor_field(30),
field_value(30) .
start-of-selection.
select * into corresponding fields of table iekpo
from ekpo up to 100 rows.
loop at iekpo.
if iekpo-ebelp = '1'.
format hotspot on.
write:/ iekpo-ebeln, iekpo-ebelp.
hide iekpo-ebeln.
format hotspot off.
else.
write:/ iekpo-ebeln, iekpo-ebelp.
endif.
endloop.
at line-selection.
set parameter id 'BES' field iekpo-ebeln.
call transaction 'ME23' and skip first screen.
<b>Reward if usefull</b>
‎2007 Oct 04 7:17 AM
‎2007 Oct 04 7:22 AM
HI BHARAT
can u explaint how to use
get cursor wid an exaxmple?
‎2007 Oct 04 7:31 AM
HI,
see this simple interactive example.
data:matnr(18) value 'abcd'.
data:ernam(18) value 'bharat'.
data:fld(30).
data:val1(30).
write:/ matnr,ernam.
at LINE-SELECTION.
get cursor field fld.
write:/ 'you have clicked on',fld.
get cursor field fld value val1.
WRITE:/ val1.
rgds,
bharat.
‎2007 Oct 04 7:18 AM
Hi
Sure, check this example. This will only allow selection on lines items = 1
report zrich_0002 no standard page heading.
data: iekpo type table of ekpo with header line.
data : cursor_field(30),
field_value(30) .
start-of-selection.
select * into corresponding fields of table iekpo
from ekpo up to 100 rows.
loop at iekpo.
if iekpo-ebelp = '1'.
format hotspot on.
write:/ iekpo-ebeln, iekpo-ebelp.
hide iekpo-ebeln.
format hotspot off.
else.
write:/ iekpo-ebeln, iekpo-ebelp.
endif.
endloop.
at line-selection.
set parameter id 'BES' field iekpo-ebeln.
call transaction 'ME23' and skip first screen.
<b>Reward if usefull</b>
‎2007 Oct 04 7:27 AM
hi naresh
set parameter id 'BES' field iekpo-ebeln.
can u explain this statement
‎2007 Oct 04 7:22 AM
hi
&----
*& Report ZPRG6 *
*& *
&----
*& *
*& *
&----
REPORT ZPRG6 .
tables: kna1, vbak, vbap.
select-options: s_kunnr for kna1-kunnr.
data: begin of itab occurs 0,
kunnr like kna1-kunnr,
name like kna1-name1,
end of itab.
data: begin of jtab occurs 0,
vbeln like vbak-vbeln,
netwr like vbak-netwr,
end of jtab.
data: begin of ktab occurs 0,
posnr like vbap-posnr,
matnr like vbap-matnr,
end of ktab.
data: v_fnam(10), v_fval(10).
start-of-selection.
select kunnr name1 from kna1 into table itab where kunnr in s_kunnr.
loop at itab.
write:/ itab-kunnr hotspot, itab-name.
hide itab-kunnr.
endloop.
at line-selection.
case sy-lsind.
when 1.
select vbeln netwr from vbak into table jtab where kunnr = itab-kunnr.
loop at jtab.
write:/ jtab-vbeln hotspot, jtab-netwr.
hide jtab-vbeln.
endloop.
when 2.
select posnr matnr from vbap into table ktab where vbeln = jtab-vbeln.
loop at ktab.
write:/ ktab-posnr, ktab-matnr hotspot.
endloop.
when 3.
get cursor field v_fnam value v_fval.
set parameter id 'MAT' field v_fval.
call transaction 'MM02'.
endcase.
top-of-page.
write:/ 'Custom Deatils Report'.
top-of-page during line-selection.
case sy-lsind.
when 1.
write:/ 'Sales Details Report'.
when 2.
write:/ 'Item Details Report'.
endcase.
reward for use ful points
regards
Nagesh.Paruchuri
‎2007 Oct 04 7:41 AM
hI
You do like this, declare one variable CURSORFIELD of type string.
Then after statment AT LINE-SELECTION.
write this statment.
GET CURSOR FIELD CURSORFIELD.
Now check the value of CURORFIELD i.e.
IF CURSORFIELD is 'ITAB-MATNR'(i.e. the name of field for which you want to make INteractive list.
and inside this IF and ENDIF you write your all write statments.
ENDIF.
<b>REWARD IF USEFULL</b>
‎2007 Oct 04 7:43 AM