How to EDIT a particular Row in ALV using normal function module Reuse_alv_grid_display
Hi experts..
i got one requirement like i need to edit some rows particularly in alv....
Edit in alv output....is it possible to get that .....using normal function module with out using oops concept...
could any one pls help me...
Hi Pendurti ,
If you want a particular field to be editable , simply define the fieldcatalog as
wa_fieldcatalog-edit = 'X'.
wa_fieldcatalog-input = 'X'.
for that field.
and
Now when you use FM ' Reuse alv grid display '
define USER_COMMAND
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = int_fieldcatalog
is_layout = wa_layout
TABLES
t_outtab = t_disp.
and now in form USER_COMMAND ; code as per following
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
endform.
Regards,
Yogendra Bhaskar
Similar Messages
-
How to delete a particular row in ALV table
Hi,
How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
Thanks
Bala DuvvuriHello Bala,
Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
data : lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_config TYPE REF TO cl_salv_wd_config_table.
lr_table_settings ?= lr_config.
** Setting the ALV selection to multiple selection with no lead selection
lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
Next delete the selected rows in the action triggered by the button:
METHOD onactiondelete_rows .
DATA: wd_node TYPE REF TO if_wd_context_node,
lt_node1 TYPE ig_componentcontroller=>elements_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set,
row_number TYPE i VALUE 0.
wd_node = wd_context->get_child_node( name = 'NODE' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
CALL METHOD wd_node->get_static_attributes_table
EXPORTING
from = 1
to = 2147483647
IMPORTING
table = lt_node1.
wd_node->bind_table( new_items = lt_node1 ).
ENDMETHOD.
If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
Regards,
Uday -
How to edit a particular row in the table ctrl when a push button is clickd
Hi Experts,
How to edit a particular row (except the Primary keys) after selecting it in the TABLE CONTROL when a
push button is clicked in the table control.
For Eg. If you have a push button say "Modify", the particular row what we select in the table control should be in a
editable mode after clicking "Modify" Push button.
Please help me out.
Thanks in advance.Hey Ram,
Thanks a ton.
Its working fine...sorry for the late reply.
The reason behind the delay is because i had modified my code as per your logic it worked fine but the thing is that the whole column was in editable mode but not a single row.
For E.g If i want to edit a particular row, first i select the row and then click on "Modify" button. After i click on the button, the whole column gets in a editable mode including the one which i intentionally selected.
Here, the solution is that you have to set a flag in PBO so that once it is done with PBO then it need not come back again after we click on "Modify" button.
And one more query is that after you modify a particular row in the table control ( When it is in editable mode) and click on the "Save" button, it is not getting updated to database.
To update the database, we need to select the row once again after modifying it and click on the "Save" button.
Here, database is updating only when it is selected again. If it is not selected, it is not getting updated.
If you have any alternative solution, then please help me out.( I hope i am clear with the question.)
Thanks,
Ananth. -
How to insert WorkBench Request to a domain using a function Module...
Dear ALL,
I am creating a program where I have created a domain using a Function Module and assigned the same domain to a package using a Function Module. Now I want to assign the domain to a WorkBench Request...Can anyone tell me of a Function Module to achieve the same??? Please note that the WorkBench Request is entered by the user on the Selection-Screen.
Moderator message: please do not open multiple threads for the same issue, rather follow up (or bump up) on existing ones.
Edited by: Thomas Zloch on Dec 15, 2010 1:18 PMHi Anjali,
Thanks for the response.
I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
for compatibility: clear administration data of data records
perform data_records_wipe
tables
t_data_records.
FORM DATA_RECORDS_WIPE
TABLES
T_DATA_RECORDS_IN STRUCTURE EDIDD.
LOOP AT T_DATA_RECORDS_IN.
CLEAR: T_DATA_RECORDS_IN-MANDT,
T_DATA_RECORDS_IN-DOCNUM,
T_DATA_RECORDS_IN-SEGNUM,
T_DATA_RECORDS_IN-PSGNUM,
T_DATA_RECORDS_IN-HLEVEL.
modify t_data_records_in.
ENDLOOP.
ENDFORM. " DATA_RECORDS_WIPE
This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
I need to create INBOUND Idocs with the data in ABAP program.
Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
Regards -
How to edit only some rows in ALV
Hi Experts,
I have editable ALV. I need to allow edit only for some rows, not generaly all of them.
Do you have any idea how to do it?
I use ALV through FM module REUSE_ALV_GRID_DISPLAY.
Thenks®ards,
JirkaHi,
You need to use events. Sample code from sdn.
TYPE-POOLS:SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
data: begin of it_chg occurs 0,
index type sy-tabix,
end of it_chg.
DATA: X_EVENTS TYPE SLIS_ALV_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
NAME(10) TYPE C,
ZTERM TYPE C,
END OF ITAB.
PERFORM FILL_TABLE.
loop at itab where zterm = 'A'.
it_chg-index = sy-tabix + 3.
" addition 3 IS FOR FIELD LABELS
append it_chg.
clear it_chg.
endloop.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
**fieldcatalog
X_FIELDCAT-FIELDNAME = 'NAME'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'ZTERM'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
**events
REFRESH:IT_EVENTS.
CLEAR:X_EVENTS,IT_EVENTS.
X_EVENTS-NAME = SLIS_EV_END_OF_LIST.
X_EVENTS-FORM = 'MODIFY_LIST'.
APPEND X_EVENTS TO IT_EVENTS.
CLEAR X_EVENTS.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = ITAB
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.
*& Form FILL_TABLE
text
FORM FILL_TABLE.
ITAB-NAME = 'vijay'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ABC'.
ITAB-ZTERM = 'B'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'TEST'.
ITAB-ZTERM = 'C'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'DILIP'.
ITAB-ZTERM = 'D'.
APPEND ITAB.
clear itab.
ITAB-NAME = '123'.
ITAB-ZTERM = 'E'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'GEN'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ALV'.
ITAB-ZTERM = 'F'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ALVTEST'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ENDFORM. "FILL_TABLE
*& Form MODIFY_LIST
text
FORM MODIFY_LIST.
data: l_lines type i.
describe table itab lines l_lines.
L_LINES = L_LINES + 3.
"because we have 3 lines extra occupied by lables.
"if we have header,i mean top of page add the no.of lines
"how many ever top of page have + 3 for labels.
DO L_LINES TIMES.
read table it_chg with key INDEX = sy-index.
if sy-subrc = 0.
**This code is for reading the out put line
**and modify accordinlg to our requiremnet.
**don't chnage this.
READ LINE SY-INDEX INDEX SY-LSIND.
IF SY-SUBRC = 0.
MODIFY LINE SY-INDEX INDEX SY-LSIND
FIELD FORMAT ITAB-NAME INPUT.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. "MODIFY_LIST -
How to release a transport request with warnings using a function module?
Hi,
I want to release a transport request(which has some warnings) using some function module .
The warnign that i get when i try to release the Transport Request manually is "not all objects could be locked..."
Which function module can I use so i can release such a transport request?
I am currently using TR_RELEASE_REQUEST but I am unable to release the TR, it throws an exception.
Also i wouls assume that the function module mentioned would take care of releasing all the unreleased task
under the request.
Regards,
Bikash.Hello Bikash
As an alternative (to cope with the warnings) you may use TRINT_RELEASE_REQUEST.
However, since this fm offers only a single task/request as IMPORTING parameter you need to take care about unreleased tasks yourself. Looking at SE09/SE10 even there you do not have the option the release a request including all its tasks.
Regards
Uwe -
How to change Vendor text in shopping cart using BADI/Function module
Hi
If any could help me out that i want to change vendor text using BADI/FMs.
Using BADI" bbp_catalog_transfer" i dint find any parameter for vendor text. please let me know if there any idea to resolve the problemHi,
you should find the vendor text within the BAdi
BBP_DOC_CHANGE
Method for shopping carts
BBP_SC_CHANGE
Here you could use the Changing Parameter
CT_LONGTEXT
The table contains 2 important fields:
TDID, where you can identify the type of text, in your case this should be ITXT for standard shopping carts (vendor text within positions)
TDLINE: which contains the text
You are now able to change the vendor text directly within this BAdi with standard ABAP methods.
Best regards
Andreas -
Hiding a particular row in ALV
Hi can anyone please tell me how to hide a particular row in ALV grid display depending upon certain value
Actually iam displaying values of an consignment idoc in the ALV grid but i don't want to display a particular segment of that idoc in ALV.Like i have an idoc with E1MBXYH segment and E1MBXYI segment sometimes this E1MBXYI segment will have ZSADATI segment.In this case i want to hide zsadati segment in ALV but
i need some values in ZSADATI segment so i just want to hide it.Can you please help me -
Grey out a particular row in ALV based on some condition.
Hi All,
How can we grey out the particular row in ALV based on some condition( I am using the function modules and not OOPS).
Regards
Ramesh.Hello Ramesh
In this case you need to add a specific field to your structure:
TYPES: BEGIN OF ty_s_outtab.
INLCUDE TYPE <my table or structure>.
TYPES: CELLTAB TYPE lvc_t_styl. " name is arbitrary but this one is most frequently used
TYPES: END OF ty_s_outtab.
DATA: gt_outtab TYPE STANDARD TABLE OF ty_s_outtab
WITH DEFAULT KEY.
You can use the fieldcatalog to make an entire column non-editable (LVC_S_FCAT-EDIT = ' ' ).
However, in case of rows you need to inactivate all cells of this row. For sample coding please refer to thread:
How to conditionally set ALV field as hotspot
Regards
Uwe -
Deactivate the double click/ hot spot for a particular row in alv grid.
Hello,
As per a certain condition how to deactivate the double click/ hot spot for a particular row in alv grid.
Regards,
Sarojwhere u define layout there is a field hotspot.like
data: var.
if con is true
var = 'X'. (show hotspot)
else.
var = ' '. (deactive hotspot)
elseif ws_fieldcat-fieldname = 'DMBTR'
AND ws_fieldcat-tabname = 'T_MTAB'.
ws_fieldcat-do_sum = C_X.
<b>ws_fieldcat-hotsopts = var.</b>
MODIFY Wt_fieldcat FROM ws_fieldcat
TRANSPORTING DO_SUM.
It is helpful for u. if any problen send me ur coding i will change it.
Regards
Manish Kumar -
Editing a particular row in a table - Web Dynpro Abap
Hi all,
My scenario is, I have to fetch contract details from EKPO table when I enter the Purchase Document Number and press SUBMIT button on my interactive form. The details will be displayed in a table.
This part is working fine.
Then, out of the displayed rows in that table, I have to click one of the rows. This particular row should appear as a separate row below the existing table. Here I will edit certain fields and update the database.
My question is, How to display that particular row below the existing table which I select. The table will dynamically increase the row size depending on the records.Hi Surya,
You can use the index property to display the selected row data.
Suppose your form structure is like:
BodyPage
TBL_EKPO
DATA
EBELN
EBELP
LOEKZ
SF_SELECTED_ROW_DISPLAY
EBELN
EBELP
LOEKZ
Then, in any of the field's exit event you can write:
BodyPage.SF_SELECTED_ROW_DISPLAY. EBELN.rawValue = xfa.resolveNode( " BodyPage.TBL_EKPO.DATA["+ this.parent.index +"].EBELN").rawValue;
Hope this helps.
Amit -
Changing font size(bold) or color of a particular row in ALV Grid Digplay
Hi Experts ,
I am having a requirment to highlight some particular rows in ALV Grid Display . To achieve this i need to change font size or make it bold or change color of that row .
Please give me some inputs .
Thanks in Advance.
VijyetaHi
Coloring An Entire Row
Coloring a row is a bit (really a bit) more complicated. , you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row.
First you have to declaration of our list data table u201Cgt_listu201D.
DATA BEGIN OF gt_list OCCURS 0 .
INCLUDE STRUCTURE SFLIGHT .
DATA rowcolor(4) TYPE c .
DATA END OF gt_list .
Adding the field that will contain row color data
As you guess, you should fill the color code to this field. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field u201CINFO_FNAMEu201D of the layout structure.
e.g.
ps_layout-info_fname = <field_name_containing_color_codes>. u201Ce.g. u2018ROWCOLORu2019
You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
Try this link also:
Possible functionalities in ALV
Regards
Neha -
How to color a complete row in ALV.
Hi,
My report program is as follows.
1. I have to display entries of an internal table in a ALV list using the Function Module 'REUSE_ALV_LIST_DISPLAY' in which on of the columns is a check box.
2. on displaying the output, the check box is clicked and a button(PF_Status) in application toolbar is clicked.
3. In the at user-command i need to change the contents of the row selected and change the colour of the complete selected line to green.
My problem is i am able to change the contents but <b>am not able to change the colour of the entire row to green</b>.
Only selected row should change to green all other lines remain as they were.
is it possible in ALV, as far as i know we use EMPHAISZE of fieldcatalog to colour a complete column but i want to colour only a particuler row. Please provide me help on this.
Thanks in advance for your ESTEEMED replies.
with warm regards,
Raghavendra Goutham.Hi,
Got this from forum
report .
Use of colours in ALV grid (cell, line and column) *
Table
tables : mara.
Type
types : begin of ty_mara,
matnr like mara-matnr,
matkl like mara-matkl,
counter(4) type n,
free_text(15) type c,
color_line(4) type c, " Line color
color_cell type lvc_t_scol, " Cell color
end of ty_mara.
Structures
data : wa_mara type ty_mara,
wa_fieldcat type lvc_s_fcat,
is_layout type lvc_s_layo,
wa_color type lvc_s_scol.
Internal table
data : it_mara type standard table of ty_mara,
it_fieldcat type standard table of lvc_s_fcat,
it_color type table of lvc_s_scol.
Variables
data : okcode like sy-ucomm,
w_alv_grid type ref to cl_gui_alv_grid,
w_docking_container type ref to cl_gui_docking_container.
parameters : p_column as checkbox,
p_line as checkbox,
p_cell as checkbox.
at selection-screen output.
perform get_data.
perform fill_catalog.
if w_docking_container is initial.
perform create_objects.
endif.
*& Form create_objects
form create_objects.
create object w_docking_container
exporting
ratio = 60
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
create object w_alv_grid
exporting
i_parent = w_docking_container.
Field that identify color line in internal table
move <b>'COLOR_LINE'</b> to is_layout-info_fname.
Field that identify cell color in inetrnal table
move <b>'COLOR_CE</b>LL' to is_layout-ctab_fname.
call method w_alv_grid->set_table_for_first_display
exporting
is_layout = is_layout
changing
it_outtab = it_mara
it_fieldcatalog = it_fieldcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
endform.
*& Form get_data
form get_data.
select * from mara up to 5 rows.
clear : wa_mara-color_line, wa_mara-color_cell.
move-corresponding mara to wa_mara.
add 1 to wa_mara-counter.
move 'Blabla' to wa_mara-free_text.
if wa_mara-counter = '0002'
and p_line = 'X'.
<b>Color line</b> move 'C410' to wa_mara-color_line.
elseif wa_mara-counter = '0004'
and p_cell = 'X'.
<b>* Color cell</b>
move 'FREE_TEXT' to wa_color-fname.
move '6' to wa_color-color-col.
move '1' to wa_color-color-int.
move '1' to wa_color-color-inv.
append wa_color to it_color.
wa_mara-color_cell[] = it_color[].
endif.
append wa_mara to it_mara.
endselect.
endform.
*& Form fill_catalog
form fill_catalog.
Colour code : *
Colour is a 4-char field where : *
- 1st char = C (color property) *
- 2nd char = color code (from 0 to 7) *
0 = background color *
1 = blue *
2 = gray *
3 = yellow *
4 = blue/gray *
5 = green *
6 = red *
7 = orange *
- 3rd char = intensified (0=off, 1=on) *
- 4th char = inverse display (0=off, 1=on) *
Colour overwriting priority : *
1. Line *
2. Cell *
3. Column *
data : w_position type i value '1'.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATNR' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATNR' to wa_fieldcat-ref_field.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATKL' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATKL' to wa_fieldcat-ref_field.
Color column
if p_column = 'X'.
move 'C610' to wa_fieldcat-emphasize.
endif.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'COUNTER' to wa_fieldcat-fieldname.
move 'N' to wa_fieldcat-inttype.
move '4' to wa_fieldcat-intlen.
move 'Counter' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'FREE_TEXT' to wa_fieldcat-fieldname.
move 'C' to wa_fieldcat-inttype.
move '20' to wa_fieldcat-intlen.
move 'Text' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
endform.
Check this link to get code for different colors http://www.sapdesignguild.org/resources/ma_guidelines/VisualDesignRules/colors.html
Try this out the same thing will work for Reuse also.
Thanks & Regards,
Judith. -
How 2 create coloumns and rows in smartforms using template????
How to create coloumns and rows in smartforms using template????...
Kindly explain in details.......
Regards,
Faiz
Moderator message: please search for available information.
Edited by: Thomas Zloch on Mar 5, 2012Hi JV,
Yes you can create rows dynamically in a table in IF. You can follow the instruction in [this link|Re: Dynamic Table - same data repeating in all rows] to create the dynamic table.
Also refer to these links:
[Data in dynamic table not pass to webdynpro java|https://forums.sdn.sap.com/click.jspa?searchID=16436680&messageID=5638776]
[DYNAMIC TABLE IN WEBDYNPRO INTERACTIVE FORM|https://forums.sdn.sap.com/click.jspa?searchID=16436680&messageID=5775811]
Hope this helps!!
Regards,
Arafat -
How to hide a table row in pdf using javascript?
How to hide a table row in pdf using javascript?
This is only possible with LiveCycle Designer forms, not PDF forms created
in Acrobat.
Maybe you are looking for
-
Error while creating Campaign in CRM
Hi all, When I am trying to create Campaign in CRM, system is throwing an error saying that "Can not get RFC destination for SEM". We are not using SEM in our project. Can anybody suggest me how to avoid/rectify this error? points will be guaranteed.
-
Form issues in Adobe Pro for Macs
Can someone tell me how to solve an issue regarding Adobe Pro 9 for Macs? I have developed forms in Adobe Pro 9 but they can not be viewed in Adobe but can be viewed in Preview. How can this issue be corrected?
-
Download spool and convert it to pdf in background job
Hello experts, RSTXPDFT4 works fine for me if i want to convert spools to pdf files in foreground mode. If i want to do this in background mode as a daily job i am not able to use RSTXPDFT4. With report RSTXPDFT5 i am able to download in background a
-
Restore everything but OSX for fresh install
I am looking to do a fresh install of OSX to Leopard from Tiger. Is there any way I can restore everything from the Time Capsule EXCEPT the operating system - so that I can keep the fresh 10.5.8 install, but have all the rest of my programs/files bac
-
Bluetooth doesnt work since tiger to leopard.
hello everybody! i am new at this forum, so i am apologizing, if its the wrong place to post my messenge! but i got a problem with bluetooth, i cant send anything from my phone to my macbook.. before i had tiger and it worked fine, but now, with leop