03-29-2007 8:07 AM
Hi All,
I need to display the contents of an internal table in a popup window. Moreover, the user needs a functionality where-in a single record can be selected from that pop-up window for processing further.
Suggestions welcomed.
Thanks,
Rajesh
03-29-2007 8:09 AM
hi
you can use ALV list...
in REUSE_ALV_LIST_DISPLAY function module, we have the parameters
<b>I_SCREEN_START_COLUMN
I_SCREEN_START_LINE
I_SCREEN_END_COLUMN
I_SCREEN_END_LINE</b>
in which we give values in order to display the list as popup instead of full list...
thx
pavan
03-29-2007 8:13 AM
I have done this using ALV before. But the reuirement has now been changed to popup wqindow. The popup window would have all the information that the internal table has(which was initially displayed using ALV).
Popup needs to replace the ALV part with the same functionality of allowing user to select the value(only one) to move ahead with the further processing
Thanks,
Rajesh
03-29-2007 8:14 AM
hi,
Display the contents of the internal table by calling a window, provide check boxes or radio buttons
for each record on the window as per requirement.
user selection can be processed depending on the selection on the window.
reward if useful.
03-29-2007 8:14 AM
hi,
you can use following code.
*" Type declarations...................................................
"----
Type declaration of the structure to hold flight details *
"----
data:
begin of fs_flight,
carrid type spfli-carrid, " Carrier id
connid type spfli-connid, " Connection id
countryfr type spfli-countryfr, " Country from
cityfrom type spfli-cityfrom, " Cityf from
airpfrom type spfli-airpfrom, " Airport from
countryto type spfli-countryto, " Country to
cityto type spfli-cityto, " City to
airpto type spfli-airpto, " Airport to
end of fs_flight.
"----
Internal table to hold flight details *
"----
data:
t_flight like
standard table
of fs_flight
with non-unique key carrid connid.
"----
Internal table to hold flight details *
"----
data:
t_flight1 like
standard table
of fs_flight
with non-unique key carrid connid.
*" Data declarations...................................................
"----
Work variables *
"----
data:
w_carrid type spfli-carrid, " Carrier id
w_connid type spfli-connid. " connection id
*"Selection screen elements............................................
select-options:
s_carrid for w_carrid , " Carrier id
s_connid for w_connid . " Connection id
"----
START-OF-SELECTION EVENT *
"----
start-of-selection.
perform select.
move t_flight to t_flight1.
perform display.
"----
TOP-OF-PAGE *
"----
top-of-page.
perform head.
"----
END-OF-SELECTION *
"----
end-of-selection.
set pf-status 'FLIGHT_INFORMATION'.
"----
TOP-OF-PAGE DURING LINE-SELECTION *
"----
top-of-page during line-selection.
perform head.
"----
AT USER-COMMAND *
"----
at user-command .
perform function_code.
----
Form SELECT *
----
This subroutine retrieves data from SPFLI *
----
There are no interface parameters to be passed to this subroutine. *
----
form select .
select carrid " Carrier id
connid " Connection id
cityfrom " City from
cityto " City to
airpfrom " Airport from
airpto " Airport to
countryfr " Coountry from
countryto " Country to
from spfli
into corresponding fields of table t_flight
where carrid in s_carrid and
connid in s_connid . " END SELECT
endform. " SELECT
----
Form DISPLAY *
----
This subroutine displays Flight information *
----
There are no interface parameters to be passed to this subroutine. *
----
form display .
loop at t_flight into fs_flight.
uline /(92).
write:
/ sy-vline,4 fs_flight-carrid,
8 sy-vline,10 fs_flight-connid,
15 sy-vline,16 fs_flight-cityfrom,
29 sy-vline,30 fs_flight-cityto,
44 sy-vline,48 fs_flight-airpfrom,
57 sy-vline,61 fs_flight-airpto,
68 sy-vline,72 fs_flight-countryfr,
81 sy-vline,86 fs_flight-countryto,
92 sy-vline.
endloop. " LOOP AT T_FLIGHT INTO FS_FLIHT
uline /(92).
endform. " DISPLAY
----
Form SORT_ASCENDING *
----
This subroutine sorts details using column *
----
There are no interface parameters to be passed to this subroutine. *
----
form sort_ascending .
data:
lw_field(20) type c. " Field
if sy-cucol lt 8 and sy-cucol gt 2.
lw_field = 'CARRID'.
elseif sy-cucol lt 15 and sy-cucol gt 8.
lw_field = 'CONNID'.
elseif sy-cucol lt 29 and sy-cucol gt 15.
lw_field = 'CITYFROM'.
elseif sy-cucol lt 44 and sy-cucol gt 29.
lw_field = 'CITYTO'.
elseif sy-cucol lt 57 and sy-cucol gt 44.
lw_field = 'AIRPFROM'.
elseif sy-cucol lt 68 and sy-cucol gt 57.
lw_field = 'AIRPTO'.
elseif sy-cucol lt 81 and sy-cucol gt 68.
lw_field = 'COUNTRYFR'.
elseif sy-cucol lt 92 and sy-cucol gt 81.
lw_field = 'COUNTRYTO'.
else.
message 'Invalid cursor position' type 'I'.
endif.
sy-lsind = 0.
sort t_flight by (lw_field).
perform display.
endform. " SORT_ASCENDING
----
Form WINDOW *
----
This subroutine displays different sorting order. *
----
There are no interface parameters to be passed to this subroutine. *
----
form window .
window starting at 5 5 ending at 40 20.
data:
w_checkbox type c. " Checkbox
write :
/ w_checkbox as checkbox, 'CARRID'(001),
/ w_checkbox as checkbox, 'CONNID'(002),
/ w_checkbox as checkbox, 'CITYFROM'(003),
/ w_checkbox as checkbox, 'CITYTO'(004),
/ w_checkbox as checkbox, 'COUNTRYFR'(005),
/ w_checkbox as checkbox, 'COUNTRYTO'(006),
/ w_checkbox as checkbox, 'AIRPFROM'(007),
/ w_checkbox as checkbox, 'AIRPTO'(008).
set pf-status 'FLIGHT_DETAILS'.
endform. " WINDOW
----
Form SORT_ASC *
----
This subroutine sorts the flight details in ascending order *
----
There are no interface parameters to be passed to this subroutine. *
----
form sort_asc .
data:
lw_line(40) type c, " Line
lw_number type i " Number
value 8,
lw_field1(10) type c. " Field1
do 8 times.
read line lw_number line value into lw_line.
if lw_line cp 'X*'.
lw_field1 = lw_line+2(10).
endif. " IF LW_LINE CP 'X*'.
sort t_flight stable by (lw_field1).
subtract 1 from lw_number.
enddo. " DO 8 TIMES
sy-lsind = 0.
perform display.
endform. " SORT_ASC
----
Form SORT_DESC *
----
This subroutine sorts the flight details in descending order *
----
There are no interface parameters to be passed to this subroutine. *
----
form sort_desc .
data:
lw_line(40) type c, " Line
lw_number type i " Number
value 8,
lw_field1(10) type c. " Field1
do 8 times.
read line lw_number line value into lw_line.
if lw_line cp 'X*'.
lw_field1 = lw_line+2(10).
endif. " IF LW_LINE CP 'X*'.
sort t_flight stable by (lw_field1) descending.
subtract 1 from lw_number.
enddo. " DO 8 TIMES
sy-lsind = 0.
perform display.
endform. " SORT_DESC
----
Form SORT_CANCEL *
----
This subroutine displays again basic list *
----
There are no interface parameters to be passed to this subroutine. *
----
form sort_cancel.
sy-lsind = 0.
loop at t_flight1 into fs_flight.
uline /(92).
write:
/ sy-vline,4 fs_flight-carrid,
8 sy-vline,10 fs_flight-connid,
15 sy-vline,16 fs_flight-cityfrom,
29 sy-vline,30 fs_flight-cityto,
44 sy-vline,48 fs_flight-airpfrom,
57 sy-vline,61 fs_flight-airpto,
68 sy-vline,72 fs_flight-countryfr,
81 sy-vline,86 fs_flight-countryto,
92 sy-vline.
endloop. " LOOP AT T_FLIGHT INTO FS_FLIHT
uline /(92).
endform. " SORT_CANCEL
----
Form FUNCTION_CODE *
----
This subroutine performs user-command actions *
----
There are no interface parameters to be passed to this subroutine. *
----
form function_code .
case sy-ucomm.
when 'SORT'.
perform sort_ascending.
when 'SORTDATA'.
perform window.
when 'SORT_ASC'.
perform sort_asc.
when 'SORT_DESC'.
perform sort_desc.
when 'CANCEL'.
perform sort_cancel.
endcase. " CASE SY-UCOMM
endform. " FUNCTION_CODE
----
Form HEAD *
----
This subroutine displays header for the list *
----
There are no interface parameters to be passed to this subroutine. *
----
form head .
if sy-lsind eq 0.
uline /(92).
format color 1.
write:
/ sy-vline ,2 'CARRID'(001),
8 sy-vline ,9 'CONNID'(002),
15 sy-vline ,18 'CITY FROM'(009),
29 sy-vline ,33 'CITY TO'(010),
44 sy-vline ,45 'AIRPORT FROM'(013),
57 sy-vline ,58 'AIRPORT TO'(014),
68 sy-vline ,69 'COUNTRY FROM'(011),
81 sy-vline ,82 'COUNTRY TO'(012),
92 sy-vline.
format color off.
uline /(92).
endif. " IF SY-LSIND EQ 0
endform. " HEAD
regards,
veeresh
03-29-2007 8:17 AM
Hi..
check thi s fm
POPUP_WITH_TABLE_DISPLAY_OK
POPUP_WITH_TABLE
Message was edited by:
Rammohan Nagam
03-29-2007 8:19 AM
Hello Rajesh
Perhaps function module <b>REUSE_ALV_POPUP_TO_SELECT</b> fulfills your requirements.
Regards
Uwe