Checkbox in an Updatable Report
How can I use a checkbox to display checked for 'T' and unchecked for anything else in a report based on an SQL Query?
How can I use the checkbox in the report to set the value in the field in the table in an MRU?
Can this be done the same way as if I used a Text Field, as opposed to some extra coding to make it work?
Thanks all,
Gregory
Thanks Arie. I was really hoping there was a simpler way, but apparently not. Vikas put it quite succinctly in:
Re: Change text Item into Check Box in a Tabular Form
Gregory
Similar Messages
-
Checkboxes - htmldb_item.checkbox multi-record updatable report
htmldb_item.checkbox can be used to display retrieved database values as a check box (e.g. a Y/N Flag).
These can also be added to an updateable report in a multi-record tab.
When a new record is created on the multi-row tab however there appears to be no way to render a checkbox. Instead a text box appears instead.
Is there any way to acheive this?
This data needs to be present in a multi -row layout
Thanks
BTW - I have checked the docos and read the forums.Firstly, thank you for the reply.
I must clarify what I am doing.
I have a table that has a column in it that is called ZEROFUEL. This can have a value of either Y or N. The user wants a block of these records (say eight) per screen. This column need to be represented by a checkbox. I manage this by calling the NVL(htmldb_item.checkbox(10,ID, DECODE (ZEROFUEL,'Y','CHECKED')),'N')ZEROFUEL, in the report select statement.
The automatic checkbox (for deletion) is added by the wizard no problem. It is the checkbox for the column ZEROFUEL I am having the problem with.
If I do not render the checkbox from the sql select then the wizard just creates a little text field display.
Everything works fine until I press the ADD button. A new record pops up on the bottom of the block with no checkbox on the ZEROFUEL column.
Eventually there are four columns I need to display as a checkbox. These all need to be displayed in the multi-record tab.
Am I missing something.
Thanks -
Checkbox cant be updated in ALV Grid
Hi in my requirement, ALV Grid contains checkbox, when I check that, the internal table for checkbox is not updated.
In code I am writting:
Final Internal Tbale:
Data: BEGIN OF T_FINAL occurs 0,
CHK_BOX,
END OF T_FINAL.
LS_FIELDCAT-TABNAME = t_final.
LS_FIELDCAT-COL_POS = 1.
LS_FIELDCAT-FIELDNAME = 'CHK_BOX'.
LS_FIELDCAT-SELTEXT_S = check box.
LS_FIELDCAT-INPUT = 'X'.
LS_FIELDCAT-OUTPUTLEN = 1.
LS_FIELDCAT-CHECKBOX = 'X'.
LS_FIELDCAT-EDIT = 'X'.
APPEND LS_FIELDCAT TO LT_FIELDCAT.
CLEAR LS_FIELDCAT.
DATA: I_CHECK TYPE TABLE OF T_FINAL,
WA_CHECK TYPE T_FINAL.
LOOP AT I_FINAL INTO WA_FINAL.
IF WA_FINAL-CHK_BOX = 'X'.
APPEND WA_FINAL TO I_CHECK.
{ APPEND WA_FINAL TO I_CHECK[] also I try}
ENDIF.
ENDLOOP.
In layout:
LS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
LS_LAYOUT-BOX_FIELDNAME = 'CHK_BOX'.try this its working for me......
*& Report ZHR_REPT_EMP_NOT_PBOOKED
*& Program title: List of employees who have not done Pre-Booking and
Provision to send E mail to such employees
*& Description: To display a list of emloyees in report and then sending mails to them
*& Business analyst: Vinay Kale/Abhijeet More
*& Developed by: Vivek Jain
REPORT ZHR_REPT_EMP_NOT_PBOOKED.
TYPE-POOLS slis.
tables
TABLES: pernr,
pa0001,
hrp1001,
hrp1000,
zodtab,
zcstab,
zsbutab.
Infotypes
INFOTYPES :0001, "org assignment,
1001,
1000,
0105.
TYPES : BEGIN OF i_conf,
checkbox ,
pernr TYPE pa0001-pernr, "personnel Number.
ename TYPE pa0001-ename, "Name of Employee.
zzbtc TYPE pa0001-zzbtc, "Band.
btrtl TYPE pa0001-btrtl, "Grade
Location type string,
persk type string,
ptext type string,
werks TYPE p0001-werks,
zzod_txt type string, "OD name
zzod type pa0001-zzod,
zzcs type string, "cluster/sector
vertical type string,
sbu LIKE pa0001-zzsbu, "SBU
sbutxt LIKE zsbutab-zsbutxt, "SBUTXT
orgeh LIKE pa0001-orgeh, "Vertical
org_text type string,
zzbloc LIKE pa0001-zzbloc, "base location
dept_loc type string, "dept loc
ename_s LIKE pa0001-ename, "Department
zztc LIKE pa0001-zztc,
endda type p0001-endda,
celltab type lvc_t_styl,
tc_name type string,
tc_num type string,
END OF i_conf.
DATA : it_conf TYPE STANDARD TABLE OF i_conf WITH HEADER LINE,
wa_conf TYPE i_conf.
*data: begin of gs_outtab.
*data: checkbox type c. "field for checkbox
§B1.Extend your output table by a field to dis- or enable
cells for input.
*data: celltab type lvc_t_styl. "field to switch editability
include structure i_conf.
*data: end of gs_outtab.
*data: gt_outtab type gs_outtab occurs 0 with header line.
*& DATA DECLARATION FOR EMAIL
DATA: docdata TYPE sodocchgi1,
objpack TYPE STANDARD TABLE OF sopcklsti1 WITH HEADER LINE,
objhead TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
objtxt TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
objbin TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
reclist TYPE STANDARD TABLE OF somlreci1 WITH HEADER LINE.
DATA: tab_lines TYPE sy-tabix.
DATA : p_1001 TYPE TABLE OF p1001 WITH HEADER LINE.
DATA : p_0001 TYPE TABLE OF p0001 WITH HEADER LINE.
DATA : p_0105 TYPE TABLE OF p0105 WITH HEADER LINE.
DATA : od TYPE p0001-zzod.
DATA : new_pernr type p0001-pernr.
DATA : pernr_s type p0001-pernr.
DATA : email_s type p0105-USRID_LONG.
DATA : email type p0105-USRID_LONG.
DATA : tc_name type string.
DATA : tc_num type string.
DATA : emails type string.
DATA : sel_all type string.
DATA: REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA : flag type i.
DATA : title TYPE string.
DATA : pernr_temp tYPE p0001-pernr.
DATA : rel type string.
DATA : stat type string.
DATA : count type i.
DATA : v_dynnr type sy-dynnr.
DATA : g_grid type ref to cl_gui_alv_grid.
DATA : g_custom_container type ref to cl_gui_custom_container,
g_container type scrfname value 'CC'.
************field cat*******************************
DATA: fieldcat TYPE lvc_t_fcat,
wa_fieldcat LIKE LINE OF fieldcat.
DATA: gd_layout TYPE lvc_s_layo,
gd_repid TYPE sy-repid.
DATA:gt_events TYPE slis_t_event,
gt_list_top_of_page TYPE slis_t_listheader.
DATA rec_fetched TYPE sy-tabix.
CONSTANTS g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_zzod FOR zsbutab-zod NO INTERVALS ,
s_btrtl FOR pa0001-btrtl NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
start-of-selection.
if pn-begda is initial.
pn-begda = '18000101'.
endif.
if pn-endda is initial.
pn-begda = '99991230'.
endif.
clear : it_conf,it_conf[].
get pernr.
clear new_pernr.
move pernr-pernr to new_pernr.
*************checking whether employee has booked or prebooked for any event***************
clear: p_1001,p_1001[].
perform read_info tables p_1001 using new_pernr '1' 'B027' .
IF SY-SUBRC <> 0.
clear: p_1001,p_1001[].
perform read_info tables p_1001 using new_pernr '1' 'B023' .
IF SY-SUBRC <> 0.
clear: p_1001,p_1001[].
perform read_info tables p_1001 using new_pernr '2' 'B027' .
IF SY-SUBRC <> 0.
clear: p_1001,p_1001[].
perform read_info tables p_1001 using new_pernr '2' 'B023' .
IF SY-SUBRC <> 0.
clear : p_0001,p_0001[].
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = new_pernr
infty = '0001'
BEGDA = pn-begda
ENDDA = pn-endda
TABLES
infty_tab = p_0001
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
sort p_0001 descending by begda.
read table p_0001 index 1.
move p_0001-pernr to wa_conf-pernr.
move p_0001-ename to wa_conf-ename.
move p_0001-zzbtc to wa_conf-zzbtc.
move p_0001-btrtl to wa_conf-btrtl.
move p_0001-werks to wa_conf-werks.
move p_0001-zzsbu to wa_conf-sbu.
move p_0001-orgeh to wa_conf-orgeh.
move p_0001-zzbloc to wa_conf-zzbloc.
move p_0001-zztc to wa_conf-zztc.
move p_0001-zzod to wa_conf-zzod.
move p_0001-endda to wa_conf-endda.
move p_0001-btrtl to wa_conf-btrtl.
***************************sending mail to employee and his/her superior***********************************
select single sachn telnr into (wa_conf-tc_name , wa_conf-tc_num) from t526
where SACHX = it_conf-zztc
and werks = it_conf-werks .
**************clustor txt*********************
select single zcstxt into wa_conf-zzcs from zcstab
where zcs = p_0001-zzcs
and zod = p_0001-zzod.
**********operating division******************************
select single ZODLTXT into wa_conf-zzod_txt from zodtab
where zod = wa_conf-zzod.
**********sbu txt**************************************************************
select single zsbutxt into wa_conf-sbutxt from zsbutab
where zsbu = wa_conf-sbu.
**********location*************************************
select single btext into wa_conf-location from t001p
where btrtl = wa_conf-btrtl
and werks = wa_conf-werks.
**********Dept********************************************
select single orgtx into wa_conf-org_text from t527x
where sprsl = 'EN'
and orgeh = wa_conf-orgeh
and begda <= p_0001-begda
and endda >= p_0001-begda.
**************grade*****************************************
SELECT SINGLE ptext FROM t503t INTO wa_conf-persk
WHERE sprsl = 'EN'
AND persk = p_0001-persk .
*******************vertical****************************
select single zverttxt into wa_conf-vertical from zvtab
where zvert = p_0001-zzvert.
*******deputation location*****************
if p_0001-ZZDEPFLG = 'X'.
select single zdltxt into wa_conf-dept_loc from zdltab where zdl = p_0001-zzdploc.
endif.
***get imm superior
CALL FUNCTION 'ZHR_GET_IMMMED_SUPERIOR'
EXPORTING
pernr = new_pernr
begda = '18000101'
endda = '99991231'
IMPORTING
v_pernr = pernr_s
EXCEPTIONS
not_found = 1
OTHERS = 2.
if sy-subrc = 0.
find the email of the immed. superiors personal number..
clear : p_0001,p_0001[].
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr_s
infty = '0001'
BEGDA = pn-begda
ENDDA = pn-endda
TABLES
infty_tab = p_0001
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
read table p_0001 index 1.
move p_0001-ename to wa_conf-ename_s.
endif.
if wa_conf-btrtl in s_btrtl and wa_conf-zzod in s_zzod .
append wa_conf to it_conf.
endif.
endif.
endif.
endif.
endif.
clear wa_conf.
end-of-selection.
if it_conf[] is initial.
MESSAGE i501(zmod).
exit.
endif.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'USER'.
SET TITLEBAR 'xxx'.
if g_custom_container is initial.
data: lt_exclude type ui_functions.
create object g_custom_container
EXPORTING
container_name = g_container.
create object g_grid
EXPORTING
i_parent = g_custom_container.
perform fieldcat_build .
Exclude all edit functions in this example since we do not need them:
perform exclude_tb_functions changing lt_exclude.
perform build_data.
*§ B3.Use the layout structure to aquaint additional field to ALV.
gd_layout-stylefname = 'CELLTAB'.
PERFORM build_layout.
if it_conf[] is initial.
MESSAGE i501(zmod). "No data exists
else.
call method g_grid->set_table_for_first_display
EXPORTING
is_layout = gd_layout
it_toolbar_excluding = lt_exclude
CHANGING
it_fieldcatalog = fieldcat
it_outtab = it_conf[].
create object g_event_receiver.
set handler g_event_receiver->catch_doubleclick for g_grid.
Set editable cells to ready for input initially
call method g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
endif.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
*call screen 100.
*& Form build_layout
FORM build_layout.
CLEAR gd_layout.
v_dynnr = 100.
gd_layout-cwidth_opt = 'X'.
gd_layout-zebra = 'X'.
gd_layout-grid_title = text-002.
ENDFORM. "build_layout
*& Form exclude_tb_functions
text
-->PT_EXCLUDE text
form exclude_tb_functions changing pt_exclude type ui_functions.
data ls_exclude type ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
append ls_exclude to pt_exclude.
endform. "exclude_tb_functions
*& Form field_cat
text
FORM fieldcat_build .
wa_fieldcat-fieldname = 'CHECKBOX'.
wa_fieldcat-tabname = 'IT_CONF'.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-edit = 'X'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'PERNR'.
wa_fieldcat-coltext = 'P.S. No'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ENAME'.
wa_fieldcat-coltext = 'Employee Name'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZZBTC'.
wa_fieldcat-coltext = 'Band'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'PERSK'.
wa_fieldcat-coltext = 'Grade'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZZOD_TXT'.
wa_fieldcat-coltext = 'OD Name'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZZCS'.
wa_fieldcat-coltext = 'Cluster / Sector '.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'VERTICAL'.
wa_fieldcat-coltext = 'Vertical'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'SBUTXT'.
wa_fieldcat-coltext = 'SBU'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ORG_TEXT'.
wa_fieldcat-coltext = 'Dept.'.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'LOCATION'.
wa_fieldcat-coltext = 'Empl. Base Location '.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'DEPT_LOC'.
wa_fieldcat-coltext = 'Empl. Deputation Location '.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ENAME_S'.
wa_fieldcat-coltext = 'IS Name '.
wa_fieldcat-tabname = 'IT_CONF'.
APPEND wa_fieldcat TO fieldcat.
clear wa_fieldcat.
endform. "field_cat
*& Form check_lock
text
-->PS_OUTTAB text
-->P_LOCKED text
form check_lock using ps_outtab type i_conf
changing p_locked.
data ls_celltab type lvc_s_styl.
loop at ps_outtab-celltab into ls_celltab.
if ls_celltab-fieldname = 'CHECKBOX'.
if ls_celltab-style eq cl_gui_alv_grid=>mc_style_disabled.
p_locked = 'X'.
else.
p_locked = space.
endif.
endif.
endloop.
endform. "check_lock
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
IF sy-ucomm = 'EMAIL'.
clear it_conf.
CALL METHOD g_grid->refresh_table_display.
data: ls_outtab type i_conf.
data: l_valid type c,
l_locked type c.
*§A4ad. Before you (a)set, reset or (d)evaluate checkboxes,
you must check the input cells.
If all entries are ok, ALV transferes new values to the output
table which you then can modify.
call method g_grid->check_changed_data
IMPORTING
e_valid = l_valid.
if l_valid eq 'X'.
loop at it_conf into ls_outtab.
if not ls_outtab-checkbox is initial
and not ls_outtab-checkbox eq '-'.
***************************sending mail to employee and his/her superior***********************************
select single sachn telnr into (tc_name , tc_num) from t526
where SACHX = ls_outtab-zztc
and werks = ls_outtab-werks .
******find the emil of employee.
clear : p_0105,p_0105[].
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = ls_outtab-pernr
infty = '0105'
BEGDA = pn-begda
ENDDA = pn-endda
TABLES
infty_tab = p_0105
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
if sy-subrc = 0.
read table p_0105 with key subty = '0010'.
move p_0105-USRID_LONG to email.
endif.
find immediate superior by Z FM.
clear pernr_s.
CALL FUNCTION 'ZHR_GET_IMMMED_SUPERIOR'
EXPORTING
pernr = ls_outtab-pernr
IMPORTING
v_pernr = pernr_s
EXCEPTIONS
not_found = 1
OTHERS = 2.
if sy-subrc = 0.
find the email of the immed. superiors personal number..
clear : p_0105,p_0105[].
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr_s
infty = '0105'
BEGDA = pn-begda
ENDDA = pn-endda
TABLES
infty_tab = p_0105
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
read table p_0105 with key subty = '0010'.
move p_0105-USRID_LONG to email_s.
endif.
if email <> ' '.
count = 1.
perform send_mail using ls_outtab-ename email email_s tc_name tc_num count .
endif.
if email_s <> ' '.
count = 2.
perform send_mail using ls_outtab-ename email email_s tc_name tc_num count.
endif.
call method g_grid->refresh_table_display.
modify it_conf from ls_outtab.
endif.
endloop.
call method g_grid->refresh_table_display.
endif.
set screen 100.
endif.
**************************end of sending mail****************************************************
IF sy-ucomm = 'SELECT'.
CALL METHOD g_grid->refresh_table_display.
*§A4ad. Before you (a)set, reset or (d)evaluate checkboxes,
you must check the input cells.
If all entries are ok, ALV transferes new values to the output
table which you then can modify.
call method g_grid->check_changed_data
IMPORTING
e_valid = l_valid.
if l_valid eq 'X'.
loop at it_conf into ls_outtab.
perform check_lock using ls_outtab
changing l_locked.
if l_locked is initial
and not ls_outtab-checkbox eq '-'.
ls_outtab-checkbox = 'X'.
endif.
modify it_conf from ls_outtab.
endloop.
call method g_grid->refresh_table_display.
endif.
set screen 100.
endif.
IF sy-ucomm = 'BCK' and v_dynnr = 100.
clear v_dynnr.
set screen 1000.
leave screen. " 0."1000.
**call selection-screen 1000.
*call screen 1000.
endif.
IF sy-ucomm = 'EXIT' and v_dynnr = 100.
clear v_dynnr.
leave program.
endif.
IF sy-ucomm = 'CANC' and v_dynnr = 100.
clear v_dynnr.
leave program.
endif.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form send_mail
text
-->EMAIL_S text
-->EMAIL text
-->TC_NAME text
-->TC_NUM text
form send_mail using ename email email_s tc_name tc_num count.
*Body of mail
CLEAR objtxt.
CLEAR objtxt[].
objtxt = text-005.
concatenate objtxt ename into objtxt separated by space.
append objtxt.
clear objtxt.
objtxt = text-006.
concatenate objtxt email_s into objtxt separated by space.
append objtxt.
clear objtxt.
append objtxt.
objtxt = text-002.
append objtxt.
clear objtxt.
objtxt = text-003.
append objtxt.
clear objtxt.
append objtxt.
objtxt = text-004.
concatenate objtxt tc_name 'at' tc_num into objtxt separated by space.
append objtxt.
clear objtxt.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
*Mail description
CLEAR docdata.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
docdata-obj_name = 'Reminder'.
docdata-obj_descr = 'REMINDER TO DO PRE-BOOKING'.
docdata-obj_langu = sy-langu.
*Packing list for main document
CLEAR objpack.
CLEAR objpack[].
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
*Email receiver's list
CLEAR reclist.
CLEAR reclist[].
if count = 1.
reclist-receiver = '[email protected]'.
reclist-receiver = email.
else.
reclist-receiver = email_s.
endif.
reclist-rec_type = 'U'.
APPEND reclist.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = docdata
document_type = 'RAW'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_content = objtxt
receivers = reclist
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
message 'mail(s) sent successfully' type 'S'.
ENDIF.
endform. "send_mail
*& Form eventtab_build
FORM eventtab_build USING rt_events TYPE slis_t_event.
*Registration of events to happen during list display
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = rt_events.
READ TABLE rt_events WITH KEY name = slis_ev_top_of_page INTO ls_event.
IF sy-subrc = 0.
MOVE g_top_of_page TO ls_event-form.
APPEND ls_event TO rt_events.
ENDIF.
ENDFORM. "eventtab_build
*& Form top_of_page
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. "top_of_page
*& Form COMMENT_BUILD
FORM comment_build USING lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader,
rp_date TYPE string. "report date
LIST HEADING LINE: TYPE H
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = text-007.
APPEND ls_line TO lt_top_of_page.
CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum(4) INTO rp_date SEPARATED BY '.'.
STATUS LINE: TYPE S
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-key = text-008.
ls_line-info = rp_date.
APPEND ls_line TO lt_top_of_page.
ENDFORM. "comment_build
*& Form read_info
text
-->P_1001 text
-->PERNR text
-->STAT text
-->REL text
form read_info tables p_1001 using pernr stat rel.
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
AUTHORITY = 'DISP'
WITH_STRU_AUTH = 'X'
PLVAR = '01'
OTYPE = 'P'
OBJID = pernr
ISTAT = stat
SUBTY = rel
BEGDA = pn-begda
ENDDA = pn-endda
TABLES
I1001 = p_1001
EXCEPTIONS
NOTHING_FOUND = 1
WRONG_CONDITION = 2
WRONG_PARAMETERS = 3
OTHERS = 4.
endform. "read_info
*& Module BACK INPUT
text
MODULE BACK INPUT.
IF SY-UCOMM = 'E'.
leave program.
endif.
IF SY-UCOMM = 'ENDE'.
leave program.
endif.
IF SY-UCOMM = 'ECAN'.
leave program.
endif.
ENDMODULE. " BACK INPUT -
MRU and manual updatable report on same page
ok. I understand that we can't have more than one MRU process on a page. Actually it seems 2 regions using the same MRU seems to work fine, but I had a problem adding a 3rd region with a new MRU. So I resorted to putting in my own updatable report. The code works well if I use an independent page but does not do anything as soon as I add it to the page with the MRU process.
The base query is like:
select '***' as select_plate,
htmldb_item.hidden(31,p.plate_id) plate_id,
p.plate_ID "Plate Id",
htmldb_item.text(37, PLATE_BARCODE, 30) plate_barcode,
PLATE_TYPE ,
htmldb_item.checkbox(23, p.plate_id) sel,
htmldb_item.checkbox(8, p.plate_id) child,
htmldb_item.select_list_from_query(33, modified_by, 'select first_name || '' '' || last_name uname, upper(username) username from eims_user') modified_by,
MODIFIED_ON ,
STATUS,
UPLOADED_ON,
decode(p.FILENAME, null, 'N', 'Y') loaded,
pr.run_id assay_run
from plate p, plate_run pr
where p.plate_type = 'zzz'
and p.plate_id = pr.plate_id (+)
the update process looks like
begin
:p2_message := 'ok0';
for i in 1..htmldb_application.g_f31.count
loop
:p2_message := 'ok1';
:p2_message := :p2_message || htmldb_application.g_f31(i);
--if htmldb_application.g_f31(i) is not null then
update plate set plate_barcode = htmldb_application.g_f37(i),
modified_by = htmldb_application.g_f33(i)
where plate_id = htmldb_application.g_f31(i);
--end if;
end loop;
I added the p2_message to kind of trace what is happening. ok0 gets outputed in the multi-region page and nothing happen for the aupdate; while on the test page with this report as the only regio, I get the expected behavior and the update goes in correctly!
Is it correct to assume that the g_fxx arrays global to a page? I used g_f3x just to make sure there is no conflict with the ones generated with the MRU process.
Any help/hint is appreciated
--NabilHi Alex,
You can use more than one region in the same page or even you can create multiple report in the same page. But remember you can not create as many region as you want, ofcourse there is limitation. Same theory applies to item.
Hope this helps.
Regards,
M Tajuddin
web: http://tajuddin.whitepagesbd.com -
How to add a row-selector to an existing SQL Query (updatable report)
Hi,
I screwed up an extensive updatable report in Apex 4.2 region by one time indicating the page may be parsed at run time.
After setting this back (to validate query) a lot of the columns setting were gone, and also the row-selector
I actually don't kno how to simply add this row-selector back into place.
Anyone who can point me in the right direction?
Thanks a lot
WimWim,
>
Hi,
I screwed up an extensive updatable report in Apex 4.2 region by one time indicating the page may be parsed at run time.
After setting this back (to validate query) a lot of the columns setting were gone, and also the row-selector
I actually don't kno how to simply add this row-selector back into place.
Anyone who can point me in the right direction?Have you been able to recover all your other configuration and this is the last thing you need to fix? Or are all those other things needing to be fixed as well?
The reason I ask is that you may want to consider just starting from scratch, if you haven't put lots of effort into recovering everything else just yet.
On the other hand, if you just want to add a checkbox back into the SQL statement then you can add this, substituting your column name for empno of course:
APEX_ITEM.CHECKBOX2(1,empno,'CHECKED') "Select"When you do this you'll get a warning that you're changing the interactive report, which you should accept. Then you need to make sure that the column is actually shown in the interactive report by making sure it's in the displayed columns list. And you may also need to change the display type of the column to "Standard Report Column"
Hope that helps.
Earl -
Self Updating Report of Open Sales Orders (Maybe Crystal )
I want a self updating report of Open Sales Order. I want it to refresh constantly. I know that it could be an alarm but it would be executed every # minutes and dont want to. Any ideas ? I dont know Crystal Reports enough but is it posible ?
Hi ,
If I were you , I will not be crazy looking at my sales order in every 1 minutes ..I would train my users to check at least 15 minutes.
I understand what u are trying to do;you want that customer will see the latest open SO created ..but 15 minutes is good enough time .
I think you have to check if database size grows up big time ..so far no report has come to me from my clients for this set up .
make sure you are not saving an alert into database
If you are using multiple alerts , I will atleast monitor my database for a while to see i encounter performance issue ..
So far for one alert at every 15 minutes ..i think u should be fine ..
Hope this helps
Bishal -
Navigate to the first item in a updatable report
on my page i have a master/detail form. When a new detail - record is created, the cursor navigate to the first item on the page => it is the first item of the master! What I have to do, that the cursor navigate to the first item in the new detail-record ??
Thanks
RobertHi Andy,
thank you for your answer.
When the program start, I can not find the cursor. I think, I have a problem to reference the item in the updatable report. I wrote the following lines:
<script language="JavaScript1.1" type="text/javascript">
alert('Vor Cursor Navigation');
first_field('#FKOM_RUFNR#');
</script>
(FKOM_RUFNR is a column of the select statement in the report!!)
A second problem: The cursor navigate to the field - first_field('FIELD_NAME') - every time. But the cursor should navigate to the field in the updatable report, if the button "ADD" in the region of the updatable report was clicked. If the page was displayed without clicking the ADD - button, the cursor should navigate to the first item in the master form ( like => Cursor focus: first item on the page). How can I do that ??
Thanks
Robert -
Insert not working in updatable report
I have created an updatable report using the htmldb_item function with the facility to display an extra row (in order to create a new row).
I have then created a Create button that branches to the same page as the updatable reportn and a Branch.
I then created an after submit process that makes the insert of the data.
But apparently the process is not fired when I click the create button.
How do I have to do to fire a Submit on the page in order for my process to be run?
Thanks.Just to amplify MtD's explanation, if you start to move a SINGLE clip and THEN hold down the Option key, the arrow will change form so that it has a 90 degree bend in it. Then when you release the clip in a new position by letting go of the mouse button, not only will it "insert" into the timeline at that position, but the gap in the timeline (where you pulled it from) will close.
It's really helpful when you are rearranging sound bites and don't want to have to manually close up the holes in the timeline. Unfortunately this only works when you are grabbing a single clip. If you do it with multiple clips it will still insert, but will leave an open hole in the timeline where you pulled the group from. Having Snapping (N) turned on is very helpful for this operation, by the way. -
Using multiple LOV popups in a multi-row updatable report but save to 1 col
Hi,
I'm trying to generate a multirow updatable report, which has only 1 writeable column. There is a read-only column that indicates the type of value that the writeable column should contain (it's a varchar2). The second column will be a LOV popup.
I can create the report by setting the 2nd column to a LOV and it's fine, however I really want the LOV to be different, depending upon the value of the first column for the row.
For example, if the first column is "list" then I want the popup to show all my "lists"
If the first column is "role" then I want to the popup to show all my "roles".
There will be a mixture of values within the entire rowset.
I've so far managed to use a case statement to generate different LOV popups, which are displayed as required but the returned data isn't written back to the correct field.
If I use the same p_idx value then there is only one javascript function created and it always stores the data in the first rows column.
If I use unique p_idx values, then it works better but selecting a value for the 2nd row will store it there but also overwrite the 1st rows value as well.
My SQL for the report currently looks like this (cut down for clarity)
SELECT RULACTPRMIDD, /* PK */
CASE PRMNME /* type */
WHEN 'list' THEN
APEX_ITEM.POPUPKEY_FROM_QUERY(2,rulactprmval,
'SELECT LSTNME r, LSTNME d FROM LSTLST', 0)
WHEN 'role' THEN
APEX_ITEM.POPUPKEY_FROM_QUERY(2,rulactprmval,
'SELECT ROLNME r, ROLNME d FROM PDRROL', 0)
END dynamic_popup
FROM CPNRULACTPRM
I can't think of an example where i've seen this done within the Apex development environment otherwise I would refer you to that.
An alternative option would be to pass the type of value required to the same LOV and then get the LOV query to only show the appropriate values - i'll look into this as a workaround option.
thanksUser478832,
I didn't look thru all the code but I have a feeling your problem is the 9th line in the On Demand process. (the 9th line in this post anyway)...
htp.prn('<option value="' || rec.cpc_name|| '">' || rec.cpc_name|| '</option>');
You modified your query to get a different column but your returning the same column later: rec.cpc_name x2
I assume you want to display NAME and return ID so change it like this...
htp.prn('<option value="' || rec.cpc_id || '">' || rec.cpc_name|| '</option>');
Let me know if that helps...
Dan -
How to add a new record in updatable report using apex_item
Hi,
i am using an updatable report using the following select
select
aPEX_ITEM.POPUP_FROM_QUERY(2,emp_code,
' SELECT emp_surname, emp_code FROM hrm_employee ' ,null,null,null,null,null,'onchange="f_set_multi_items_tabular(this.value ''#ROWNUM#'''
|| ')"',null,null,null) PF_No,
apex_item.text (32,
NULL,
80,
100,
'style="width:190px" ',
'f11_' || '#ROWNUM#'
) Name,
" REST_DATE",
"REMARKS",
from "roster"
when i click on the button add row , only the column rest_date and the remarks are enable.
why is the apex_item.text and apex_item_popup_from_query is disable ? and how i can make it enable.
thanks
regards
jerryI could see that you are using the addRow() function to generate new blank row.
I guess, this function(used by the builtin tabular form s) , identifies editable columns when they are marked so at the report column attributes.
When you use apex_item API, it expects the columns to be standard report column and hence render the new rows as such.
Some one from the development team might be able to give a better answer on that.
As for avoiding this issue
<li>One method , would be to define the columns editable(and display types) in report column attributes.
<li> You can duplicate the last row using jQuery( *$('tr.highlight-row:last).after( $('tr.highlight-row:last).clone() )* ) and removing the field values, but events(for example datepicker) would remain attached to the original row , so it isn't very straightforward either.
<li>If you want to use apex_item you would have to use a pseudo union to DUAL for generating a blank row and re-render the report either by a page load or a Dynamic Action. Sounds like a nice idea for a plugin.
Now , if you want to add rows multiple times without saving them, then you would need to store the values in a collection at load and update the collection before adding the row. -
More than one updatable report on one page.
I hope someone can help me with this.
I've spend a long time looking for the best way to do this but keep running into APEX constraints.
My problem is that I have two tables;
1) an 'object' table with static attributes (that can change value but keep no history).
2) an 'object attributes' table with attributes that can change over time (i.e. keep a history).
Some of the attributes are optional and some mandatory irrespective of whether they are static or timestamped.
I want to design a screen that shows both tables on one page - preferably both updatable on the same screen.
Selecting/clicking a row in the top table (object) will select the appropriate object attribute rows in the table below (I've got that covered - no help needed there).
If I create a new object record I also need to create an initial object attributes record.
This first initial attributes record cannot be deleted while the object exists.
The start date of the object itself and its first object attributes record should remain in sync.
I cannot separate the object table and attributes tables on different pages as all static and timestamped attributes form one collection that needs to be visible and maintainable from one screen.
The problem is APEX will not allow more than one updatable (or interactive) report on one page.
I need a solution where both tables are maintained in a uniform way for the user.
Not, for instance, one table an updatable report and the other a report with detail form.
Anybody struggle with a similar problem and found a solution to this problem?
Any pointers are most welcome.
Ruud.
PS. I have a joined view on both tables with an INSTEAD trigger that can process insert/update/delete's on the combined data however I would not like to use that if I can avoid it. It would mean a repetition of static attributes in the one updatable report.Andy,
Apologies for the late reply - Forums have been out for a while :-(
Thanks for the suggestion. I've had a look at Denes' example and
at least now I know it is possible.
I've asked for access to his workspace but have not been given that
yet so can't look at the details yet but I can make some educated
guesses as to how it was done.
I will give it a try.
I'm still not certain whether having 2 updatable tabular reports is the
right way to go though....
Currently I'm working on a page with 2 navigator reports - one for selecting
the object and another to select the start date of the timestamped attributes.
Next to that I have an updatable detail form that shows the selected object
and attributes as one whole set using the joined view I mentioned earlier.
Inserts, updates & deletes are then done in the form.
Ruud. -
Opening updated report fails because record selection filter is invalid
I am trying to update a report stored in BOE XI. The report has been modified and the main part of the report has been moved to a subreport. I first replace the .rpt file with the updated report. Then I attempt to open the report using the code below it, but it throws an error and complains about an unknown field being mentioned in the filter
oReportAppFactory = (IReportAppFactory) es.getService("", "RASReportService");
oReportClientDocument = oReportAppFactory.openDocument((IInfoObject) oReport, 0, Locale.ENGLISH);
ERROR MESSAGE: Cannot open report document. --- This field name is not known.
Details: errorKind
Error in File /opt/bobje/bobje/tmp/{F395AC11-26FC-11DF-A70C-00065B8B38B5}.rpt:
Error in formula <Record Selection>.
'// Filter on desired date range
This field name is not known.
Details: errorKind
If I manually delete the record selection filter in CMC before upgrading the report all works fine. So, do I need to remove the filter before attempting to open the report or is there another step I'm missing to refresh the report using the newly updated .rpt file?
thanks,
BrettThe relevant part of the stacktrace is below.
java.lang.UnsupportedOperationException
at com.crystaldecisions.sdk.properties.internal.AbstractSDKList.remove(Unknown Source)
at java.util.AbstractList$Itr.remove(AbstractList.java:436)
at com.crystaldecisions.sdk.plugin.desktop.common.internal.i.do(Unknown Source)
at com.crystaldecisions.sdk.plugin.desktop.report.internal.e.f(Unknown Source)
at com.crystaldecisions.sdk.plugin.desktop.report.internal.e.f(Unknown Source)
at com.crystaldecisions.sdk.plugin.desktop.report.internal.e.refreshProperties(Unknown Source)
The context is the same as the original post...
An existing report is being updated. The original report uses a single view and has a record selection filter. The updated report uses the same view in a subreport, and the main report has no record selection filter.
.rpt file is updated using IReport.replaceUnique(int, File).
Changes are committed to IInfoStore -> iStore.commit(IReport)
Refresh options are enabled
IReportRefreshOptions refreshOptions = oReport.getReportRefreshOptions();
refreshOptions.removeOption(IReportRefreshOptions.CeRefreshOption.TITLE);
refreshOptions.removeOption(IReportRefreshOptions.CeRefreshOption.DESCRIPTION);
refreshOptions.addOption(IReportRefreshOptions.CeRefreshOption.PROMPT_VALUES);
refreshOptions.addOption(IReportRefreshOptions.CeRefreshOption.RECORD_SELECTION_FORMULA);
refreshOptions.addOption(IReportRefreshOptions.CeRefreshOption.GROUP_SELECTION_FORMULA);
refreshOptions.addOption(IReportRefreshOptions.CeRefreshOption.PRINTER_OPTIONS);
refreshOptions.addOption(IReportRefreshOptions.CeRefreshOption.DEFAULT_LOGON_INFO_VALUES);
Properties are then refreshed using IReport.refreshProperties() which throws the UnsupportedOperationException
changes are again committed.
thanks,
Brett -
New MacBook Pro 15" Retina arrived today.
Software Update reports that updates are available for iPhoto and iMovie, bundled with purchase.
However, when UPDATE is selected, the error message
"You have updates available for other accounts.
To update this application, sign in to the account you used to purchase it."
I am the initial user and have no other account.Any chance you had a different Apple ID with an earlier Mac and then it got migrated to your new MBP?
When you registered new MBP did you use the same Apple ID? -
How to display more than 10 rows in an Auto Updating Report
I followed Carl Backstorm's example, http://htmldb.oracle.com/pls/otn/f?p=11933:40:525653462286833::NO:RP:: to create a page with an auto update report/region. It's working fine (thanks, Carl) but I can't have the report display all rows (38 rows in total). Everytime I press the "Manual Refresh" button, it shows 10 (the first 10) rows only.
When the report displays at the first time, it shows all the rows (38 rows). Number of Rows and Maximum Row Count are set to 999999 and "No Pagination Selected" in the report region. But after I press the "Manual Refresh" button or specifiy an update time value (like 1 second) to have it auto update, then it only display the first 10 rows.
Is there a way to display more than 10 rows in an Auto Updating Report using Carl's example auto update report/page? Anyone can help? Thank you.
-Michele
Edited by: 106451 on Jun 30, 2010 10:12 AMYes, I changed it to:
function table_object(pId){
this.id = pId;
this.start_record = 1; //optional
this.num_record = 50; //optional
this.num_record2 = 50; //optional
I don't quite understand how these vaiables are used for though. Thanks. -
Carl's Auto Updating Report example with Apex 3.0
Hi,
I'm try to develop a page very similar to Carls' "Auto Updating Report" page and been very new to Apex I find it very hard to work out all the things I need to do from the example pages.
Is there anywhere I can download a sample application so I can explore the code through APEX to see how everything works and fits together.
Any help would be most appreciated.
AnthonyCarl,
Thanks I have it working.
Just one more question is it possible to have two reports on same page to auto update?
If I simply add another html_PPR_Report_Page with the second report_id I get an Error : "gNode is null or not an object". using IE.
function mon_Refresh()
setTimeout("mon_Refresh()",5000);
html_PPR_Report_Page (null,'R1736701112358007',$x('r_R1736701112358007').getAttribute('htmldb:href'))
works fine but
function mon_Refresh()
setTimeout("mon_Refresh()",5000);
html_PPR_Report_Page (null,'R1736701112358007',$x('r_R1736701112358007').getAttribute('htmldb:href'))
html_PPR_Report_Page (null,'R1738006943370690',$x('r_R1738006943370690').getAttribute('htmldb:href'))
raises an error.
Anthony
Maybe you are looking for
-
Need a formula for 12 months data, 6 months data and 3 month
Hi All Crystal Experts, In my report, data is grouped by months and I have monthly view of data. I have three prompts- Year, Startdate and Enddate. If I give 2013 as year, 1/1/2013 as start date and 05/01/2013 as end date then report shows monthly vi
-
Windows XP SP2 This suddenly started happening and I don't know why. When I open iTunes it says "iTunes has encountered a problem and needs to close." then it closes. No iTunes window pops up or anything, just this error window. It has no relevant
-
Dear All, I've got some chalenging questions about implementing Cisco VoIP and I looking for some fair answers: 1. What visible indications are invoked if IP phones default to survivable telephony mode? 2.How long will active calls last if primary ca
-
Header and filed vlues n the same row in reciver file using FCC
Hi, I have a scenario ,where receiver file should contain only one row (the row contain all the filed values using end separator) . and also need to display header (file should contain only one row including header and field values). Now i am get
-
hi! some one told me that If I want to display the paragraph at one place i mean with out any page break then first use control_form for protect then u r required element then end protect. CALL FUNCTION 'CONTROL_FORM' EXPORTING command = 'PROTECT'. c