Editable fields in a Z Report.
Hello Gurus,
We have a requirement to create a new z report where we need to get some 10 fields from BP Master data from CRM and some data from R/3.
Our requirement would be that in the Z report some of the fields should be editable for eg : BP Name and business should be able to save the changes and our Master data should be updated.
By your experience please let me know if you have created a report with editable fields and if those fields can automatically update the master data.
If yes can you please let us know the applicable method.
thanks,
Kitcha
Hi Kitcha,
Yes, you can create a ZReport with Fields from both CRM Systems and R/3 System. But you only want the fields from the CRM System to be updated ? Are the fields from the R/3 System only for display ?
You need to know the following things
1. ABAP Reports
2. RFC Enabled Function Modules or BAPI's
3. Module Pool Programing (Optional)
You can call the module pools from your report programs which will give you a very good control on events which are triggered by the users. Also you can seperate the Database calls from the Business Logic. You need to use the BAPI which will take care of all the transactional concepts and Update scenarios of the database access. You can also stick to the report programing for UI instead of module pool.
For makeing the field editable, you have put this code in the Report Event
AT SELECTION-SCREEN OUTPUT.
Loop at Screen.
if screen-name = '<screen_element>'.
screen-input = 1.
modify screen.
endif.
Endloop.
At other events you need to call the other calls of the Save. you can also configure the other screen events to control the flow of the program logic.
Hope this helps. Let me know if you need more specific details.
Thanks,
Samantak
Similar Messages
-
To capture the selected rows along with edited field contents in alv report
Dear All,
I do have requirement where, in alv report output one field is editable and need to save the content of the edited field along with the selected rows.
For example If there are 10 records displayed in the alv output with 20 fields.
Out of this 20 fields one field (say XYZ) is editable. Also i have already created a new pushbutton (say ABC) on alv output. Now in the alv output if we maintain some value in the field (XYZ ) for the 2nd and 4th record and select this two records, and when clicked on the pushbutton (ABC) it has to update the DB table.
I am using the Func Module 'REUSE_ALV_GRID_DISPLAY'.
Your early reply with sample code would be appreciated.
Thanks in Advance.HI Naveen ,
There is an import parameter "i_callback_program" in the function module,
plz pass the program name to it.
Capture the command by passing a field of type sy-ucomm to "I_CALLBACK_USER_COMMAND ". Check the returned command and
and program a functionality as desired.
u can try the event double_click or at line selection. there u can use READLINE command to c if the line has been selected.
In case it is , process the code segment.
Regards
Pankaj -
Character length of an editable fields
hi frnz,
I have created an editable field in an ALV report.My client wants the character length of this editable field as 1000.I have made the data type as 'STRINGS' and length as '1000', but still in this editable field i am able to feed only upto character length of 128 not beyond this value.The text which my client wants to feed is of 950 characters. Could anyone give some solution for this
Thanks
PraveenHi, i think you have to give intlen and outputlen in field catalog
FIELDCAT-INTLEN = 1000.
FIELDCAT-OUTPUTLEN = 1000.
Please check the doc of field catalog
[http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm]
Regards,
Ben -
Editable fields in oracle report
Hi,
I am hoping someone can help what I am trying to create is a PDF oracle report with an editable field at the end of the report. The user would use this field to type comments about the report and then save the file with the comments attached.
I did a search but couldn't really find anything relevant apart from this thread here: Re: How to add to report in pdf format editable fields but it looks like that was never answered.
Users have access to Adobe Acrobat so an alternative solution could be just to create a rectangle and tell the users to write in that but it is not an ideal solution.
If it is not possible in oracle reports we are also licensed for BI Publisher but as of yet I haven't been able to find anything that would do this using that tool either.
Regards,
Chadwith an editable field at the end of the report.In Reports the user cannot add text after generation of the report. So, do it before generating the report. Add a parameter p_comment to the data model and add this to the parameter form (or whatever form you use to call the report, e.g. from Forms) and create a text field at the end of the report.
-
To edit the field in the ALV report
Hi,
i want to edit the field of the ALV report what i need to do for that..
Thanks & Regards
Ashu Singhhi,
check the code,
REPORT zalv_fcat.* Output table T006 structure declarationTYPES : BEGIN OF ty_t006.
INCLUDE STRUCTURE t006.
TYPES : END OF ty_t006.*Internal table and wa declaration for T006
DATA : it_t006 TYPE STANDARD TABLE OF ty_t006,
wa_t006 TYPE ty_t006.*declarations for ALV
DATA: ok_code TYPE sy-ucomm,
fieldcatalog for T006
it_fielcat TYPE lvc_t_fcat,
fieldcatalog for fieldcatalog itself:
it_fielcatalogue TYPE lvc_t_fcat,
it_layout TYPE lvc_s_layo.*declaration for toolbar function
DATA: it_excl_func TYPE ui_functions.
Controls to display it_t006 and corresponding fieldcatalog
DATA: cont_dock TYPE REF TO cl_gui_docking_container,
cont_alvgd TYPE REF TO cl_gui_alv_grid.*controls to display the fieldcatalog as editable alv grid and container
DATA: cont_cust TYPE REF TO cl_gui_custom_container,
cont_editalvgd TYPE REF TO cl_gui_alv_grid.*intialization event
INITIALIZATION.*start of selection event
START-OF-SELECTION.
LOCAL CLASS Definition for data changed in fieldcatalog ALV
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed.
ENDCLASS. "lcl_event_receiver DEFINITION
LOCAL CLASS implementation for data changed in fieldcatalog ALV
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
ENDMETHOD. "handle_data_changed
ENDCLASS. "lcl_event_receiver IMPLEMENTATION*data declaration for event receiver
DATA: event_receiver TYPE REF TO lcl_event_receiver.*end of selection event
END-OF-SELECTION.*setting the screen for alv output for table display and
*changed fieldcatalalogue display
SET SCREEN 600.
On this statement double click it takes you to the screen painter SE51. Enter the attributes
*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
*Go to SE41 and create status 'STATUS600' and create THE function code 'SUBMIT'
*and 'EXIT' with icons and icon texts
Also create a TitleBar 'TITLE600' and give the relevant title.&----
*& Module STATUS_0600 OUTPUT
MODULE status_0600 OUTPUT.
SET PF-STATUS 'STATUS600'.
SET TITLEBAR 'TITLE600'.
CREATE ALV GRID CONTROL IF DOES NOT EXISTS INITIALLY
IF cont_dock IS INITIAL.
PERFORM create_alv.
ENDIF.ENDMODULE. " STATUS_0600 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 as shown below
*& Module USER_COMMAND_0600 INPUT
MODULE user_command_0600 INPUT.
CASE ok_code.
WHEN 'SUBMIT'.
*TO GET THE CURRENT FIELDCATALOGUE FROM THE FRONTEND
CALL METHOD cont_alvgd->set_frontend_fieldcatalog
EXPORTING
it_fieldcatalog = it_fielcat.
*refresh the alv
CALL METHOD cont_alvgd->refresh_table_display.
*to Send Buffered Automation Queue to Frontend
CALL METHOD cl_gui_cfw=>flush.*Exit button clicked to leave the program
WHEN 'EXIT'.
LEAVE PROGRAM. ENDCASE.ENDMODULE. " USER_COMMAND_0600 INPUT&----
*& Form CREATE_ALV
&----FORM create_alv.*create a docking container and dock the control at the botton
CREATE OBJECT cont_dock
EXPORTING
dynnr = '600'
extension = 100
side = cl_gui_docking_container=>dock_at_bottom.*create the alv grid for display the table
CREATE OBJECT cont_alvgd
EXPORTING
i_parent = cont_dock.*create custome container for alv
CREATE OBJECT cont_cust
EXPORTING
container_name = 'CCONT'.
*create alv editable grid
CREATE OBJECT cont_editalvgd
EXPORTING
i_parent = cont_cust.* register events for the editable alv
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_data_changed FOR cont_editalvgd. CALL METHOD cont_editalvgd->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.*building the fieldcatalogue for the initial display
PERFORM build_fieldcat CHANGING it_fielcat it_fielcatalogue.*building the fieldcatalogue after the user has changed it
PERFORM change_fieldcat CHANGING it_fielcatalogue.*fetch data from the table
PERFORM fetch_data.* Get excluding functions for the alv editable tool bar APPEND cl_gui_alv_grid=>mc_fc_loc_append_row TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_loc_insert_row TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_loc_cut TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_sort TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_sort_asc TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_sort_dsc TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_subtot TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_sum TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_graph TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_info TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_print TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_filter TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_views TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_mb_export TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_mb_sum TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_mb_sum TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_mb_paste TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_find TO it_excl_func.
APPEND cl_gui_alv_grid=>mc_fc_loc_copy TO it_excl_func.
*Alv display for the T006 table at the bottom
CALL METHOD cont_alvgd->set_table_for_first_display
CHANGING
it_outtab = it_t006[]
it_fieldcatalog = it_fielcat[].
optimize column width of grid displaying fieldcatalog
it_layout-cwidth_opt = 'X'.* Get fieldcatalog of table T006 - alv might have
modified it after passing.
CALL METHOD cont_alvgd->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = it_fielcat[].to Send Buffered Automation Queue to Frontend CALL METHOD cl_gui_cfw=>flush. Display fieldcatalog of table T006 in editable alv grid
CALL METHOD cont_editalvgd->set_table_for_first_display
EXPORTING
is_layout = it_layout
it_toolbar_excluding = it_excl_func
CHANGING
it_outtab = it_fielcat[]
it_fieldcatalog = it_fielcatalogue[].
ENDFORM. " CREATE_alv
*& Form fetch_data
FORM fetch_data.* select data of T006
SELECT * FROM t006 INTO TABLE it_t006 UP TO 50 ROWS.
ENDFORM. " fetch_data
*& Form BUILD_FIELDCAT
FORM build_fieldcat CHANGING it_fldcat TYPE lvc_t_fcat
it_fcat TYPE lvc_t_fcat.
Fieldcatalog for table T006: it_fldcat
to generate the fields automatically CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'T006'
CHANGING
ct_fieldcat = it_fldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.*----
Fieldcatalog for table LVC_T_FCAT:it_fcat
Generate fieldcatalog of fieldcatalog structure.
This fieldcatalog is used to display fieldcatalog 'it_fldcat'
on the top of the screen. CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'LVC_S_FCAT'
CHANGING
ct_fieldcat = it_fcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " BUILD_FIELDCAT
*& Form CHANGE_FIELDCAT
*after the user has modified the fieldcatalogue we build another fieldcat
*for the modified alv display
FORM change_fieldcat CHANGING it_fcat TYPE lvc_t_fcat. DATA ls_fcat TYPE lvc_s_fcat. LOOP AT it_fcat INTO ls_fcat.
ls_fcat-coltext = ls_fcat-fieldname.
ls_fcat-edit = 'X'. IF ls_fcat-fieldname = 'COL_POS' OR ls_fcat-fieldname = 'FIELDNAME'.
ls_fcat-key = 'X'.
ENDIF. MODIFY it_fcat FROM ls_fcat.
ENDLOOP.
ENDFORM. " CHANGE_FIELDCAT
ref:saptechnical tutorial.
Regards,
Anirban -
Interactive report with checkbox and editable field
Hi,
For a project I'm working on I need to create a interactive report in Apex 3.2 with the ability to select lines and to modify one of the columns in the report.
To do this, I started off by adding these two fields to the selection query of my IR:
apex_item.checkbox(1, product_number) cb
and
apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER
cb is the checkbox files, and QTY_TO_ORDER is the editable field.
That worked like a charm and I got my two fields in the report.
To process the values, I added this page process, wich for now should only store the "product number" and "QTY_TO_ORDER" fields in a table.
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(i));
END LOOP;
commit;
end;
However, this doesn’t work the way I want it to work. When I check the checkboxes of two rows, it will store two rows with the right product numbers, but it will take the top two QTY_TO_ORDER field of the table regardless of which ones are checked. I was able to solve this problem, by adding a rownum to the query and using the rownum as the value for the checkbox. Since I still need the product_number and qty_to order fields I made them both text fields.
I changed my page process to:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
insert into mytmptable values (APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(i)),
APEX_APPLICATION.G_F03(APEX_APPLICATION.G_F01(i)));
END LOOP;
commit;
end;
This seemed to solve the problem, and I now got the right values in the table, unless I used sorting in the report... As soon as I sorted the report in a way different than by rownum, I got the wrong values in the table. The reason for this is of course that my insert just selects the nTh row from the table, and my rownums aren't dynamic.
I've found a lot of examples on the internet using '#ROWNUM#' in the selection, which should dynamically generate a rownum in the report. This seems to work in normal report, but in a interactive reports, the literal values '#ROWNUM#' shows up.
Is there any way to solve this issue?Hi,
Try with 3 fields:
apex_item.checkbox(1, product_number) cb,
apex_item.text (2,QTY_TO_ORDER) QTY_TO_ORDER,
apex_item.hidden(3, product_number) prod_no
The hidden field should be display as a hidden column.
Then your process can be:
BEGIN
FOR i in 1..APEX_APPLICATION.G_F01.count LOOP
FOR j in 1..APEX_APPLICATION.G_F03.count LOOP
IF APEX_APPLICATION.G_F01(i) = APEX_APPLICATION.G_F03(j)) THEN
insert into mytmptable values (APEX_APPLICATION.G_F01(i),APEX_APPLICATION.G_F02(j));
exit;
END IF;
END LOOP;
END LOOP; -
How to display the editable fields in output of an ALV report?
Hi all,
I have a requirement of displaying values in ALV Grid format and above this grid display i have to put some fields , that are editable.
I know making ALV grid fields as editable, but here requirement is to display some fields before displaying the ALV grid dispaly and to enable these fields editable to user and when printing this the values entered by user also has tobe printed.
Please help me on solving this problem? Is it possible to do this with ALV function modules?
Thanks,
Vamshi.Hi all,
Thanks for your replies.
But this is not my requirement. I mentioned in my question that i too know how to edit the fields in ALV grid report.
Here my requirement is .
name :_____________
amount:____________
alv grid display
Like above i need to display. after name the user can be enter value and after amount also the user can be enter some value at output . But this is not the header of ALV .
Is this possible in classical ALV or Classical report? If not please specify alternative?
Thanks,
Vamshi. -
2 Classic Reports with edit fields on the same page
Hi All, need your help.
I am trying to have 2 classic reports on one page with edit fields like date, list values, text
I have noticed that the element indexes are the same f01_0001 have both first elements from both reports.
This is making my code go crazy.
Also i have a problem with Date Picker, if i select it as a column type for a first element in second report the icon shows up in the first report.
I think this is because of indexing, but... Classic Date Picker put the icon on second report but when i select the date, the values is populated to first column in first report
Does anyone have a solution for this problem! (for example change the indexing for second report)
DB is 11.2g
Apex is 4.2.0.00.27
Thank you,
Andrei
Edited by: aracila on Feb 20, 2013 9:03 AMAre these tabular forms, ie updteable.
If so, you can only have one per page
Gus -
Editable field gives wrong value in report.
Hi,
I have report with some editable fields. I am using apex_item for one editable select list. I gave functionality to update row by providing go button. when user clicks on go button, I sends page by using javascript dosubmit which updates values in table through update process. everything works fine but sometimes i am not able to read particular value in row. for example...
Rownum---------select_list--------- button---------- comment(editable)-not used apex_item
1------------------------ 'abc'---------------- GO----------------------------- new
2------------------------- null---------------- GO--------------------------- closed
3 ------------------------'xyz'---------------- GO--------------------------- reopen
I used apex_item for select list but status is made editable by selecting "text area" from tabular form element of column.
when I press GO button on row third by selecting xyz it takes null value of 2nd row. same if I select something in 2nd row. i.e. instead of null if I selects 'mno' in 2nd row it takes select list value as 'mno' for third row. I observed this by writing javascript code which alerts me value of variable f01,f02.....
Please if anybody can help me. I want to know why this happens?You might have better luck asking in the Oracle Application Express (APEX).
-
Editing fields on output of alv report format
Dear friends,
I created on report in alv format but user wants to edit the field on the output of that format also it's effect is on the next field should br done.
e.g. if in first field is 10 in next field user edit and enter the value 20 then automatically next field will appered as a 20 * 10 = 200 i.e what to do to collect that 200 in the next field automatically.
how to do it?
Thanks ,
Vishal Bhagwat,Hi,
Refer these standard alv programs
BCALV_EDIT_01 Switch on and off the ready-for-input status of
BCALV_EDIT_02 Define ready-for-input status at cell level
BCALV_EDIT_03 Verification of modified cells
BCALV_EDIT_04 Delete and append rows
BCALV_EDIT_05 Checkboxes
BCALV_EDIT_06 Dropdown Listbox at Column Level
BCALV_EDIT_07 Dropdown Listbox at Cell Level
BCALV_EDIT_08 Integrate Non-Standard F4 Help
BCALV_FIELDCAT_TEST Edit field catalog online
BCALV_FULLSCREEN_GRID_EDIT
BCALV_GRID_EDIT
BCALV_GRID_EDIT_DELTA Example Report for F4 Help of the ALV Grid
BCALV_GRID_EDIT_DELTA_APPL
Regards,
Prashant -
hiii
when doing editable field in alv
you set
i_fieldcat-edit = C_X
i_fieldcat-input = C_X
P_selfield-refresh = C_X
this is not working when i click on save the internal table is not keeping the change i have edit on the screen and the p_selfield value also has still the old value.
but when i double click the p_selfield is keeping the editable value. Please advise ??hi,
Check out this sample program.The part for 'EDIT' is in Bold..
report zalv_color_display_edit.
type-pools: slis.
tables : zcust_master2.
types : begin of wi_zcust_master2,
zcustid like zcust_master2-zcustid,
zcustname like zcust_master2-zcustname,
zaddr like zcust_master2-zaddr,
zcity like zcust_master2-zcity,
zstate like zcust_master2-zstate,
zcountry like zcust_master2-zcountry,
zphone like zcust_master2-zphone,
zemail like zcust_master2-zemail,
zfax like zcust_master2-zfax,
zstat like zcust_master2-zstat,
field_style type lvc_t_styl,
end of wi_zcust_master2.
data: it_wi_zcust_master2 type standard table of wi_zcust_master2
initial size 0,
wa_zcust_master2 type wi_zcust_master2.
data: fieldcatalog type slis_t_fieldcat_alv with header line.
data: it_fieldcat type lvc_t_fcat,
wa_fieldcat type lvc_s_fcat,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type lvc_s_layo, "slis_layout_alv,
gd_repid like sy-repid.
start-of-selection.
perform data_retrieval.
perform set_specific_field_attributes.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
form build_fieldcatalog.
wa_fieldcat-fieldname = 'ZCUSTID'.
wa_fieldcat-scrtext_m = 'CUSTOMER ID'.
wa_fieldcat-col_pos = 0.
wa_fieldcat-outputlen = 10.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZCUSTNAME'.
wa_fieldcat-scrtext_m = 'CUSTOMER NAME'.
wa_fieldcat-col_pos = 1.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZADDR'.
wa_fieldcat-scrtext_m = 'ADDRESS'.
wa_fieldcat-col_pos = 2.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZCITY'.
wa_fieldcat-scrtext_m = 'CITY'.
wa_fieldcat-col_pos = 3.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZSTATE'.
wa_fieldcat-scrtext_m = 'STATE'.
wa_fieldcat-col_pos = 4.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZCOUNTRY'.
wa_fieldcat-scrtext_m = 'COUNTRY'.
wa_fieldcat-col_pos = 5.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZPHONE'.
wa_fieldcat-scrtext_m = 'PHONE NUMBER'.
wa_fieldcat-col_pos = 6.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZEMAIL'.
wa_fieldcat-scrtext_m = 'EMAIL'.
wa_fieldcat-edit = 'X'. "sets whole column to be editable wa_fieldcat-col_pos = 7.
wa_fieldcat-outputlen = 15.
wa_fieldcat-datatype = 'CURR'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZFAX'.
wa_fieldcat-scrtext_m = 'FAX'.
wa_fieldcat-col_pos = 8.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'ZSTAT'.
wa_fieldcat-scrtext_m = 'STATUS'.
wa_fieldcat-col_pos = 9.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
Set layout field for field attributes(i.e. input/output)
gd_layout-stylefname = 'FIELD_STYLE'.
gd_layout-zebra = 'X'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
call function 'REUSE_ALV_GRID_DISPLAY_LVC'
exporting
i_callback_program = gd_repid
is_layout_lvc = gd_layout
it_fieldcat_lvc = it_fieldcat
i_save = 'X'
tables
t_outtab = it_wi_zcust_master2
exceptions
program_error = 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.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
text
--> p1 text
<-- p2 text
form data_retrieval .
data: ld_color(1) type c.
select zcustid zcustname zaddr zcity zstate zcountry zphone zemail
zfax zstat up to 10 rows from zcust_master2 into corresponding fields of
table it_wi_zcust_master2.
endform. "data_retrieval
*& Form set_specific_field_attributes
populate FIELD_STYLE table with specific field attributes
form set_specific_field_attributes .
data ls_stylerow type lvc_s_styl .
data lt_styletab type lvc_t_styl .
Populate style variable (FIELD_STYLE) with style properties
The following code sets it to be disabled(display only) if 'ZFAX'
is NOT INITIAL.
loop at it_wi_zcust_master2 into wa_zcust_master2.
if wa_zcust_master2-zfax is not initial.
ls_stylerow-fieldname = 'ZFAX' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
"set field to disabled
append ls_stylerow to wa_zcust_master2-field_style.
modify it_wi_zcust_master2 from wa_zcust_master2.
endif.
endloop.
endform. "set_specific_field_attributes
Hope this helps you,
Arunsri -
How to get updated fields in a classical report
Hi,
After displaying the report using Write, multiple fields are editable. I used INPUT ON for this. My problem is, how does the program recognize the new entered values in all the editable fields? I can not use AT LINE-SELECTION because only the current line that the cursor has focus on is being retrieved.
I've also researched about DYNPRO_FIELD_GET but i requires a DYNPRO. When I checked the report, it doesn't have a screen number?
Kindly Help.Hi,
You can do that in AT USER-COMMAND
Check this program...
*" Field string declarations...........................................
* Field string declaration to hold computation values with operator *
data:
begin of fs_comp,
operand1(10) type c, " Operand1
operator(2) type c, " Operator
operand2(10) type c, " Operand2
result(30) type c, " Result
end of fs_comp.
* Internal table to hold computation values including operator *
data:
t_comp like
standard table
of fs_comp.
*" Data declarations...................................................
* Work variables *
data:
w_operand1(10) type c, " Operand1
w_operator(2) type c, " Operator
w_operand2(10) type c, " Operand2
w_result(30) type n, " Result
w_flag type i. " Temporary Flag
* END-OF-SELECTION EVENT *
end-of-selection.
sy-title = ' '.
perform operations.
* AT-LINE-SELECTION EVENT *
at line-selection.
if sy-lsind ne 1.
message e000(yh1152).
else.
w_flag = 0.
perform display_input.
endif. " IF SY-LSIND NE 1
* AT PF<nn> *
at pf05.
set user-command 'CALC'.
* AT USER-COMMAND EVENT *
at user-command.
if sy-lsind eq 1.
message e008(yh1152).
else.
if w_flag eq 0.
perform calculations.
else.
message e007(yh1152).
endif. " IF W_FLAG EQ 0
endif. " IF SY-LSIND EQ 1
*& Form operations
*This subroutine displays the operations to be performed on basic list
* No interface parameters
form operations .
write:
/10 'Select a line'(008).
skip 2.
format hotspot on.
write:
/10 'ADDITION : +'(002),
/10 'SUBTRACTION : -'(003),
/10 'MULTIPLICATION : *'(004),
/10 'DIVISION : /'(005),
/10 'POWER : ** '(006).
endform. " operations
*& Form calculations
* This subroutine performs the calculation part of detail list
* No interface parameters
form calculations .
data:
lw_line type i value 4, " No of Lines
lw_str type string. " Exception text
data:
lw_ref type ref to cx_root. " Reference Variable
refresh t_comp.
do 3 times.
clear:
w_operand1,
w_operator,
w_operand2.
read line lw_line field value
w_operand1 into w_operand1
w_operator into w_operator
w_operand2 into w_operand2.
fs_comp-operand1 = w_operand1.
fs_comp-operator = w_operator.
fs_comp-operand2 = w_operand2.
try.
case w_operator.
when '+'.
fs_comp-result = fs_comp-operand1 + fs_comp-operand2.
when '-'.
fs_comp-result = fs_comp-operand1 - fs_comp-operand2.
when '*'.
fs_comp-result = fs_comp-operand1 * fs_comp-operand2.
when '/'.
fs_comp-result = fs_comp-operand1 / fs_comp-operand2.
when '**'.
w_result = fs_comp-operand1 ** fs_comp-operand2.
fs_comp-result = w_result.
clear w_result.
endcase. " CASE W_OPERATOR
catch cx_root into lw_ref.
fs_comp-result = 'Cannot Compute'(007).
lw_str = lw_ref->get_text( ).
message lw_str type 'I'.
endtry.
append fs_comp to t_comp.
clear fs_comp.
add 2 to lw_line.
enddo. " DO 3 TIMES
add 1 to w_flag.
perform result.
endform. " calculations
*& Form DISPLAY_INPUT
* This subroutine displays the input on basic list for operations
* No interface parameters
form display_input .
sy-lsind = 1.
clear:
w_operand1,
w_operand2.
case sy-lilli.
when '4'.
w_operator = '+'.
when '5'.
w_operator = '-'.
when '6'.
w_operator = '*'.
when '7'.
w_operator = '/'.
when '8'.
w_operator = '**'.
when others.
stop.
endcase. " CASE SY-LILLI
write:
/10 'Enter values and press F5 to calculate'(009).
skip 2.
do 3 times.
write:
10 w_operand1 no-zero input on color 1,
25 w_operator intensified on color 2,
30 w_operand2 no-zero input on,
45 ' = ' ,
w_result no-zero input off.
skip.
enddo. " D0 3 TIMES.
endform. " DISPLAY_INPUT
*& Form RESULT
* This subroutine displays the caculated result for selected operator
* No interface parameters
form result .
sy-lsind = 1.
write: /08 'The result of operation processed is'(001).
skip 2.
do 3 times.
read table t_comp into fs_comp index sy-index.
write:
10 fs_comp-operand1 no-zero input off color 1,
fs_comp-operator no-zero intensified on color 7.
if fs_comp-operand2 eq '' or fs_comp-operand2 eq '0'.
write: fs_comp-operand2 no-zero input off color 6.
else.
write: fs_comp-operand2 no-zero input off color 1.
endif. " IF FS_COMP-OPERAND2 NE 0
write:' = ' color 3.
write:
fs_comp-result no-zero intensified on input off color 5.
skip.
enddo. " DO 3 TIMES
endform. " RESULT
* End Of Program *
Execute the above program and run in debugging mode after selecting a line in the basic list.
Hope this would help you.
Regards
Narin Nandivada -
How to set the Background Color of a Text Field in a Tabular Report.
Hello,
I tried to set the Background Color of a Text Field in a Tabular Report.
But I was not able to change this colur.
In the report attributes --> column attributes
I tried already:
1. Column Formating -- >CSS Style (bgcolor: red)
2. Tabular Form Element --> Element Attributes (bgcolor: red)
but nothing worked.
Can anybody help me?
I Use Oracle Apex 2.2.1 on 10gR2
thank you in advance.
Oliverin "Report Attributes" select the column to move to the "Column Attributes" page. In the "Element Attributes" field under the "Tabular Form Element" region enter
style="background-color:red;"
I will also check if there is a way to do this via the template and post here again
edit:
in your template definition, above the template, enter the following:
< STYLE TYPE="text/css" >
.class INPUT {background-color:red;}
< /STYLE >
(remove the spaces after the < and before the >)
change "class" to the class that the template is calling
(I'm using theme 9, the table has: class="t9GCCReportsStyle1" so I would enter t9GCCReportsStyle1)
A side-effect of using this second version is that ALL input types will have a red background color--checkboxes, input boxes, etc.
Message was edited by:
TheJosh -
How to get Length of Editable Field greater than 10 using ALV_GRID_DISPLAY
Hi Experts,
I am Using , REUSE_ALV_GRID_DISPLAY_LVC For Displaying an ALV Report .
Now i'm Using Few fields in Editable mode , but the problem is that , the length of those, editable fields is restricted only to 10 characteras.
But i need a editable field with length of 20 chars , ,for, entering some remarks..Is it possible ?
Can anyone, help how to do that ..?
Thanx in Advance ..
Regards,
Rajeshyou can make use of INTLEN
set the value to 20 and then you can enter to 20 chars.
FIELDCAT-INTLEN = 20.
FIELDCAT-OUTPUTLEN = 20. -
To store Editable Field in ALV
hi! all,
I'm displaying an ALV Grid Report with a field as editable. Now i need to store the values entered in the editable field to a table how to access the data from that field and store. Kindly help me.
Thanks and Regards,
NagulanThis code of mine may be help u to achieve ur requirement.
REPORT z_demo_alv_jg.
TYPE-POOLS *
TYPE-POOLS: slis.
INTERNAL TABLES/WORK AREAS/VARIABLES *
DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
w_field TYPE slis_fieldcat_alv,
p_table LIKE dd02l-tabname,
dy_table TYPE REF TO data,
dy_tab TYPE REF TO data,
dy_line TYPE REF TO data.
FIELD-SYMBOLS *
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa> TYPE ANY,
<dyn_field> TYPE ANY,
<dyn_tab_temp> TYPE STANDARD TABLE.
SELECTION SCREEN *
PARAMETERS: tabname(30) TYPE c,
lines(5) TYPE n.
START-OF-SELECTION *
START-OF-SELECTION.
Storing table name
p_table = tabname.
Create internal table dynamically with the stucture of table name
entered in the selection screen
CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_table->* TO <dyn_table>.
IF sy-subrc <> 0.
MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.
LEAVE TO LIST-PROCESSING.
ENDIF.
Create workarea for the table
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
Create another temp. table
CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN dy_tab->* TO <dyn_tab_temp>.
SORT i_fieldcat BY col_pos.
Select data from table
SELECT * FROM (p_table)
INTO TABLE <dyn_table>
UP TO lines ROWS.
REFRESH <dyn_tab_temp>.
Display report
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS'
TABLES
t_outtab = <dyn_table>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
*& Form SET_PF_STATUS
Setting custom PF-Status
-->RT_EXTAB Excluding table
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'Z_STANDARD'.
ENDFORM. "SET_PF_STATUS
*& Form user_command
Handling custom function codes
-->R_UCOMM Function code value
-->RS_SELFIELD Info. of cursor position in ALV
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Local data declaration
DATA: li_tab TYPE REF TO data,
l_line TYPE REF TO data.
Local field-symbols
FIELD-SYMBOLS:<l_tab> TYPE table,
<l_wa> TYPE ANY.
Create table
CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN li_tab->* TO <l_tab>.
Create workarea
CREATE DATA l_line LIKE LINE OF <l_tab>.
ASSIGN l_line->* TO <l_wa>.
CASE r_ucomm.
When a record is selected
WHEN '&IC1'.
Read the selected record
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
rs_selfield-tabindex.
IF sy-subrc = 0.
Store the record in an internal table
APPEND <dyn_wa> TO <l_tab>.
Fetch the field catalog info
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'Z_DEMO_PDF_JG'
i_structure_name = p_table
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc = 0.
Make all the fields input enabled except key fields
w_field-input = 'X'.
MODIFY i_fieldcat FROM w_field TRANSPORTING input
WHERE key IS INITIAL.
ENDIF.
Display the record for editing purpose
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_structure_name = p_table
it_fieldcat = i_fieldcat
i_screen_start_column = 10
i_screen_start_line = 15
i_screen_end_column = 200
i_screen_end_line = 20
TABLES
t_outtab = <l_tab>
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
Read the modified data
READ TABLE <l_tab> INDEX 1 INTO <l_wa>.
If the record is changed then track its index no.
and populate it in an internal table for future
action
IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
<dyn_wa> = <l_wa>.
i_index = rs_selfield-tabindex.
APPEND i_index.
ENDIF.
ENDIF.
ENDIF.
When save button is pressed
WHEN 'SAVE'.
Sort the index table
SORT i_index.
Delete all duplicate records
DELETE ADJACENT DUPLICATES FROM i_index.
LOOP AT i_index.
Find out the changes in the internal table
and populate these changes in another internal table
READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
IF sy-subrc = 0.
APPEND <dyn_wa> TO <dyn_tab_temp>.
ENDIF.
ENDLOOP.
Lock the table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc = 0.
Modify the database table with these changes
MODIFY (p_table) FROM TABLE <dyn_tab_temp>.
REFRESH <dyn_tab_temp>.
Unlock the table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
mode_rstable = 'E'
tabname = p_table.
ENDIF.
ENDCASE.
rs_selfield-refresh = 'X'.
ENDFORM. "user_command
Regards,
Joy.
Maybe you are looking for
-
Need Material Classification data function module
Hi all, i have requirement to fetch material classification data through function module. is there any point to know releted function modules of classification data of material data. Thanks in advance, Bhaskar
-
Waveform data could contaminate x axis display in waveform chart?
Hello Please take a look at this vi: Attachments: Real-Time Chart.vi 19 KB
-
Browser crashing Macbook, I think
Hi everyone, My Macbook is crashing multiple times per day. It seems to correlate to when I have a browser open, and happens in both Safari and Firefox. I get the beachball for a few seconds (during which I can still switch programs) and then the com
-
Hello I'm getting The FileNotFoundException when i try to read an html file. Here is my code: * To change this template, choose Tools | Templates * and open the template in the editor. package query; import java.io.BufferedReader; import java.io.File
-
Has anyone been approved for a Prosper loan, had it funded and then been stuck in the employment/salary/bank owner verification process for what seems like forever? My loan was funded Friday evening and the documents have been with them since then.