Customizing the selection in a Form
Hello.
I would like please to ask: is there a method to customize selection in a form?
For example I would like in my form to jump two items at a time in the form whenever I push on the direction cursors of the mobile phone.
The selection process seems to be handled by the Form class itself.
But is there a way to customize it?
Thank you.
Image.createImage(Image source)
Creates an immutable image from a source image. If the source image is mutable, an immutable copy is created and returned. If the source image is immutable, the implementation may simply return it without creating a new image.
Similar Messages
-
Multiple line selection and then capturing the selected values
Dear all
in my alv program ,i need to capture multiple line selections using checkboxes.
I have appended check boxes by adding it in the internal table & filling in field catalog.
but problem is i'm not able to capture multiple selected check boxes dynamically,
i could capture only the last selected check box,
option i found was to use class method get-selected-rows,but i'm unable to use it properly, could anyone explain in detail
i have already gone through the various examples in sdn but i am not able to work out.
like using parameters etc....
CAN ANY ONE HELP ME WITH THE CODE
help reqired immediately,
Thanks in advance.Hi Ankur,
In the PAI, just after the selection of your user event, button or menu,
add this code before getting the selected records.
<b>CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.</b>
where grid1 TYPE REF TO cl_gui_alv_grid,
Now fetch the selected records.
Check this code for reference
C O M P A N Y C O N F I D E N T I A L **
Care should be taken to prevent its unauthorized use. **
REPORT zfipost MESSAGE-ID f4 NO STANDARD PAGE HEADING .
AUTHOR : Susmitha Susan Thomas
DATE : August 18, 2005
*Abridged Version : This report generates a list in Abap List Viewer of
all the selected records in VBKPF/VBSEG. * *
(TRANSACTION ZPPD:Modified from transaction FBV0)
-- Class definition--
CLASS lcl_event_receiver DEFINITION DEFERRED.
--Tables--
TABLES: vbkpf. " Belegkopf
TABLES: tsp1d, pri_params, spopli.
TYPE-POOLS slis.
---- Global Variables -
DATA: anzkr(6) TYPE n,
lsind LIKE sy-lsind,
no_output(1) TYPE c,
records(1) TYPE c,
xpick(1) TYPE c,
xpickc(1) TYPE c,
xbinp(1) TYPE c,
rc LIKE syst-subrc,
ok_code LIKE sy-ucomm,
index TYPE i,
char_x(1) TYPE c VALUE 'X',
post TYPE c,
ans TYPE n,
user(40) TYPE c.
DATA :BEGIN OF i_doctype OCCURS 0,
blart LIKE vbkpf-blart,
END OF i_doctype.
--AlV Initialization--
DATA: gs_layout TYPE lvc_s_layo,
gt_fieldcat TYPE lvc_t_fcat,
gs_fieldcat TYPE lvc_s_fcat,
gs_index_rows TYPE lvc_t_row,
l_layout TYPE disvariant,
g_repid LIKE sy-repid,
g_max TYPE i VALUE 100,
ws_row_idx TYPE lvc_t_row ,
ws_row_no TYPE lvc_t_roid,
i_excl_func TYPE ui_functions,
ls_prnt TYPE lvc_s_prnt,
refresh TYPE c,
i_fieldcat TYPE lvc_t_fcat,
post(1) TYPE c,
accr_def(1) TYPE c,
rev_cd(3) TYPE c,
ch(1) TYPE c.
DATA: list_index LIKE sy-lsind,
flag TYPE n VALUE 0,
fl TYPE n VALUE 0,
g_container TYPE scrfname VALUE 'GRID_CONTAINER',
grid_container TYPE REF TO cl_gui_docking_container,
grid1 TYPE REF TO cl_gui_alv_grid,
custom_container1 TYPE REF TO cl_gui_custom_container,
event_receiver TYPE REF TO lcl_event_receiver,
gt_vbkpf1 TYPE STANDARD TABLE OF vbkpf WITH HEADER LINE,
i_vbkpf TYPE TABLE OF vbkpf WITH HEADER LINE,
i_ws_row_idx LIKE ws_row_idx WITH HEADER LINE.
---Internal table containing details of selected documents--
DATA : BEGIN OF gt_vbkpf OCCURS 0,
xpick(1) TYPE c,
belnr LIKE vbkpf-belnr,
gjahr LIKE vbkpf-gjahr,
bukrs LIKE vbkpf-bukrs,
blart LIKE vbkpf-blart,
budat LIKE vbkpf-budat,
bldat LIKE vbkpf-bldat,
bktxt LIKE vbkpf-bktxt,
waers LIKE vbkpf-waers,
usnam LIKE vbkpf-usnam,
xblnr LIKE vbkpf-xblnr,
rev_code(3) TYPE c,
rev_rsn(15) TYPE c,
rev_date(10) TYPE c,
linecolor(4) TYPE c,
END OF gt_vbkpf.
--Table to store long text--
DATA : BEGIN OF inline OCCURS 0,
tdformat TYPE tdformat,
tdline TYPE tdline,
END OF inline.
DATA: thead LIKE thead OCCURS 0 WITH HEADER LINE.
-- Records to be posted--
DATA: BEGIN OF tbkpf OCCURS 5.
INCLUDE STRUCTURE vbkpf.
DATA: END OF tbkpf.
---- Constants -
CONSTANTS: awtyp_bkpf TYPE awtyp VALUE 'BKPF '.
CONSTANTS: awtyp_space TYPE awtyp VALUE ' '.
Selection Screen
PARAMETER: funcl LIKE t020-funcl NO-DISPLAY. "P(ost),D(isplay),U(pd)
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS:
p_bukrs FOR vbkpf-bukrs,
p_belnr FOR vbkpf-belnr,
p_gjahr FOR vbkpf-gjahr,
p_budat FOR vbkpf-budat,
p_bldat FOR vbkpf-bldat,
p_blart FOR vbkpf-blart,
p_xblnr FOR vbkpf-xblnr,
p_bktxt FOR vbkpf-bktxt,
p_usnam FOR vbkpf-usnam.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK blk
WITH FRAME TITLE text-010 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-002.
PARAMETER norm_doc TYPE c
RADIOBUTTON GROUP doc DEFAULT 'X' .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-001.
PARAMETER ad_doc TYPE c
RADIOBUTTON GROUP doc .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(35) text-003.
PARAMETER all_doc TYPE c
RADIOBUTTON GROUP doc .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK blk.
CLASS lcl_event_receiver DEFINITION
For capturing events on the ALV *
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
to capture all recently changed data.
handle_data_changed FOR EVENT data_changed OF
cl_gui_alv_grid
IMPORTING er_data_changed,
for hot spot
handle_hotspot FOR EVENT hotspot_click OF
cl_gui_alv_grid
IMPORTING e_column_id e_row_id.
ENDCLASS. " lcl_event_receiver (Definition)
CLASS lcl_event_receiver (Implementation)
For capturing events on the ALV *
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM f2200_handle_data_changed USING er_data_changed.
ENDMETHOD.
METHOD handle_hotspot.
PERFORM f2201_handle_hotspot USING e_column_id e_row_id .
ENDMETHOD.
ENDCLASS. " lcl_event_receiver (Implementation)
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
START-OF-SELECTION
START-OF-SELECTION.
---- Colors -
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
-------------------- Status und Title Bar----------------------------*
SET PF-STATUS funcl.
SET TITLEBAR funcl.
-- Read Records--
SELECT * FROM vbkpf INTO TABLE gt_vbkpf1
WHERE bukrs IN p_bukrs
AND ausbk IN p_bukrs
AND belnr IN p_belnr
AND gjahr IN p_gjahr
AND budat IN p_budat
AND bldat IN p_bldat
AND blart IN p_blart
AND bktxt IN p_bktxt
AND xblnr IN p_xblnr
AND usnam IN p_usnam
AND bstat EQ 'V'
AND ( awtyp IN (awtyp_bkpf, awtyp_space) OR
awtyp IS null )
ORDER BY PRIMARY KEY.
----Call the ALV Screen -
PERFORM alv_display.
END-OF-SELECTION.
FORM BELEG_PICKUP *
Indicate changing of the selected external record *
FORM beleg_pickup.
SET PARAMETER ID 'BUK' FIELD vbkpf-bukrs.
SET PARAMETER ID 'GJR' FIELD vbkpf-gjahr.
SET PARAMETER ID 'BLP' FIELD vbkpf-belnr.
CASE funcl.
WHEN 'P'.
IF anzkr IS INITIAL.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_D'
EXPORTING
bukrs = vbkpf-bukrs
belnr = vbkpf-belnr
gjahr = vbkpf-gjahr.
ELSE.
IF sy-ucomm EQ 'BUCH'.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_ALL'
EXPORTING
synch = char_x
bupbi = xbinp
TABLES
t_vbkpf = tbkpf.
ELSE.
CALL FUNCTION 'ZPRELIMINARY_POSTING_POST_ALL'
EXPORTING
bupbi = xbinp
TABLES
t_vbkpf = tbkpf.
wait up to 3 seconds.
commit work.
ENDIF.
ENDIF.
WHEN OTHERS.
IF sy-tcode = 'ZPPD'.
funcl = 'P'.
ENDIF.
CALL FUNCTION 'ZPRELIMINARY_POSTING_DISPLAY'
EXPORTING
bukrs = vbkpf-bukrs
belnr = vbkpf-belnr
gjahr = vbkpf-gjahr.
ENDCASE.
ENDFORM.
FORM TBKPF_FUELLEN *
Include records for posting in TBKPF *
FORM tbkpf_fuellen.
records = 'X'.
LOOP AT gt_vbkpf.
IF gt_vbkpf-xpick = 'X'.
CLEAR anzkr.
CLEAR records.
IF sy-subrc = 0.
anzkr = anzkr + 1.
MOVE-CORRESPONDING gt_vbkpf TO tbkpf.
APPEND tbkpf.
ELSE.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM.
FORM MALL *
Select All documents *
FORM mall.
LOOP AT gt_vbkpf.
gt_vbkpf-xpick = 'X'.
MODIFY gt_vbkpf.
ENDLOOP.
refresh = 'X'.
CALL METHOD grid1->refresh_table_display.
ENDFORM.
FORM EMAL *
Unselect all documents *
FORM emal.
LOOP AT gt_vbkpf.
gt_vbkpf-xpick = ' '.
MODIFY gt_vbkpf.
ENDLOOP.
refresh = 'X'.
CALL METHOD grid1->refresh_table_display.
ENDFORM.
Form alv_display *
To display the details on an ALV. *
FORM alv_display.
CALL SCREEN 100.
ENDFORM. " alv_display
*& Module PB0_100 OUTPUT
MODULE pb0_100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'POSTDOC'.
--To verify that posting is complete.--
---- Setting the layout -
IF grid1 IS INITIAL.
PERFORM fill_table.
-- Initializing the field catalog--
PERFORM fieldcat_init CHANGING i_fieldcat.
-- Initializing the ALV GRID and CONTAINER--
CLEAR gs_layout.
gs_layout-info_fname = 'linecolor'.
gs_layout-grid_title = 'Parked Documents'(100).
gs_layout-zebra = 'X'.
gs_layout-cwidth_opt = 'X'.
gs_layout-sel_mode = 'A'.
gs_layout-edit = 'X'.
l_layout-report = sy-repid.
------ Create a custom container control for ALV Control----
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT grid_container
EXPORTING
dynnr = '100'
ratio = '100'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc NE 0.
MESSAGE i000 WITH text-007. " Error in object creation
LEAVE LIST-PROCESSING.
ENDIF.
-- Create an instance of alv control--
CREATE OBJECT grid1
EXPORTING
i_lifetime = 1
i_parent = grid_container.
---- Disable all unwanted button in the ALV grid -
PERFORM disable_functions TABLES i_excl_func.
---- Call the display function of ALV grid -
CALL METHOD grid1->set_table_for_first_display
EXPORTING
is_variant = l_layout
i_save = 'A'
is_layout = gs_layout
is_print = ls_prnt
it_toolbar_excluding = i_excl_func
CHANGING it_outtab = gt_vbkpf[]
it_fieldcatalog = i_fieldcat.
ENDIF. " IF cl_gui_alv_grid=>offline IS INITIAL
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
---- Create a reciever object to handle events -
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_data_changed FOR grid1.
SET HANDLER event_receiver->handle_hotspot FOR grid1.
CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid1.
ENDIF. " IF grid1 IS INITIAL.
ENDMODULE. " PB0_100 OUTPUT
*& Form fill_table
Fills the data table to be passed to the ALV grid.
FORM fill_table.
LOOP AT gt_vbkpf1.
MOVE-CORRESPONDING gt_vbkpf1 TO gt_vbkpf.
IF ad_doc = 'X' OR all_doc = 'X'.
thead-tdobject = 'BELEG'.
CONCATENATE gt_vbkpf1-bukrs
gt_vbkpf1-belnr
gt_vbkpf1-gjahr INTO thead-tdname.
thead-tdspras = sy-langu.
thead-tdid = '0004'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_code = inline-tdline.
REFRESH inline.
CLEAR inline.
thead-tdid = '0005'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_rsn = inline-tdline.
REFRESH inline.
CLEAR inline.
thead-tdid = '0006'.
PERFORM read_text.
READ TABLE inline INDEX 1.
gt_vbkpf-rev_date = inline-tdline.
REFRESH inline.
CLEAR inline.
REFRESH inline.
CLEAR inline.
ENDIF.
APPEND gt_vbkpf.
CLEAR gt_vbkpf.
ENDLOOP.
ENDLOOP.
ENDFORM.
*& Form fieldcat_init
Initialize the field catalog
FORM fieldcat_init CHANGING i_fieldcat TYPE lvc_t_fcat.
DATA: i_fldcat TYPE lvc_t_fcat WITH HEADER LINE.
CHECKBOX
CLEAR i_fldcat.
i_fldcat-fieldname = 'XPICK'.
i_fldcat-checkbox = 'X'.
i_fldcat-key = 'X'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-outputlen = '4'.
i_fldcat-scrtext_l = 'ChkB'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BELNR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-hotspot = 'X'.
i_fldcat-outputlen = '15'.
i_fldcat-scrtext_l = 'Document Number'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'GJAHR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'FYear'.
i_fldcat-outputlen = '5'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BUKRS'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'CCode'.
i_fldcat-outputlen = '5'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BLART'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Type'.
i_fldcat-outputlen = '6'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BLDAT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Doc Date'.
i_fldcat-outputlen = '12'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BUDAT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Park Date'.
i_fldcat-outputlen = '12'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'BKTXT'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Document Header Text'.
i_fldcat-outputlen = '25'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'WAERS'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Curr'.
i_fldcat-outputlen = '7'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'USNAM'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Parked By'.
i_fldcat-outputlen = '13'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'XBLNR'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Reference Text'.
i_fldcat-outputlen = '19'.
APPEND i_fldcat TO i_fieldcat.
IF ad_doc = 'X' OR all_doc = 'X'.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_CODE'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'RC'.
i_fldcat-outputlen = '2'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_RSN'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Rev Reason'.
i_fldcat-outputlen = '15'.
APPEND i_fldcat TO i_fieldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'REV_DATE'.
i_fldcat-tabname = 'GT_VBKPF'.
i_fldcat-key = 'X'.
i_fldcat-scrtext_l = 'Rev Date'.
i_fldcat-outputlen = '10'.
APPEND i_fldcat TO i_fieldcat.
ENDIF.
ENDFORM. " fieldcat_init
*& Module PAI_100 INPUT
MODULE pai_100 INPUT.
CASE ok_code.
WHEN 'BACK'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'EXIT'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN '%EX'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'BINP'.
DATA : ws_x TYPE c VALUE 'X'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Posting Documents Via Batch Input'
text_question =
'Are you sure you want to post all the selected documents?'
text_button_1 = 'Yes'
text_button_2 = 'No'
start_column = 25
start_row = 6
IMPORTING
answer = ans.
IF ans = '1'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
xbinp = 'X'.
PERFORM tbkpf_fuellen.
IF records = 'X'.
MESSAGE s999(zv) WITH text-007.
ELSE.
PERFORM beleg_pickup.
ENDIF.
ENDIF.
WHEN 'MALL'.
PERFORM mall.
WHEN 'EMAL'.
PERFORM emal.
WHEN 'RW'.
IF sy-dynnr = '1000'.
PERFORM exit_program.
ELSEIF sy-dynnr = '0100'.
LEAVE TO TRANSACTION 'ZPPD'.
ENDIF.
WHEN 'BUCH'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Posting Document'
text_question =
'Are you sure you want to post all documents selected?'
text_button_1 = 'Yes'
text_button_2 = 'No'
start_column = 25
start_row = 6
IMPORTING
answer = ans.
IF ans = '1'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
perform tbkpf_fuellen.
IF records = 'X'.
MESSAGE s999(zv) WITH text-007.
ELSE.
PERFORM beleg_pickup.
ENDIF.
ENDIF.
WHEN 'PICK'.
DATA : check TYPE n,
no_rec TYPE c.
check = 0.
no_rec = 'X'.
CALL METHOD grid1->check_changed_data
IMPORTING
e_valid = ws_x.
index = 0.
LOOP AT gt_vbkpf.
funcl = 'D'.
index = index + 1.
IF gt_vbkpf-xpick = 'X'.
check = 1.
CLEAR no_rec.
READ TABLE gt_vbkpf1 INDEX index INTO vbkpf.
PERFORM beleg_pickup.
ENDIF.
ENDLOOP.
IF check = 0.
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = ws_row_idx.
IF NOT ws_row_idx IS INITIAL.
CLEAR no_rec.
ENDIF.
LOOP AT ws_row_idx INTO i_ws_row_idx.
READ TABLE gt_vbkpf1 INDEX i_ws_row_idx-index INTO vbkpf.
PERFORM beleg_pickup.
ENDLOOP.
IF no_rec = 'X'.
MESSAGE s999(zv) WITH text-007.
ENDIF.
ENDIF.
WHEN '&RNT_PREV'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&RNT'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '%SC'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&OL0'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&OAD'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&AVE'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&AQW'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&XXL'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '%PC'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN '&CRTEMPL'.
CALL METHOD grid1->set_function_code
CHANGING c_ucomm = ok_code.
WHEN OTHERS.
do nothing.
ENDCASE.
CLEAR ok_code.
ENDMODULE. " PAI_100 INPUT
*& Form exit_program
Exits from the program after freeing the grid and container *
FORM exit_program.
IF NOT grid_container IS INITIAL.
CALL METHOD grid_container->free.
ENDIF.
IF NOT grid1 IS INITIAL.
CALL METHOD grid1->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
ENDIF.
LEAVE PROGRAM.
ENDFORM. " exit_program
*& Form f2200_handle_data_changed
To handle event of change in data in ALV.
-->P_ER_DATA_CHANGED text
FORM f2200_handle_data_changed USING ir_data_changed
TYPE REF TO
cl_alv_changed_data_protocol.
DATA : ls_mod_cell TYPE lvc_s_modi ,
lv_value TYPE lvc_value,
lflg_check TYPE i.
DATA : wa_vbkpf LIKE LINE OF gt_vbkpf.
SORT ir_data_changed->mt_mod_cells BY row_id .
LOOP AT ir_data_changed->mt_mod_cells
INTO ls_mod_cell
WHERE fieldname = 'I_PICK'.
IF NOT ls_mod_cell-value IS INITIAL .
CALL METHOD ir_data_changed->modify_cell
EXPORTING
i_row_id = ls_mod_cell-row_id
i_fieldname = ls_mod_cell-fieldname
i_value = ls_mod_cell-value.
READ TABLE gt_vbkpf INTO wa_vbkpf
INDEX ls_mod_cell-row_id.
IF ls_mod_cell-fieldname = 'I_PICK'.
wa_vbkpf-xpick = ls_mod_cell-value.
ENDIF.
MODIFY gt_vbkpf FROM wa_vbkpf
INDEX ls_mod_cell-row_id.
ENDIF .
ENDLOOP .
ENDFORM. " f2200_handle_data_changed
*& Form f2201_handle_hotspot
To handle event of clicking on hyperlink
-->P_E_COLUMN_ID text
FORM f2201_handle_hotspot USING p_e_column_id p_e_row_id.
READ TABLE gt_vbkpf1 INDEX p_e_row_id INTO vbkpf.
funcl = 'D'.
PERFORM beleg_pickup.
PERFORM exit_program.
ENDFORM. " f2201_handle_hotspot
Regards,
Susmitha
Dont forget to reward points for useful answers -
Urgent: Selection-screen within Form routines
Hi Experts,
Within Form routines can i declare selection-screen statements. If no how should i declare my objects on selection screen within form routines bcoz when i declared with selection screen statements within form routines iam getting the error as "Within FORM routines and function modules, the SELECTION-SCREEN statement is not allowed".
Regards.
AADI.Hi Aditya,
U cannot use the Selection-screen in Forms and Function Modules.
Try to use it in an include program and call it from ur program.
Reward if Helpful,
Jagadish. -
I have a cfform which contains a cfgrid and prior to the 9 to 10 update, upon submission of the cfform, the selected row of the grid was passed/posted to my form action page as:
__CFGRID__gridForm__renewalGrid
This contained all the data from the selected row, I.e.:
__CFGRID__COLUMN__=PROJECTID; __CFGRID__DATA__=T01081002AP; __CFGRID__COLUMN__=APPLICATIONS; __CFGRID__DATA__=PQFD; __CFGRID__COLUMN__=OWNERUID; __CFGRID__DATA__=HT2008; __CFGRID__COLUMN__=TEAM; __CFGRID__DATA__=Roberts; __CFGRID__COLUMN__=ROLE; __CFGRID__DATA__=AASBOAPMX; __CFGRID__COLUMN__=REGION; __CFGRID__DATA__=Southwest; __CFGRID__COLUMN__=EXISTING; __CFGRID__DATA__=K8045F; __CFGRID__COLUMN__=SOD; __CFGRID__DATA__=0; __CFGRID__COLUMN__=INITIALEMAILDATE; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=MESSAGEDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=SECONDEMAILDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=ESCALATIONDATE; __CFGRID__DATA__=; __CFGRID__COLUMN__=COMPLETEDBY; __CFGRID__DATA__=TH2878; __CFGRID__COLUMN__=COMPLETIONDATE; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MONTHPULLED; __CFGRID__DATA__=Jan2013; __CFGRID__COLUMN__=TOTALITEMS; __CFGRID__DATA__=2; __CFGRID__COLUMN__=RELIEVINGPSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=MODIFIEDBYTS; __CFGRID__DATA__=02/06/2013; __CFGRID__COLUMN__=MODIFIEDBY; __CFGRID__DATA__=T228Y8; __CFGRID__COLUMN__=CREATEDBY; __CFGRID__DATA__=KV3M36; __CFGRID__COLUMN__=CREATEDTS; __CFGRID__DATA__=01/28/2013; __CFGRID__COLUMN__=NEWSA; __CFGRID__DATA__=; __CFGRID__COLUMN__=DELEGATESTATUSNOTE; __CFGRID__DATA__=Access; __CFGRID__COLUMN__=STATUS; __CFGRID__DATA__=Completed; __CFGRID__COLUMN__=DATATYPE; __CFGRID__DATA__=Appl New
After upgrading to CF10, and with no changes to the code, performing this same process, __CFGRID__gridForm__renewalGrid is still passed in the form scope to my action page, but now it is empty.
I have not yet uninstalled CF9, so I brought it up on a different port, and I can run the same code as CF9 or CF10 and watch... in 9 the selected row is passed, in 10 it is empty.
Is this a bug? Is there a work around? Please help.appears that apple has changed SMB code, and now its not possible login from windows on mac.
i installed snow leopard and now works fine.
apple is capable to make it run paying new license of smb code, but isnted of this, apple has created new protocol smbx and now, all others need to adapt your code to apple..
bad movement.. i am thinking sell imac and no back to apple anymore.. -
How to Display my Form in the selection screen.(without print format)
Hi all,
I did one gate pass form and i want to view the form in my selection screen or output screen(just in monitor) as a display by giving one Z-code.
i.e, we can view the form thru Print preview...the same preview, i want to display after i give my parameter in the selection screen.
For example.ZGPOUT if i enter as a t-code.
it should ask my Gate Pass number in the Selection screen...if its right then my Form will come out to the display screen. (instead of going by Print method).,
Pls post ur comment and reply me with examples,if possible.
thanks & regards
sankar.Hi Prasad,
Pls refer the below link.
<< Moderator message - Point begging removed >>
http://wiki.sdn.sap.com/wiki/display/Snippets/Displayimagesontheselection-screen
Thanks
Arjun
Edited by: Rob Burbank on Aug 17, 2011 2:24 PM -
The Control A key is not working. I cannot multi-select my songs. I'm not sure if it is the problem with iTunes 10.6.1.7 or my PC settings encounter issues. Also, i cannot find Album Artwork online using iTunes and i cannot select any view form but List.
The Control A key is not working. I cannot multi-select my songs. I'm not sure if it is the problem with iTunes 10.6.1.7 or my PC settings encounter issues. Also, i cannot find Album Artwork online using iTunes and i cannot select any view form but List.
-
Populating other fields in a form based on the selection in a combobox field
We have done a form(masterdetail) in which we have a combobox field.When we make a selection in the field we require some two other fields to be automatically populated retrieving data from a table(which has the details required) based on the selection made.For eg. Selecting emp id(combobox) should populate empname and salary automatically in the form.Is this possible?If so how can this be done?
Thanks & Regards,
Jayanthi.SThis is what I did following Michael's suggestion and it works fine :-
1> Created a dynamic LOV named LOV_EMPNO as:-
select empno,empno from scott.emp
2> Started creating a form named FORM024_EMP2 on scott.emp.
3> On reaching the Formatting and Validation section, I chose the EMPNO field in the left frame.
In the right frame for EMPNO, I changed the item-type to Combobox and selected the lov LOV_EMPNO.
Then I went to the Javascript handler section for EMPNO, chose the Javascript event onChange and in the
adjacent Textarea, I wrote:-
popdetails(this);
We will create the javascript function popdetails() in the Additional pl/sql section.
4> Click next and goto the Additional PL/SQL section and I wrote the following code in
"...after displaying the page" area.
(You can write this either in
before displaying the page,
before displaying the form,
after displaying the form,
after displaying the page).
declare
type tvcarr is table of varchar2(2000) index by binary_integer;
l_empno_arr tvcarr;
l_ename_arr tvcarr;
l_sal_arr tvcarr;
begin
select empno,ename,sal
bulk collect into
l_empno_arr,l_ename_arr,l_sal_arr
from scott.emp;
htp.p('
<script>
var empdets = new Array();
empdets[0] = new Array("","");
for i in 1..l_empno_arr.count
loop
htp.p('empdets['||l_empno_arr(i)||'] = new Array("'||l_ename_arr(i)||'","'||l_sal_arr(i)||'");');
end loop;
htp.p('
function popdetails(ele)
var val = new Number();
var thisform = ele.form;
val = parseInt(ele.value);
if (isNaN(val))
val = 0;
for (var i = 0; i < thisform.length; i++){
if (thisform.name == "FORM024_EMP2.DEFAULT.ENAME.01")
thisform[i].value = empdets[val][0];
else if(thisform[i].name == "FORM024_EMP2.DEFAULT.SAL.01")
thisform[i].value = empdets[val][1];
htp.p('</script>');
end; -
User exit/BADI required for coding for the selection custom fields in RSA3
Hi,
I have a requirement in the Datasource extractor. I need to add custom Z fields in the Data souce of the 2LIS_02_SCL and need to include in the selection part. So I have added the custom filed in the append structure and include the check in the selection checkbox in the transaction LBWE under the datasource specified above. For the corresponding custom fields, to be populated in the ALV list, I have written the code in corresponding user exit ZXRSAU01.
Now I can view my custom Z fields in the list as well as on the selection fileds while executing the transaction RSA3. But I need to write code for the selection criteria part. On entering value in the selection criteria of my custom z field, no values are selected to the corresponding query. Please let me know where should i write the coding part for the selection criteria of the Z fields for the Datasource.
On debugging, to my understanding only the standard fields are alone getting filtered by providnig the values in the selection part of the RSA3 tcode. It is called in Macros : Sel < Datasorce> .... and the fetch cursor is included inside the macros.
Please let me know any user exits or Badi;s available for it.
Thanks in advanceHi shivu,
you might try the BAdI RSU5_SAPI_BADI. A good introduction can be found in the following document:
[Enhancing DataSources with BAdI RSU5_SAPI_BADI|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/3001894b-b1fb-2910-77ba-e80b6f2053b7]
The BAdI is called at the time of extraction, so this would be the right place to populate your additional fields.
Best,
Chris -
How to show the SELECT result in a certain form?
Hallo,
I have the folling problem:
CREATE TABLE buildings (
building VARCHAR2(20) NOT NULL,
city VARCHAR2(20) NOT NULL,
no_of_buildings NUMBER NOT NULL);
Now I make a SELECT * FROM buildings:
building city no_of_buildings
School Rome 20
School Paris 30
Cinema New York 15
Theater London 10
Theater Rome 7
But I need the SELECT result in this form:
Rome Paris New York London
School 20 30 null null
Cinema null null 15 null
Theater 7 null null 10
Is this possible?
Thank you
WernerSorry,
my request is not formatted well. I try again:
Hallo,
I have the folling problem:
CREATE TABLE buildings (
building VARCHAR2(20) NOT NULL,
city VARCHAR2(20) NOT NULL,
no_of_buildings NUMBER NOT NULL);
Now I make a SELECT * FROM buildings:
building city no_of_buildings
School Rome 20
School Paris 30
Cinema New York 15
Theater London 10
Theater Rome 7
But I need the SELECT result in this form:
Rome Paris New York London
School 20 30 null null
Cinema null null 15 null
Theater 7 null null 10
Is this possible?
Thank you
Werner -
"The selected cells are read-only" error on Custom Field when trying to insert in Datasheet mode
I have a custom field that works completely fine. Yesterday our QA team found out that when trying to insert in Datasheet format, the error "The selected cells are read-only" was thrown. Any ideas? I tried passing the following property to my fldtypes_field.xml file:
<Field Name="ReadOnly">FALSE</Field>
No luck.Victor PalmaUnfortunately it did not work. I also developed the code and access the field and checked its property called "ReadOnlyField" which is already set to false.
Below is the xml that i am using. Can you please share the xml that you had used?
<?xml version="1.0" encoding="utf-8"?>
<FieldTypes>
<FieldType>
<Field Name="TypeName">MyCustomField</Field>
<Field Name="ParentType">Text</Field>
<Field Name="TypeDisplayName"> My Custom Field</Field>
<Field Name="TypeShortDescription"> My Custom Field</Field>
<Field Name="AllowBaseTypeRendering">True</Field>
<Field Name="ReadOnlyField">False</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="ShowInListCreate">TRUE</Field>
<Field Name="ShowInSurveyCreate">TRUE</Field>
<Field Name="ShowInDocumentLibraryCreate">TRUE</Field>
<Field Name="ShowInColumnTemplateCreate">TRUE</Field>
<Field Name="FieldTypeClass">My Assembly Information goes here</Field>
</FieldType>
</FieldTypes> -
Retrieve the sales orders for a particular customer in selection screen
Hi
I want to retrieve the sales orders for a particular customer(entering customer number field in the selection screen and then clicking on f4 help on sales order field in the selection screen I should get only sales order numbers for that particular customer number).How can I achieve this through search helps?Are there any standard search helps that I can use.
<removed_by_moderator>
Edited by: Julius Bussche on Apr 9, 2009 12:55 PMHi,
try this:
at selection-screen on value-request for p_par.
select * from vbak
into itab
where kunnr = p_par.
then use the FM 'F4IF_TABLE_VALUE_REQUEST'.
with
retfield = 'VBELN'
dynprog = sy-repid
dynpnr = sy-dynnr
dynprofield = <name of parameter>
value_org = 'S'
tables = itab.
Regards,
Leo. -
Disable the email client selection prompt for forms
Hello,
I am wondering if you might help me. When hitting the "email to" button in a pdf form, by default the select email client window pops up.
I have been searching in vain (sofar) to prevent this window from appearing in the first place (at first launch Adobe).
I know I can check the "don't show again" checkbox from within the dialog box, but I don't want the dialog box to appear in the first place, because I don't want users to see it at first launch of Reader and don't want to have to manually (let the users) check the "don't show again" checkbox. I need to be able to deploy this settings (the mail client selection window to NOT show up) to over 100 users.
Here is what I have tried sofar.
Using free registry snapshot tool Registry Watch, I have identified the keys HKEY_Local_Machine\software\Microsoft\windows\Currentversion\Installer\Userdata\S-1-5-18\ Products\90401210900063d11c8ef10054038389c\usage\OutlookMapi2
and HKEY_Local_Machine\Software\Microsoft\Cryptography\RNG as changing keys whenever I turn on and off the show this dialog box.
However, both keep changing to completely new values.
If I manually enter the values of these keys to how they were when the dialog box was not displayed, it still keeps displaying the window. So it is not possible to hardcode these keys with a fixed value.
When I turn the dialog box back on, the keys HKEY_USERs\"user"\software\Adobe\Acrobat Reader\9.0\AValert , HKEY_USERs\"user"\software\Adobe\Acrobat Reader\9.0\AValert\cCheckbox are deleted, but when I turn the dialog box off again from within Reader
these keys don't return anymore.....
So it is difficult to pinpoint a specific (set of) key(s) and particular values.
Also disabling and enabling send mail api from within Reader, but this didn't help either (needed for email client to work from Reader in the first place).
Looked for xml's or ini that might change after enabling or disabling the prompt, but none found, neither in my profile, nor all users profile, nor C:\Program Files\Adobe\....
Any feedback wold be much appreciated.Try making sure your default email program is set under Edit > Preferences > Internet category > Internet Settings ...Programs tab in Acrobat.
You can also try doing a Help > Repair Acrobat installation since you installed Outlook after installing Acrobat. -
Can we have the 'select list with submit' type within a tabular form?
An item can be the "Select list with submit' type so a form has no problem with it. However, when I built a tabular form manually, I couldn't find this type. There are only three types avaiable: "named", "static", and "dynamic".
Is it possible to have the "submit" type so columns of the tabular form can be dynamically rendered based on the user inputs?
Another question I have is how to dynamically build the tabular form with decode func. For example, if the value of col_1 is 'val_1', then build a select list in col_2; otherwise null in col_2.
I tried to use
select col1,
decode (col1, 'val_1', select htmldb_item.select_list_from_lov(2, first, 'lov1') from dual, null)
from....
where....
But it didn't work.
I'd like to know whether it's feasible to have something like that.
TIA.
Message was edited by:
LucYou could use a region of type PL/SQL function
returning SQL query to dynamically build this kind of
tabular form. However if you want to use the built-in
multi-row insert, update and delete processes, all
items in a column must have the same display type. Marc, thanks for the quick reply. I appreciate it.
I got your idea. However, I need to have the javascript 'ToggleAll' as the heading so the form works as same as the built-in one. If I put the query definition into a pl/sql procedure, where I can put this html tab attribute? It can not be inside the checkbox function, otherwise the checkbox of any row would act as same as the header.
I hope I've made this clear.
To Vikas: It's our clients who want this, not us. :( -
Count the number of days in the selected range using Customer exit
Hi Experts,
we have requirment where user is asking to add a column to report, which will have 'count of days for which key figure is having values' for each of the months and the Header would be 'Day Count'
Please let me know if its possible using Customer exit?Hi,
In our report we have two characteristics site no. and product and we have 6 key figures of type quantity and Input for the report is Fiscal year/period
So in the report Key figures are populated with values for respective site no. and product combination
Now the user wants new column in report which will have header u2018Day countu2019 and it should Simply count the number of days in the selected range that have a volume different than 0 for key figure
Please let me know if more details are required -
Dynamically change the value of a select list in form based on a table
Hi Friends,
I am using a form based on a table. I want to display two fields as select lists instead of text boxes and when a value
in a select list is selected, the corresponding values will be listed in the next select list. For example if department
value is selected in a select list the employees in that department will be listed in the employee select list. I saw a
metthod using ajax for achieving this in tabular form in Denes's sample application[Click Here| http://apex.oracle.com/pls/otn/f?p=31517:176:462842537250908::NO] .
Is there any way to achieve the same for a form based on a table,
Thanks,
TjHi Andy,
Could you tell me how I could use your example with multiple Application Items?
My page has 3 cascading select lists. The second is dependent on the first and the third is dependent on both the first and second. I thought I would just need to add the second application item as a get, but not sure what the syntax would be. I have troubleshooted to the point where my select list refreshes when I have one in the javascript...just not sure how to add the additional one?
Here's what I have (I have been referencing your 'Get Employees' page)
My Page Items:
P0_VENDOR_ID
P0_VENDOR_SITE_ID
P0_INVENTORY_ITEM_ID
My Application Items:
F_VDR_ID
F_VDR_SITE_ID
My query in the application process has both F_VDR_SITE_ID and F_VDR_ID in it.
My javascript function...this worked OK until I added the additional get.add('F_VDR_SITE_ID')
function getItems(filter, listName)
var xml = null;
var list = document.getElementById(listName);
var listvalue = list.value;
var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=Set_Items',4);
get.add('F_VDR_ID', filter.value);
get.add('F_VDR_SITE_ID', filter.value);
ret = get.get('XML');
if(ret)
var s = ret.getElementsByTagName("select");
if(s){
var o = ret.getElementsByTagName("option");
var oCount = o.length;
list.options.length = 0;
for(var i = 0; i < oCount; i++){
var l_Opt_Xml = o;
appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue);
list.value = listvalue;
if (list.selectedIndex == -1)
list.selectedIndex = 0;
get = null;
Thanks,
Janel
Maybe you are looking for
-
Hi I can't deploy anymore in the NWDS. what is changed Sep 11, 2006 4:09:38 PM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] INFO: [009]Additional log information about the deployment <!LOGHEAD
-
Iirig mic- hear what you speak in the real time
Hi, i wonder if i can actualy hear what the person speakig in to the irig mic says I tried it in camera app but it just doesnt work iRig microphone u can connect with 3,5 jack and then you can plug in Headphones but i cant hear anything in camera ap
-
Request Product Service Form Broken...
I know that this may not be the right forum, but I can't find one that fits. Of course, my ipod 20gig has stopped working. Right now I am trying to fill out a Request Product Service form and it's broken! Whenever I try to put in my postal code, it k
-
Problem in fetching row code...
Hi there, I have a bit of a problem setting up automatic row processing. The Apex processing is causing an error, but I'm not sure what PL/SQL code is being run (obviously, I don't have access to the Apex code) and all I get is the error following: 0
-
Does anyone have any experience with publishing Arabic Books on iBooks? Is it even possible to change the 'flip' from rgith to left?