Drop down box in alv table
How to add a dropdown box in an alv table ?
this is what i did :
DATA : list_field TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
CREATE OBJECT list_field
EXPORTING selected_key_fieldname = 'COLUMN_ID'.
ls_columns-r_column->set_cell_editor( list_field ).
but how to populate the dropdown box ??
Hi Mayaa,
Please use this method.
insert the value u wish to see in dropdown in this table itab_dropdown and call this method.
wa_dropdown-handle = '3'.
wa_dropdown-value = 'abc'.
APPEND wa_dropdown TO itab_dropdown.
CALL METHOD wa_grid->set_drop_down_table
EXPORTING
it_drop_down = itab_dropdown.
Hope this helps........
Regards,
Kunjal
Similar Messages
-
Using Drop down box in a table control
Hi,
I'm new to ABAP. I'm trying to use drop down boxes as fields inside a table control.Im using 2 fields (f1 and f2). I want to dynamically populate values in f2 based on f1 i.e once i choose a value in f1 and click on f2 , it should give me a list of values in f2 based on the value of f1. f1 and f2 are from different tables.
what i have done : i am able to populate values in f2 (based on the value of f1)
Problem::
1. Once i choose a value in the field f1, the value is not remaining in the field. Once i choose, the value blinks for a while and goes off ! ... ( my guess :: PBO is clearing it )
2. After i choose a value in f1 in the first row, the corresponding values in f2 are getting populated in all the rows.Hi!
For your first problem: Try to handle normal field (without table control) first.
In PAI, you have to move value from dynpro field to your program field. In case of tables, you have to modify corresponding line of internal table.
Then next PBO will read updated value and screen display doesn't loose any longer changes.
In case of identical naming of screen fields / global fields in program, some movements are done automatically by system based on this naming. That's of course not possible with internal tables, so try a global field with a name different to field on screen to see the behavior.
For your second problem: I guess, your struggling with a global work area of your internal table, which is not correctly filled with screen values for each time -> once filled, all lines changed.
Regards,
Christian -
hi to all , my querry is as follows how to give dropdown box for one paricular column in alv grid . pls give sample code . i have searched for it in forum . but i could not get correct answer . pls give coding . points will be rwewarded.
2, pls tell how to make one particular cell of one column editable . we know that we can make one column editable by using is _layout- edit = 'x'.pls give coding . one sample programHi.
for editable ALV,
refer the following link , it is havine one complete editable ALV program
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm
for drill down run the following code.
REPORT yfi7g_ing_mic_001 .
*PROGRAM YFI7G_ING_MIC_001.
TABLES: vbak .
TABLES: mara .
TYPES: BEGIN OF tp_vbak ,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
erzet TYPE vbak-erzet,
ernam TYPE vbak-ernam,
vbtyp TYPE vbak-vbtyp,
trvog TYPE vbak-trvog,
auart TYPE vbak-auart,
lifsk TYPE vbak-lifsk,
faksk TYPE vbak-faksk,
waerk TYPE vbak-waerk,
vkorg TYPE vbak-vkorg,
kunnr TYPE vbak-kunnr,
vgbel TYPE vbak-vgbel,
vgtyp TYPE vbak-vgtyp,
END OF tp_vbak .
TYPES: BEGIN OF tp_mara ,
matnr TYPE mara-matnr,
END OF tp_mara .
TYPES: BEGIN OF tp_alv1_data.
INCLUDE TYPE tp_vbak .
TYPES: END OF tp_alv1_data.
TYPES: BEGIN OF tp_alv2_data.
INCLUDE TYPE tp_mara .
TYPES: END OF tp_alv2_data.
TYPE-POOLS: slis.
DATA: gt_vbak TYPE STANDARD TABLE OF tp_vbak WITH HEADER LINE.
DATA: gt_mara TYPE STANDARD TABLE OF tp_mara WITH HEADER LINE.
DATA: gs_variant LIKE disvariant.
DATA: gt_alv1_data TYPE STANDARD TABLE OF tp_alv1_data WITH HEADER LINE.
DATA: gt_alv2_data TYPE STANDARD TABLE OF tp_alv2_data WITH HEADER LINE.
SELECTION-SCREEN *
BLOCK b0 *
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln. "<field not defined?>
PARAMETERS: p_matnr LIKE mara-matnr. "<field not defined?>
SELECTION-SCREEN END OF BLOCK b0.
BLOCK bvar *
SELECTION-SCREEN BEGIN OF BLOCK bvar WITH FRAME.
PARAMETERS: p_vari LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK bvar.
BLOCK bbox *
SELECTION-SCREEN BEGIN OF BLOCK bbox WITH FRAME.
PARAMETERS: p_box_up RADIOBUTTON GROUP b1,
p_box_do RADIOBUTTON GROUP b1 DEFAULT 'X',
p_box_no RADIOBUTTON GROUP b1.
SELECTION-SCREEN END OF BLOCK bbox.
AT SELECTION-SCREEN ON P_VARI *
AT SELECTION-SCREEN ON p_vari.
PERFORM alv_variant_existence USING p_vari
CHANGING gs_variant.
AT SELECTION-SCREEN ON VALUE REQUEST FOR P_VARI *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM alv_variant_f4 CHANGING p_vari
gs_variant.
INITIALIZATION *
INITIALIZATION.
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM authority_check.
PERFORM get_control_data.
PERFORM get_transaction_data.
PERFORM process_transaction_data.
END-OF-SELECTION *
END-OF-SELECTION.
PERFORM output_data.
F O R M S *
FORM AUTHORITY_CHECK *
Perform authority checks for the report *
FORM authority_check.
!!! Note: authorisation checks are application-dependent.
!!! Some common cases are listed below - please select one of them
!!! or add new authorisation checks.
!!! If the report is creating batch input session or using LDB
!!! it may be sufficient to use automatic SAP auth.checks.
Authorisation for displaying documents in a single company code
authority-check object 'F_BKPF_BUK'
id 'BUKRS' field p_bukrs
id 'ACTVT' field '03'.
if sy-subrc <> 0.
message e001(z9) with 'No authorisation to display documents'
'in company code' p_bukrs.
endif.
Displaying documents from a list of company codes (select-options)
call function 'Y_BUKRS_AUTHORITY_CHECK'
EXPORTING
ACTVT = '03'
NOMESSAGE = ' '
tables
s_bukrs = s_bukrs.
ENDFORM. " AUTHORITY_CHECK
FORM GET_CONTROL_DATA *
Read configuration etc. *
FORM get_control_data.
ENDFORM. " GET_CONTROL_DATA
FORM GET_TRANSACTION_DATA *
Read documents etc. *
FORM get_transaction_data.
!!! Data selection statement below has been generated automatically.
!!! Please check if it is correct and complete.
!!! Use table joins or 'SELECT FOR ALL ENTRIES' when selecting data
!!! from related tables.
SELECT
vbeln
erdat
erzet
ernam
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE gt_vbak
CHECK NOT gt_vbak[] IS INITIAL.
SELECT
matnr
FROM mara
INTO CORRESPONDING FIELDS OF TABLE gt_mara
FOR ALL ENTRIES IN gt_vbak
WHERE ernam = gt_vbak-ernam
ENDFORM. " GET_TRANSACTION_DATA
FORM PROCESS_TRANSACTION_DATA *
FORM process_transaction_data.
LOOP AT gt_vbak .
MOVE-CORRESPONDING gt_vbak TO gt_alv1_data .
APPEND gt_alv1_data .
ENDLOOP.
FREE gt_vbak .
LOOP AT gt_mara .
MOVE-CORRESPONDING gt_mara TO gt_alv2_data .
APPEND gt_alv2_data .
ENDLOOP.
FREE gt_mara .
ENDFORM. " PROCESS_TRANSACTION_DATA
FORM OUTPUT_DATA *
FORM output_data.
PERFORM alv_list_display.
ENDFORM. " OUTPUT_DATA
FORM DISPLAY_RECORD *
Display object associated with the current ALV line *
FORM display_record USING is_selfield TYPE slis_selfield.
READ TABLE gt_alv1_data INDEX is_selfield-tabindex.
CHECK sy-subrc = 0.
!!! SAMPLE IMPLEMENTATION FOR DISPLAYING FI DOCUMENTS:
SET PARAMETER ID 'BUK' FIELD gt_alv1_data-vbeln.
set parameter id 'BLN' field gt_alv1_data-belnr.
set parameter id 'GJR' field gt_alv1_data-gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDFORM. " DISPLAY_RECORD
FORM ALV_LIST_DISPLAY *
Invoke main ALV function to format and show the report *
FORM alv_list_display.
DATA: ls_layout TYPE slis_layout_alv,
ls_print TYPE slis_print_alv,
ls_keyinfo TYPE slis_keyinfo_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_exctab TYPE slis_t_extab,
lt_sorttab TYPE slis_t_sortinfo_alv,
lt_events TYPE slis_t_event.
PERFORM alv_init_report_events TABLES lt_events.
PERFORM alv_init_report_layout TABLES lt_fieldcat
lt_exctab
lt_sorttab
CHANGING ls_layout
ls_print
ls_keyinfo.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
i_callback_program = sy-cprog
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_excluding = lt_exctab
IT_SPECIAL_GROUPS =
it_sort = lt_sorttab
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
i_save = 'A'
is_variant = gs_variant
it_events = lt_events
IT_EVENT_EXIT =
i_tabname_header = 'GT_ALV1_DATA'
i_tabname_item = 'GT_ALV2_DATA'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = ls_keyinfo
is_print = ls_print
IS_REPREP_ID =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab_header = gt_alv1_data
t_outtab_item = gt_alv2_data.
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " ALV_LIST_DISPLAY
FORM ALV_INIT_REPORT_LAYOUT *
Set up report layout definition for ALV_LIST_DISPLAY *
<-- OT_FIELDCAT list of fields *
<-- OT_EXCTAB excluded menu options *
<-- OT_SORTTAB sorting/grouping definition *
<-- OS_LAYOUT global report layout settings *
<-- OS_PRINT global report printout settings *
<-- OS_KEYINFO itab key fields (required only for hier.lists) *
FORM alv_init_report_layout TABLES ot_fieldcat TYPE slis_t_fieldcat_alv
ot_exctab TYPE slis_t_extab
ot_sorttab TYPE slis_t_sortinfo_alv
CHANGING cs_layout TYPE slis_layout_alv
cs_print TYPE slis_print_alv
cs_keyinfo TYPE slis_keyinfo_alv.
add menu items to be excluded to ot_exctab.
REFRESH ot_exctab.
REFRESH ot_fieldcat.
REFRESH ot_sorttab.
!!! List all ALV data fields for display here:
DD-struct = data dictionary structure name
DD-field = field of data dictionary structure
itab = internal table for output data
itab-field = internal table field name
key = set to 'X' if key field
sum = set to 'X' for totals
hid = set to 'X' if field is initially hidden
row = list row number (multi-line list if >1)
DD-struct DD-field itab itab-field key sum hid row
PERFORM alv_build_fieldcat TABLES ot_fieldcat USING:
'VBAK' 'VBELN' 'GT_ALV1_DATA' 'VBELN' ' ' ' ' ' ' 1 ,
'VBAK' 'ERDAT' 'GT_ALV1_DATA' 'ERDAT' ' ' ' ' ' ' 1 ,
'VBAK' 'ERZET' 'GT_ALV1_DATA' 'ERZET' ' ' ' ' ' ' 1 ,
'VBAK' 'ERNAM' 'GT_ALV1_DATA' 'ERNAM' ' ' ' ' ' ' 1.
PERFORM alv_build_fieldcat TABLES ot_fieldcat USING:
'MARA' 'MATNR' 'GT_ALV2_DATA' 'MATNR' ' ' ' ' ' ' 1 .
!!! List all ALV data fields for sorting/grouping here
itab = internal table for output data
itab-field = internal table field name
up = sort ascending
down = sort descending
grp = group by
comp = group initially compressed
pos = field position in sort sequence
itab field up down grp comp pos
PERFORM alv_build_sorttab TABLES ot_sorttab USING:
'GT_ALV1_DATA' 'VBELN' 'X' ' ' ' ' ' ' 1.
PERFORM alv_build_sorttab TABLES ot_sorttab USING:
'GT_ALV2_DATA' 'MATNR' 'X' ' ' ' ' ' ' 1.
!!! key definition - required only for hierarchical display (2 itabs)
cs_keyinfo-header01 = 'VBELN' .
cs_keyinfo-item01 = 'MATNR' .
!!! See the declaration of type SLIS_LAYOUT_ALV and set the fields
!!! of OS_LAYOUT record to change list-level attributes
os_layout-no_colhead = 'X'. " no headings
cs_layout-zebra = 'X'. " stripped pattern
os_layout-no_vline = 'X'. " columns separated by space
os_layout-totals_only = 'X'. " show only totals
os_layout-totals_text = 'Total'. " totals line label
os_layout-subtotals_text = 'Subtotal'. " subtotals line label
os_layout-subtotals_text = 'Subtotal'. " subtotals line label
os_layout-key_hotspot = 'X'. " keys as hotspot
os_layout-expand_all = 'X'. " Expand all positions
os_layout...
cs_print-no_print_selinfos = 'X'. " Skip selection statistics
cs_print-no_print_listinfos = 'X'. " Skip list statistics
os_print-...
ENDFORM. " INIT_REPORT_LAYOUT
FORM ALV_BUILD_FIELDCAT *
Format a single line for ALV_INIT_REPORT_LAYOUT *
FORM alv_build_fieldcat TABLES ot_fieldcat
USING iv_ref_tabname "ref to a table/field
iv_ref_fieldname
iv_tabname "actual table/field name
iv_fieldname
iv_key
iv_do_sum
iv_no_out
iv_row_pos.
status variables for auto-numbering of field column position
(column number reset when a new table or row begins)
STATICS: sv_last_tabname TYPE slis_tabname,
sv_last_row_pos TYPE i,
sv_current_col TYPE i.
IF sv_last_tabname <> iv_tabname OR sv_last_row_pos <> iv_row_pos.
sv_current_col = 1.
ELSE.
ADD 1 TO sv_current_col.
ENDIF.
sv_last_tabname = iv_tabname.
sv_last_row_pos = iv_row_pos.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: lv_fieldname TYPE slis_fieldname.
lv_fieldname = iv_fieldname.
!!! List all the special formatting requirements in cases below
case lv_fieldname.
when 'WRBTR'. "<-- link with currency required
ls_fieldcat-cfieldname = 'WAERS'.
ls_fieldcat-ctabname = iv_tabname.
when 'HKONT'. "<-- change default column header
ls_fieldcat-seltext_s = 'GL Acc.'.
ls_fieldcat-ddictxt = 'S'. " (S)hort (M)iddle (L)ong
when 'SOME_NUMBER' "<-- change number formatting
ls_fieldcat-nosign = 'X'.
ls_fieldcat-nozero = 'X'.
ls_fieldcat-just = 'L'. " (L)eft (R)ight (C)enter
endcase.
ls_fieldcat-ref_tabname = iv_ref_tabname.
ls_fieldcat-ref_fieldname = iv_ref_fieldname.
ls_fieldcat-tabname = iv_tabname.
ls_fieldcat-fieldname = iv_fieldname.
ls_fieldcat-key = iv_key.
ls_fieldcat-do_sum = iv_do_sum.
ls_fieldcat-no_out = iv_no_out.
ls_fieldcat-row_pos = iv_row_pos.
ls_fieldcat-col_pos = sv_current_col.
APPEND ls_fieldcat TO ot_fieldcat.
ENDFORM. " ALV_BUILD_FIELDCAT
FORM ALV_BUILD_SORTTAB *
Set up sorting information for ALV_INIT_REPORT_LAYOUT *
FORM alv_build_sorttab TABLES ot_sorttab TYPE slis_t_sortinfo_alv
USING iv_tabname TYPE slis_fieldname
iv_fieldname TYPE slis_fieldname
iv_up TYPE c
iv_down TYPE c
iv_subtot TYPE c
iv_comp TYPE c
iv_spos TYPE n.
ot_sorttab-spos = iv_spos.
ot_sorttab-fieldname = iv_fieldname.
ot_sorttab-tabname = iv_tabname.
ot_sorttab-up = iv_up.
ot_sorttab-down = iv_down.
ot_sorttab-subtot = iv_subtot.
ot_sorttab-comp = iv_comp.
APPEND ot_sorttab.
ENDFORM. " ALV_BUILD_SORTTAB
FORM ALV_INIT_REPORT_EVENTS *
Set up program events for ALV_LIST_DISPLAY *
<-- OT_EVENTS list of events and associated report subroutines *
FORM alv_init_report_events TABLES ot_events TYPE slis_t_event.
CLEAR ot_events.
REFRESH ot_events.
ot_events-name = slis_ev_user_command.
ot_events-form = 'USER_COMMAND'.
APPEND ot_events.
ot_events-name = slis_ev_pf_status_set.
ot_events-form = ''. "'PF_STATUS_SET'.
APPEND ot_events.
ot_events-name = slis_ev_top_of_list.
ot_events-form = 'TOP_OF_LIST'.
APPEND ot_events.
ot_events-name = slis_ev_end_of_list.
ot_events-form = 'END_OF_LIST'.
APPEND ot_events.
ot_events-name = slis_ev_top_of_page.
ot_events-form = 'TOP_OF_PAGE'.
APPEND ot_events.
ot_events-name = slis_ev_end_of_page.
ot_events-form = 'END_OF_PAGE'.
APPEND ot_events.
ot_events-name = slis_ev_foreign_top_of_page.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_foreign_end_of_page.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_top_of_coverpage.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_end_of_coverpage.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_before_line_output.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_after_line_output.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_caller_exit_at_start.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_list_modify.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_subtotal_text.
ot_events-form = ''.
APPEND ot_events.
ENDFORM. " ALV_INIT_REPORT_EVENTS
FORM USER_COMMAND *
Subroutine attached as callback form to ABAP List Viewer *
--> UCOMM - user command code passed from ALV *
--> SELFIELD - information record describing current line/field *
FORM user_command USING value(iv_ucomm) LIKE sy-ucomm
is_selfield TYPE slis_selfield.
CASE iv_ucomm.
WHEN '&IC1'. "ALV record selection
PERFORM display_record USING is_selfield.
when ...
ENDCASE.
ENDFORM. " USER_COMMAND
FORM PF_STATUS_SET *
Subroutine attached as callback form to ABAP List Viewer, *
allows setting alternative menu. If necessary: *
1. Copy 'STANDARD' menu from SAPLKKBL and modify as required, *
2. Activate callback *
FORM pf_status_set USING it_exctab TYPE slis_t_extab.
set pf-status 'STANDARD' excluding it_exctab.
ENDFORM. " PF_STATUS_SET
FORM TOP_OF_LIST *
Subroutine attached as callback form to ABAP List Viewer, *
executed once at the start of list output. *
FORM top_of_list.
DATA: lt_seltab TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
DATA: lv_report LIKE sy-repid.
lv_report = sy-repid. "do not pass sy-repid to function!
IF p_box_up = 'X'. "display select options at report start
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = lv_report
TABLES
selection_table = lt_seltab.
remove 'technical' parameters with 'DELETE LT_SELTAB WHERE...'
before display, if necessary
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = lv_report
seltext = 'X'
dyn_range =
newpage = ' '
screennr = 1000
TABLES
sel_tab = lt_seltab
EXCEPTIONS
sel_tab_empty = 1.
ENDIF. "p_box_up = 'X'
ENDFORM. " TOP_OF_LIST
FORM END_OF_LIST *
Subroutine attached as callback form to ABAP List Viewer *
executed once at the end of list output. *
FORM end_of_list.
DATA: lt_seltab TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
DATA: lv_report LIKE sy-repid.
lv_report = sy-repid. "do not pass sy-repid to function!
IF p_box_do = 'X'. "display select options at report end
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = lv_report
TABLES
selection_table = lt_seltab.
remove 'technical' parameters with 'DELETE LT_SELTAB WHERE...'
before display, if necessary
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = lv_report
seltext = 'X'
dyn_range =
newpage = ' '
screennr = 1000
TABLES
sel_tab = lt_seltab
EXCEPTIONS
sel_tab_empty = 1.
ENDIF. "p_box_do = 'X'
ENDFORM. " END_OF_LIST
FORM TOP_OF_PAGE *
Subroutine attached as callback form to ABAP List Viewer *
FORM top_of_page.
standard Ingram Micro report page heading
DATA: lv_coco_pos TYPE i, "CurPos of 'Company confidential'
lv_title_pos TYPE i, "CurPos of report title
lv_title(70) TYPE c, "Truncated report title
lv_page_pos TYPE i, "CurPos of page number
lv_date_pos TYPE i, "CurPos of date and time
lv_page_no(10) TYPE c,
lv_date(25) TYPE c,
lv_time(20) TYPE c,
lv_page(10) TYPE c.
We may need to truncate title if the line size is < 81.
IF sy-linsz < 81.
lv_title = sy-title+0(50).
ELSE.
lv_title = sy-title.
ENDIF.
Decide on positioning of text depending on width of page
lv_title_pos = ( sy-linsz / 2 ) - ( STRLEN( lv_title ) / 2 ).
lv_coco_pos = sy-linsz - 20.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE: / 'Ingram Micro',
AT lv_title_pos lv_title,
AT lv_coco_pos 'Company Confidential'.
Setup data correctly in the correct format for the display fields.
lv_page = sy-pagno.
SHIFT lv_page LEFT DELETING LEADING ' '.
CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4)
INTO lv_date SEPARATED BY '.'.
CONCATENATE sy-uzeit0(2) ':' sy-uzeit2(2) INTO lv_time.
CONCATENATE lv_date lv_time INTO lv_date SEPARATED BY ' '.
CONCATENATE 'Page' lv_page INTO lv_page_no SEPARATED BY ' '.
Decide on positioning of text depending on width of page.
lv_page_pos = sy-linsz - ( STRLEN( lv_page_no ) ).
WRITE: / lv_date,
AT lv_page_pos lv_page_no.
ULINE.
ENDFORM. " TOP_OF_PAGE
FORM END_OF_PAGE *
Subroutine attached as callback form to ABAP List Viewer *
FORM end_of_page.
ENDFORM. " END_OF_PAGE
Form ALV_VARIANT_EXISTENCE
Reads ALV variant definition
FORM alv_variant_existence USING iv_variant LIKE disvariant-variant
CHANGING os_variant LIKE disvariant.
CHECK NOT iv_variant IS INITIAL.
os_variant-report = sy-repid.
os_variant-variant = iv_variant.
IF iv_variant CP '/*'. "user-specific variants begin with slash
os_variant-username = sy-uname.
ENDIF.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = os_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e001(z9) WITH 'Please select a valid display variant.'.
ENDIF.
ENDFORM. " ALV_VARIANT_EXISTENCE
FORM ALV_VARIANT_F4 *
Display list of layout variants on report selection screen *
FORM alv_variant_f4 CHANGING cv_varname LIKE disvariant-variant
cs_variant LIKE disvariant.
DATA: lv_exit(1) TYPE c.
cs_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = cs_variant
i_save = 'A'
it_default_fieldcat =
IMPORTING
e_exit = lv_exit
es_variant = cs_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF lv_exit = space.
cv_varname = cs_variant-variant.
ENDIF.
ENDIF.
here in output. if you will click on material. you can go to other transaction.
also for drill down you can refer one standard program.
DEMO_DYNPRO_DROPDOWN_LISTBOX
regards
Ruchika
reward if useful. -
WAD - How to Minimize the Space Between Drop-Down Box and Table
Hi all,
I am trying to display a query in 'Table' with Web Application Designer (WAD). First, I have placed the 'Drop-down box' web-item and 'Table' web-item below it in the Web Template. There is an half-inch of space between the 'Drop-down box' and the 'Table' when it displays on the browser. It doesn't look good with this gap.
How can I eliminate or minimize this gap, PLEASE ?.
Thanks.Hi Ingo & Hari,
Thanks a lot for your help. Now it reduced the gap between the drop-down box and table to 3mm on browser.
But, there is no gap on web template. If we change some settings, we could still further reduce the gap while displaying it on browser.
Any new suggestions, PLEASE. Thanks again.
<!--BW HTML data source object tags: -->
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_PROPERTIES"/>
<param name="TEMPLATE_ID" value="TESTWBOLAPQUERYUSER1"/>
TEMPLATE PROPERTIES
</object>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_DATA_PROVIDER"/>
<param name="NAME" value="DATAPROVIDER_1"/>
<param name="QUERY" value="Z_BWSTAT_OLAP_PER_QUERY_USER"/>
<param name="INFOCUBE" value="0BWTC_C10"/>
DATA_PROVIDER: DATAPROVIDER_1
</object>
<html>
<head>
<title>BW Web Application</title>
<link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<P align=left>
<TABLE cellSpacing=1 cellPadding=1 width="75%" border=0>
<TR>
<TD vAlign=top><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="DROPDOWNBOX_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_DDOWN"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="69"/>
<param name="IOBJNM" value="0TCTUSERNM"/>
ITEM: DROPDOWNBOX_1
</object></TD>
<TD vAlign=top><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="DROPDOWNBOX_2"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_DDOWN"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="19"/>
<param name="IOBJNM" value="0TCTIFCUBE"/>
<param name="MAXVALUES" value="1"/>
ITEM: DROPDOWNBOX_2
</object></TD>
<TD vAlign=top><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="DROPDOWNBOX_3"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_DDOWN"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="34"/>
<param name="IOBJNM" value="0CALDAY"/>
ITEM: DROPDOWNBOX_3
</object></TD>
<TD vAlign=top><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="DROPDOWNBOX_4"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_DDOWN"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="22"/>
<param name="IOBJNM" value="0TCTQUERY"/>
ITEM: DROPDOWNBOX_4
</object></TD></TR></TABLE>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TABLE_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="505"/>
<param name="BORDER_STYLE" value="FORM"/>
<param name="ALT_STYLES" value=""/>
ITEM: TABLE_1
</object></P>
<P align=left> </P>
<P align=left> </P><FONT color=#0000ff size=2>
<P align=center></FONT> </P>
<P align=center> </P>
<P align=center> </P>
</body>
</html> -
How to insert drop-down box into the already set-up table ?
if i have a table already set up, and i do want to add the drop-down box into each column like in the excel. how would i do that ? this drop-down box would allows me to specifically select the data as shown on the screen.
Hi Bondwaan,
I am not sure wht you are asking but I suspect it has to do with a popup menu. If that is the case, a popup menu is a formatting choice.
If you need more info, you will need to ask a more specific question.
quinn -
Dear Expert,
I am new to OOPS ,
I want to display drop down list for a particular field in my output, so I am using OOPS but in my below code
I am facing problem in displaying the output as I am getting the error message
Field catalog not found...
Also advice me how to display drop down list in a particular field.
Please advice
MODULE pbo OUTPUT.
SET PF-STATUS 'ZTEST'.
IF g_custom_container IS INITIAL.
DATA: lt_exclude TYPE ui_functions,
lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
CREATE OBJECT g_custom_container
EXPORTING
container_name = g_container.
CREATE OBJECT g_grid
EXPORTING
i_parent = g_custom_container.
PERFORM field_catalog TABLES it_lvc_t_fcat
USING: 'S_FINAL' 'MATNR' ' ' 'Part Number' ' ' ' ',
'S_FINAL' 'MAKTX' ' ' 'Part Description' ' ' ' ',
'S_FINAL' 'MBLNR' ' ' 'Document No' ' ' ' ',
'S_FINAL' 'BLDAT' ' ' 'Document date' ' ' ' ',
'S_FINAL' 'LIFNR' ' ' 'Vendor Number' ' ' ' ',
'S_FINAL' 'STATUS' ' ' 'Acknowledgement' ' ' 'X',
'S_FINAL' 'REMARKS' ' ' 'Remarks' ' ' 'X'.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
* I_STRUCTURE_NAME =
is_layout = it_lvc_s_layo
CHANGING
it_outtab = i_final
it_fieldcatalog = it_lvc_t_fcat
ENDIF.
ENDMODULE. " PBO OUTPUT
FORM field_catalog TABLES t_field_catalog STRUCTURE wt_lvc_s_fcat
USING fp_tabname TYPE any
fp_fieldname TYPE any
fp_key TYPE any
fp_text TYPE any
fp_do_sum TYPE any
fp_edit TYPE any.
t_field_catalog-tabname = fp_tabname.
t_field_catalog-fieldname = fp_fieldname.
t_field_catalog-key = fp_key.
t_field_catalog-seltext = fp_text.
t_field_catalog-do_sum = fp_do_sum .
t_field_catalog-edit = fp_edit .
ENDFORM. "field_catalog
Edited by: Karthik R on Mar 15, 2010 6:11 PMHi Karthik,
Below mentioned is a Simple code for creating dropdown lists for columns in ALV grid output
REPORT z_alv_dropdown.
*Type pools declarations for ALV
TYPE-POOLS : slis.
*data declarations for ALV container, ALV grid, Field catalogues & layout
DATA: g_grid TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container,
gt_fieldcat TYPE lvc_t_fcat,
gs_layout TYPE lvc_s_layo.
*INTERNAL TABLE AND WA DECLARATIONS FOR t517 A table
DATA: gt_outtab TYPE STANDARD TABLE OF t517a INITIAL SIZE 0,
wa_outtab TYPE t517a.
*initialisation event
INITIALIZATION.
*Start of selection event
START-OF-SELECTION.
*Call to ALV
CALL SCREEN 600.
*On this statement double click it takes you to the screen painter SE51.
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen , Here we can give a title and customized menus
Here we also call the subroutine for ALV output.
MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
set pf-status 'xxx'.
set titlebar 'MAIN100'.
Subroutine to display the output in alv
PERFORM alv_output.
ENDMODULE. "pbo OUTPUT
PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes and
based on the user command we can do the coding.
MODULE PAI INPUT *
MODULE pai INPUT.
ENDMODULE. "pai INPUT
*& Form BUILD_FIELDCAT
FORM build_fieldcat.
DATA ls_fcat TYPE lvc_s_fcat.
*Build the field catalogue
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'T517A'
CHANGING
ct_fieldcat = gt_fieldcat.
To assign dropdown in the fieldcataogue
LOOP AT gt_fieldcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN 'SLART'.
*drdn-hndl = '1' is the first list box
ls_fcat-drdn_hndl = '1'.
ls_fcat-outputlen = 15.
MODIFY gt_fieldcat FROM ls_fcat.
*drdn-hndl = '2' is the second list box
WHEN 'ABART'.
ls_fcat-drdn_hndl = '2'.
ls_fcat-outputlen = 15.
MODIFY gt_fieldcat FROM ls_fcat.
ENDCASE.
ENDLOOP.
ENDFORM. "build_fieldcat
*& Form ALV_OUTPUT
FORM alv_output .
*Create object for container
CREATE OBJECT g_custom_container
EXPORTING container_name = 'CCONT'.
*create object for grid
CREATE OBJECT g_grid
EXPORTING i_parent = g_custom_container.
Build fieldcat and set column
*Assign a handle for the dropdown listbox.
PERFORM build_fieldcat.
*Build layout
PERFORM build_layout.
Define a drop down table.
PERFORM dropdown_table.
*fetch values from the T517A table
SELECT * FROM t517a INTO TABLE gt_outtab.
*Display ALV output
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = gt_outtab.
ENDFORM. "ALV_OUTPUT
*& Form dropdown_table
text
--> p1 text
<-- p2 text
FORM dropdown_table.
*Declarations for drop down lists in ALV.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
First SLART listbox (handle '1').
ls_dropdown-handle = '1'.
ls_dropdown-value = '01 Pink'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '02 Yellow'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '03 Green'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '04 Black'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '05 White'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '06 Blue'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-value = '09 Other Colors'.
APPEND ls_dropdown TO lt_dropdown.
*method to display the dropdown in ALV
CALL METHOD g_grid->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.
ENDFORM. " dropdown_table
*& Form build_layout
text
*layout for ALV output
FORM build_layout .
gs_layout-cwidth_opt = 'X'.
gs_layout-grid_title = 'ALV DROPDOWN LISTS'.
gs_layout-no_toolbar = 'X'.
ENDFORM. " build_layout
Hope it is helpful,
Regards,
Soundarya. -
Hello Friends,
I have developed a SAP QUERY using SQ01, SQ02, SQ03. It displays an ALV output.
Now for some particular fields, I want a drop down box in the output ALV. Since in SAP QUERY output alv and final table runs at runtime I am not able to put any of two options I have i.e. VRM_SET_VALUES or DROP_DOWN_HANDLE.
Can you suggest me the way with which I can display a drop down in the output ALV.
Please revert if the questions seems confusing.
Thanks,
HarjeetDear Sai,
The Data provider should be the same which is being used by the table and more over you have an option of Read mode over there to display the values in the report based on the Dimension Table values or Posted values or Master data table values.
Moreover in the specific properties panel of the Drop down, you need to mention on which characteristic you want the drop down box.
Post back if your issue doest resolve.
Cheers
Gattu -
Hebrew fonts from drop-down box not displaying in text box.
I am using InDesign CS 5.5 on a Mac 10.8.4.
When in ID, the fonts I am seeing on the Font dropdown menu when I try to use in a text box are not displaying correctly. They only display as boxes. The fonts are in the Hebrew language. They are properly installed in the FontBook.
Please help!! Thank you.Reema,
I followed most of your steps. I have a question reg. step 3 ie populating data in node 1.
Here is my code:
method WDDOINIT .
types: begin of zs,
zktokd type kna1-ktokd,
end of zs.
data: handle1 type ref to if_wd_context_node,
begin of zstruct,
zktokd type kna1-ktokd,
end of zstruct,
zitab type table of zs.
handle1 = wd_context->get_child_node( name = 'NODE1' ).
*select ktokd into corresponding fields of zstruct from kna1.
*append zstruct to zitab.
*endselect.
zstruct-zktokd = 'Sold-to party'.
append zstruct to zitab.
zstruct-zktokd = 'Goods recipient'.
append zstruct to zitab.
zstruct-zktokd = 'Payer'.
append zstruct to zitab.
zstruct-zktokd = 'Bill-to party'.
append zstruct to zitab.
zstruct-zktokd = 'Prospective Customer'.
append zstruct to zitab.
zstruct-zktokd = 'Competitor'.
append zstruct to zitab.
zstruct-zktokd = 'Sales partners'.
append zstruct to zitab.
zstruct-zktokd = 'Hierarchy Node'.
append zstruct to zitab.
zstruct-zktokd = 'Named List of Accounts'.
append zstruct to zitab.
zstruct-zktokd = 'Distribution center'.
append zstruct to zitab.
zstruct-zktokd = 'Payer'.
append zstruct to zitab.
handle1->bind_table( new_items = zitab ).
endmethod.
Please let me know if this is the best way to populate the node and then bind the table values from the node to the drop down box.
Thanks and Regards. -
How to create a drop down box and text box in screen painter?
Hi i am totally new to this concept of screen painter..please can any tell me
how to create drop down box in screen painter?
How to create or display default date and time values?
How to create text box for giving comments?
How to store the records that we are entering in a table?
Please can any one send me the procedure for creating all these its very urgent useful information will be surely rewarded.Hi,
Check all these.
1.how to create drop down box in screen painter?
To get Drop Drown Box on screen .
Follow these steps.
1.
Go to T.Code SE51 and Select Laypout for the Screen.
2.
Double click on the field for which u want Dropdown box.
3.
Then U will see Name ,Text ,DROPDOWN.Click on that and select List Box or ListBox with key . Better to to select first one.
4.
Save and Activate ur screen .
5.
Enter the following piece of code in the PBO of the screen.(Change for ur requirement).
6.
The following code should be written under PROCESS BEFORE EVENT in the MODULE.
TYPE-POOLS :vrm.
DATA:
i_natio TYPE vrm_values, "-->Table that is passed through FM vrm_set_values
w_natio LIKE LINE OF i_natio.
DATA:
BEGIN OF i_t005t OCCURS 0,
land1 TYPE t005t-land1,
natio TYPE t005t-natio,
END OF i_t005t.
IF i_t005t[] IS INITIAL.
SELECT land1 natio
FROM t005t
INTO TABLE i_t005t
WHERE spras = sy-langu.
IF sy-subrc = 0.
LOOP AT i_t005t .
w_natio-key = i_t005t-land1.
w_natio-text = i_t005t-natio.
APPEND w_natio TO i_natio.
CLEAR w_natio.
ENDLOOP.
ENDIF.
ENDIF.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'I_IT0002-NATIO' "-->Field for which dropdown is needed.
values = i_natio
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2.1.How to create or display default date and time values?
1.
create input field for DATE and TIME on screen.ex. DATE1 and TIME1 are screen field names .
2.
Just assign SY-DATUM to DATE1 and SY-UZEIT to TIME1 under PROCESS BEFORE EVENT.
3.How to create text box for giving comments?
1.
Define one variable in the TOP include with type STRING means Global variable.
2.
Create one input field by giving screen field name which u have defined in the above step.
4.How to store the records that we are entering in a table?
For this case.. Create one table control. you can select one record and create record in the Z table by pressing button on Application toolbar..
Check the following steps to handle Table control.
1).
U should take one variable in your internal table or in structure which
is used for table control fields
ex :
data :
begin of itab occurs 0 ,
mark type c , "This is to select the record.
matnr like mara-matnr ,
matkl like mara-matkl,
maktx like makt-maktx,
end of itab .
Controls: TABC types TABLEVIEW using screen 100.
2).
This mark variable should be given in Table control properties.
follow the path
double click on the table control-->attributes .->select
w/SelColumn and in that itab-mark. Check in the figure.
[Table control properties screen|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
3).
After that. Take this example.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB WITH CONTROL tabc
ENDLOOP.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
LOOP AT ITAB.
Module read_table_control.
ENDLOOP.
module user_command_0100.
In this Module read_table_control, You should write the following code
MODULE read_table_control INPUT.
MODIFY itab INDEX tabc-current_line."( This will update the
"ITAB table MARK field with 'X ' whatever we have selected
"on table control.)
ENDMODULE.
4)
If you want to Delete some of the records from Table control
follow this code Create one pushbutton and give Fucnction code to that
and write below code
CASE OKCODE.
WHEN 'CREATE'.
LOOP AT itab WHERE mark = 'X'.
"Use UPDATE statement to create new record.
ENDLOOP.
ENDCASE.
I hope that you will get something.
Regards,
Venkat.O -
Fetching values from database into a drop down box
in my JSP page there are 3 drop down boxes for date of birth......
what i need is i want to get the values from database into that drop down box when i access the JSP page.......
session is there....'m getting all other values.......
I will attach the JSP page.....
Please help me...........
Thanks in Advance......
<%@ taglib uri='/WEB-INF/taglib/struts-bean.tld' prefix='bean'%>
<%@ taglib uri='/WEB-INF/taglib/struts-logic.tld' prefix='logic'%>
<%@ taglib uri='/WEB-INF/taglib/dyna.tld' prefix='dyna'%>
<%@ taglib uri='/WEB-INF/taglib/struts-html.tld' prefix='html'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><bean:message key="page_title"/></title>
<link href="<bean:message key="context"/>/CSS/default.css" rel="stylesheet" type="text/css" />
<script src="<bean:message key="context"/>/js/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="<bean:message key="context"/>/CSS/screen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%!
Membership mShip = null;
%>
<script language="javascript" >
function checkDate(Form){
var d;
d = Form.year.value+"-"+Form.month.value+"-"+Form.day.value;
alert("Date is:"+d);
Form.dob.value = d;
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<jsp:include flush="true" page="../templates/header.jsp"/> </td>
</tr>
<tr>
<td class="menuTD">
<jsp:include flush="true" page="../templates/menu.jsp"/> </td>
</tr>
<tr>
<td class="sub_menuTR"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="column" valign="top" width="170"><jsp:include flush="true" page="../templates/left_panel.jsp"/></td>
<td valign="top" align="left">
<dyna:message error="error" warning="warning" message="message"/>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80%" valign="top" align="left">
<%
if(session != null){
mShip = (Membership)session.getAttribute("member");
%>
<form action="updateContactDetails.dy" method="post" name="form1">
<input type="hidden" name="m" value="<%=request.getParameter("m")%>" />
<table width="100%" border="0">
<tr>
<td>First Name</td>
<td><input name="first_name" type="text" id= "first_name" value = "<bean:write name = "member" property = "first_name" />" /></td>
</tr>
<tr>
<td>Last Name </td>
<td><input name="last_name" type="text" id="last_name" value = "<bean:write name = "member" property = "last_name" />" > </td>
</tr>
<tr>
<td>Address</td>
<td><input name="address1" type="text" id="address1" value = "<bean:write name = "member" property = "address1" />" ></td>
</tr>
<tr>
<td> </td>
<td><input name="address2" type="text" id="address2" value = "<bean:write name = "member" property = "address2" />" ></td>
</tr>
<tr>
<td>Suburb/City </td>
<td><input name="city" type="text" id="city" value= "<bean:write name = "member" property = "city" />" ></td>
</tr>
<tr>
<td>State/Territory</td>
<td><input type="text" name="state" value = "<bean:write name = "member" property = "state" />" ></td>
</tr>
<tr>
<td>Postcode</td>
<td><input type="text" name="postcode" value = "<bean:write name = "member" property = "postcode" />" ></td>
</tr>
<tr>
<td>Contact Phone</td>
<td><input type="text" name="home_phone" value = "<bean:write name = "member" property = "home_phone" />" ></td>
</tr>
<tr>
<td>Mobile</td>
<td><input type="text" name="mobile" value = "<bean:write name = "member" property = "mobile" />" ></td>
</tr>
<tr>
<td>Date of birth</td>
<td nowrap="nowrap"><select name="day">
<option>Day</option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
<option value="06">6</option>
<option value="07">7</option>
<option value="08">8</option>
<option value="09">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="month">
<option>Month</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">Decembber</option>
</select>
<select name="year" onChange = "checkDate(this.form);" >
<option>Year</option>
<option value="1957">1957</option>
<option value="1956">1956</option>
<option value="1955">1955</option>
<option value="1954">1954</option>
<option value="1955">1955</option>
<option value="1956">1956</option>
<option value="1957">1957</option>
<option value="1958">1958</option>
<option value="1959">1959</option>
<option value="1960">1960</option>
<option value="1961">1961</option>
<option value="1962">1962</option>
<option value="1963">1963</option>
<option value="1964">1964</option>
<option value="1965">1965</option>
<option value="1966">1966</option>
<option value="1967">1967</option>
<option value="1968">1968</option>
<option value="1969">1969</option>
<option value="1970">1970</option>
<option value="1971">1971</option>
<option value="1972">1972</option>
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
<option value="1993">1993</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
</select ></td></tr>
<tr>
<td><input type="hidden" name = "dob" /> </td>
<td nowrap="nowrap"><input type="submit" value="Submit" /></td>
</tr>
</table>
</form>
</td>
<td width="40"></td>
<td width="200" valign="top">
<div id="headlines">
<jsp:include flush="true" page="../templates/profile.jsp"/>
</div>
</td>
</tr>
</table>
</td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td><jsp:include flush="true" page="../templates/footer.jsp"/></td>
</tr>
</table>
</body>
</html>i think normally u will get data from databsae as objects.they are like java beans having getter and setter methods.so you create a collection of those objects like collect all the objects coming from database into an arraylist or....
suppose you want to populate the dropdown box with say "username" from database object s, your code will look like that
<html:select property="name">
<html:options collection="databaseList" property="username" />
</html:select>
"databaseList" is collection(say.. ArrayList) of objects you are getting from database.this dropdown will contain all the "usernames" you are getting from database. -
How to show "ALL" Values by default in Page Drop-Down Lists in Pivot Tables
Hi Everyone,
Iam stuck with 1 problem please can any 1 help me if u know the solution.
Here is my problem:
How to show "ALL" Values by default in Page Drop-Down Lists in Oracle BI Pivot Tables?
For example, if you place Region in the pages area, a Region drop-down list allows the user to select a particular region, and see the data for only that region, rather than seeing all the Regions,But by default its not showing "ALL" option in the drop down list ,rather than doing that its showing result for only 1 region by default.
And an other problem with this pages area is, if we palce the multiple attributes in the Pages area in the pivot table, the (Fields)result is showing in vertically, the attributes 1 by 1(Every attribute in a new line) ,rather than showing like that, is there any way to show the results in horizantally?(We want to have it as a seperate drop drown list for every field horizantally not as a concatenated list).Thanks Nikhil. But I am fetching the values from the LOVCache.java.
I am using <af:selectManyChoice>. Is there any way I can use LOVCache.java value for selecting default values instead of hard coding?
I mean to say can I write
unselectedLabel="#{LOVCache.entityTypeSelectionList.anyValue}"
where LOVCache.entityTypeSelectionList is used to populate the drop down box.
Regards,
Aseet -
From database to drop down box
Hi all,
Suppose I have the following
String query ="Select name, number from Person";
I want to put all the "names" in a drop down box and all the "numbers" in a separate drop down box. When I do this:
while(rs.next()){
<select="person" onchange="showSelection">
<option value="<%=rs.getString("name")%>"><%=rs.getString("name")%></option></select>
I only get the value of the first name in my table. Can anyone help me?Hi
I think you need to do some order. my suggestion is to create an Object that contains name and number like this:public class MyClass {
String name;
int number;
public MyClass(String n,int num){
setName(n);
setNumber(num);
//set and get methods for the data members...
}next, roll over the ResultSet and create MyClass object each time and add it to a Vector or something like that. usually a drop down box displays many times and it will be very bad if you will query the data base each time you want to display it, thats why i suggest you to save this Vector in a bean or somewhere else (of course, if the data is static).
than display the vector content like this:<select name="person" onchange="showSelection">
<% Enumeration e=vec.elements();
while(e.hasMoreElements()){
MyClass m=(MyClass)e.nextElement();
%> <option value="<%=m.getName();%>"><%=m.getName();%></option>
<% }%>
</select>
<% e=vec.elements();
%><select name="number" onchange="showSelection">
<% while(vec.hasNext()){
MyClass m=(MyClass)vec.next();
%> <option value="<%=m.getNumber();%>"><%=m.getNumber();%></option>
<% }%>
</select>pay attention on how you wrote the select tag: <select="person"...
and not: <select name="person"...
hope it helps
mamtz
BTW
think of using struts and custom tags in jsp it will much easier to do this!!! -
How to grab the value from a drop down list inside a table cell
Hello,
My situation is I have a few columns displayed in a table format using repeater tag. Some cells is a dropdown list(<netui:select /> tag). My question is how can I grab the value when user made a selection.
I believe I can get the row index but I can't use the datasource attribute to get the user selection since it is in a repeater. All the cell use the same datasource and workshop will give "NULL" value when there are more than one tag bind to the same form valiable.
Any suggestion are very much appreciated! Thanks a lot in advance.
My snippet code are:
<netui-data:repeater dataSource="{pageFlow.ownedTask}"><netui-data:repeaterHeader></netui-data:repeaterHeader>
<tr valign="top">
<td><netui:select dataSource="{actionForm.userName}" optionsDataSource="{pageFlow.nameList}" onChange="getUser()" ></netui:select>
</td>
<td><netui:select dataSource="{actionForm.empDept}" optionsDataSource="{pageFlow.deptList}" onChange="getSelectedDept()" ></netui:select>
</td>
<td><netui:label value="{container.item.status}" />
</td>
</tr>
</netui-data:repeaterItem>
<netui-data:repeaterFooter></netui-data:repeaterFooter>
</netui-data:repeater>1) let drop down box be g_dd.
if g_dd is initial.
g_dd = option2.
endif.
2)
by default same pf-status is used by all the screens in the same program
if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come
set pf-status 'abc' excluding 'fcode_of_button'
endif.
or
data: git_fcode type sy-ucomm with header line.
git_fcode = 'fcode_of_button'.
append git_fcode.
if sy-dynnr = 'screen_no'. " for screens for which you do not want button to come
set pf-status excluding git_fcode
endif.
Edited by: Amit Gupta on Oct 11, 2008 11:36 AM -
Getting the value from a Drop Down Box
I'm working on a database project to keep track of our Blackberrys. The problem I'm having is entering the values for two drop down boxes. The page I'm working on enters the FirstName, LastName, Department, and Location. Department and Location have thier own Primary Keys and are foreign keys in the Person table. Departments and Locations are aligned by numbers like 1 = Ohio, 2 = Chicago. They
don't automatically increase. The problem I'm having is entering them as a foreign key in the Person Table. I'm not sure if I use a getValue or getSelected or some other code to get the values to populate in the Person Table. I just keep getting a can't add department or location to table.
public String newUser_action() {
// TODO: Process the button click action. Return value is a navigation
// case name where null will return to the same page.
if (personDataProvider.canAppendRow()) {
try {
RowKey rowKey =
personDataProvider.appendRow();
personDataProvider.setValue(
"DBO.PERSON.FIRSTNAME", rowKey,
firstName.getText());
personDataProvider.setValue(
"DBO.PERSON.LASTNAME", rowKey,
lastName.getText());
personDataProvider.setValue(
"DBO.PERSON.DEPTID", rowKey,
department.getSelected());
personDataProvider.setValue(
"DBO.PERSON.LOCATIONID", rowKey,
location.getSelected());
personDataProvider.setValue(
"DBO.PERSON.BEGINDATE", rowKey,
newDate.getText());
//personDataProvider.setValue(
"DBO.PERSONDEVICE.AQUIREDATE", rowKey,
newDate.getText());
personDataProvider.commitChanges();
info("New User " + newUser.getText() +
" added to USER table");
newUser.setText(null);
} catch (Exception e) {
log("Cannot add new User ", e);
error("Cannot add new User: " +
e.getMessage());
} else {
log("Cannot append new User");
error("Cannot append new User");
return null;
}Sun's databound components tutorial may prove helpful to you.
-
Dynamically create drop down box with JSP
Hi,
I hope this is not a repeat post, I have search the forum and a posting has not jumped out at me. I am making a jsp that dynamically constructs a custom SQL query.
I have a number of text boxes with an id, my jsp page calls a servlet, the servlet reads the contorl id and the value to build the query - this works great. However, there's a large text input box which receives a number of extra conditions - this text box receives the input in the following format:
searchAttributeName1,searchAttributeValue1;searchAttributeName2,searchAttributeValue2
This is functional, however, it's a bit rubbish as the user has to know the special recognised attributeNames. What I would like to have is some sort of criteria control. This would consist of a drop down box populated from the servlet, a text input for the value and a button to add another criteria control. so the user could build up the number of query criteria. The drop down box ensures they cannot select the wrong keyword, pressing the add criteria button adds a new drop down box and text box pair to the screen.
An example of this I recently saw was at Intel's jobs search web site https://jobs.intel.com/jobs/jobs.iccw - see that for example.
Has anyone got any ideas on how to achieve this? I initially thought use jsp scripting (there is no restriction against this) but I need to use javascript I'm guessing as the button click triggers adding a new combo box. Another idea was to use styles and tables to hide the other drop down boxes but this seems like a real hack that I'd like to avoid. I can do with with .NET i hope java can deliver!
Any ideas are much appreciated - I am a novice with java web development so please, any examples thoroughly explain (no need to explain populating the drop down box - there seem to be plenty of posts on this).
Thanks for any help or ideas on this issue -Gina,
Here is some sample code for using a ComboBox in a JSP from an EditCurrentRecord bean. This particular example uses a query, you can also populate combo boxes, list boxes, radio buttons and checkboxes from a static list. See the JavaDocs for the EditCurrentRecord bean.
<jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
<%
RowEditor.initialize(application, session , request, response, out, "wt_bc_WT_bcModule.WalkthroughEngineSlidesView");
RowEditor.setTargetUrl("WalkthroughEngineSlidesView_SubmitInsertForm.jsp");
RowEditor.createNewRow();
RowEditor.setReleaseApplicationResources(true);
RowEditor.useComboBox("Presname","select pres_name,pres_name from wt_info","PRES_NAME","PRES_NAME");
RowEditor.render();
%>
</jsp:useBean>
null
Maybe you are looking for
-
Returning several values from a C native method
Hi, I need to return 3 values from a native methode : an int (the return code), a string of variable length and a double. In pure C, my function would be defined as "int f ( char* s, double* d)", and I would "malloc" the string into the calling funct
-
My apps store screen seems to be frozen on Newstand. I am unable to move from this section. I an unable to select any other alternatives eg; when I select updates nothing happens. When I select select categories nothing happens.
-
Hi All, If connected my SAP ERP Development system to Business Objects. In SM59 the connection test is OK, and in /CRYSTAL/RPTADMIN also OK. Now the problem is that I want to connect the Productive system, that is locates in other server, diferent fr
-
How Do I Uninstall/Delete Flip4Mac?
I use Mavericks OS X 10.9.3. I would like to uninstall/delete "Flip4Mac." Please see picture 1. How do I uninstall/delete Flip4Mac?
-
Hello and sorry about my english... i have a question about Esri, BW and to show this map at the web. I had create a shapefile and load up to BW. Then i create a template with a map and the dataprovider to grap of a view with this attribute. The Demo