Update values in AlV grid display after entering value
Hi,
I have an issue in ALV grid display.
Let me explain.
i have 8 fields to display in which one is editiable.
Fields are: date
material,
material Description,
Opening Stock,
Closing stock- ( this field is editiable)
Closing stock,
Received Stock,
Actual production.
Actual production = Closing stock + removal stock
- receipt stock - opening stock.
when i change the value of closing stock and press enter, actual production should get update, the new values should display.
Thany you in advance.
Hi,
Please refer the code below:
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
Thanks,
Sriram Ponna.
Similar Messages
-
How to give a page break in alv grid display after 65 lines are displayed?
hi all,
I need to give a page break in alv grid display after 65 lines are displayed on each page...Please help me with this...hai
give this command beging of the report name... u have to diclar the beging of the report ......
<b>report</b> ( name of the report) <b>standard page heading line-size 200 line-count 65.</b>
ex1.:- report name is rtpm_trl_show_flows
report <b>rtpm_trl_show_flows </b> no standard page heading line-size 200
line-count 65.
ex:2
report <b>zlpur01</b> no standard page heading line-size 200
line-count 65.
type-pools: slis.
tables: bkpf.
selection-screen begin of block sel with frame title text-001.
select-options: s_comp for bkpf-bukrs, " Company
s_valut for bkpf-budat. " Invoice Date
S_MTART FOR MARA-MTART. " Material Type
selection-screen end of block sel.
parameters: p_vari like disvariant-variant. " ALV Variant
constants: formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
data: i_bseg type bseg occurs 0 with header line.
data: vatval type p decimals 2 value '0.15'.
data: xhkont type string value '154000'.
data COM type c.
data: begin of invt occurs 100,
budat like bkpf-budat, " Inv Dat
bukrs like bkpf-bukrs, " Material
STCEG like bsak-STCEG, "name of the companycode
belnr like bkpf-belnr,
xblnr like bkpf-xblnr, " Inv Reference
ebeln like rseg-ebeln, " PO number
lifnr like bseg-lifnr, " Vendor No
name1 like lfa1-name1, " Supplier Name
matnr like bseg-matnr,
maktx like makt-maktx,
stcd1 like lfa1-stcd1, " Supplier VAT REG NO
xamt like bseg-dmbtr, " TAX amt
yamt like bseg-wrbtr,
wrbtr like bseg-wrbtr, " Base amount
mwskz like bseg-mwskz,
dmbtr like bseg-dmbtr, " TAX amt
gjahr like bkpf-gjahr,
hkont like bseg-hkont,
zamt like bseg-dmbtr, " TAX amt
wamt like bseg-dmbtr,
shkzg like bseg-shkzg,
shkzg1 like bseg-shkzg,
end of invt.
regard
nawa -
Row seperator in the ALV grid display after the various highest level prod.
Hi,
I have a requirement like user wants a row seperator against the various high level products (Each parent material)in ALV Grid display.We made this change but quantity and pricey fields showing the zero's in the blank line.i know that if we use NO-ZERO
in the ALV field catalog , we can remove the zero's from blank line. But other zerou2019s will remove from rest of the line items. User want's the zero's in other line items, but not in the blank line.
We can convert packed fileds into character format, but this will effect to the summing the quantity, price coumns.
If any body have idea on above mentioned.
Regards,
SK.Hi Suresh,
There is no short cut for this requirement. You have to do following steps.
1. Change the data type of column to char.
2. Programatically find the totals.
Reagards,
Anversha -
Update all alv (grid) displayed records to internal table
Hi all,
i want to update the records into the internal table which are changed by the user in the edit field.
after he select save button.
i have to save the ALV grid displayed records in the internal table.
hw can i do this ?ALV with EDIT and SAVE functionality
Code: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 -
Hi, coding to display popup window after first alv grid display
hi
can anybody please send coding to display popup window after first alv grid display i.e. first the prog shows grid display and from grid display the user select the field and on the basis of field value i need to show pop up window in the first secondary window and then third popup window.
thanx
rockyHi rocky,
here is the sample code .hope this helps you.
TYPE-POOLS : SLIS.
DATA : GT_OUTTAB TYPE VBAK OCCURS 0,
GS_PRIVATE TYPE SLIS_DATA_CALLER_EXIT,
GS_SELFIELD TYPE SLIS_SELFIELD.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : ITAB TYPE TABLE OF SLIS_SELFIELD,
WA_ITAB LIKE LINE OF ITAB.
START-OF-SELECTION.
PERFORM POPULATE_GT_OUTTAB.
PERFORM GET_POPUP.
PERFORM POPULATE_ITAB.
PERFORM FIELDCAT.
PERFORM DISPLAY_DETAILS.
*& Form FIELDCAT
text
--> p1 text
<-- p2 text
FORM FIELDCAT .
LOOP AT ITAB INTO WA_ITAB.
WA_FIELDCAT-FIELDNAME = 'TABINDEX'.
WA_FIELDCAT-TABNAME = 'WA_ITAB'.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-SELTEXT_L = 'TABLE INDEX'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'SEL_TAB_FIELD'.
WA_FIELDCAT-TABNAME = 'WA_ITAB'.
WA_FIELDCAT-COL_POS = 2.
WA_FIELDCAT-OUTPUTLEN = 20.
WA_FIELDCAT-SELTEXT_L = 'FIELD NAME'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'VALUE'.
WA_FIELDCAT-TABNAME = 'WA_ITAB'.
WA_FIELDCAT-COL_POS = 3.
WA_FIELDCAT-SELTEXT_L = 'FIELD VALUE'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
ENDLOOP.
ENDFORM. " FIELDCAT
*& Form POPULATE_GT_OUTTAB
text
--> p1 text
<-- p2 text
FORM POPULATE_GT_OUTTAB .
SELECT * FROM VBAK
UP TO 10 ROWS
INTO TABLE GT_OUTTAB.
ENDFORM. " POPULATE_GT_OUTTAB
*& Form GET_POPUP
text
--> p1 text
<-- p2 text
FORM GET_POPUP .
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
I_TITLE = 'SALES ORDER'
I_SELECTION = 'X'
I_ALLOW_NO_SELECTION =
I_ZEBRA = 'X'
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_CHECKBOX_FIELDNAME =
I_LINEMARK_FIELDNAME =
I_SCROLL_TO_SEL_LINE = 'X'
I_TABNAME = 'SALES ORDER'
I_STRUCTURE_NAME = 'VBAK'
IT_FIELDCAT =
IT_EXCLUDING =
I_CALLBACK_PROGRAM =
I_CALLBACK_USER_COMMAND =
IS_PRIVATE = GS_PRIVATE
IMPORTING
ES_SELFIELD = GS_SELFIELD
E_EXIT = G_EXIT
TABLES
T_OUTTAB = GT_OUTTAB
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. " GET_POPUP
*& Form POPULATE_ITAB
text
--> p1 text
<-- p2 text
FORM POPULATE_ITAB .
WA_ITAB-TABNAME = GS_SELFIELD-TABNAME.
WA_ITAB-TABINDEX = GS_SELFIELD-TABINDEX.
WA_ITAB-SEL_TAB_FIELD = GS_SELFIELD-SEL_TAB_FIELD.
WA_ITAB-VALUE = GS_SELFIELD-VALUE.
APPEND WA_ITAB TO ITAB.
ENDFORM. " POPULATE_ITAB
*& Form DISPLAY_DETAILS
text
--> p1 text
<-- p2 text
FORM DISPLAY_DETAILS .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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.
ENDFORM. " DISPLAY_DETAILS
award points if helpful.
regards,
deepthi reddy -
EDIT THE FIELV VALUE IN ALV GRID DISPLAY
Hi Guru ,
How can I edit the value of a particular one or two fields in ALV GRID DISPLAY .
Please reply mehi,
1.Set status of all cells to editable using the layout structure.
2.Use SET_READY_FOR_INPUT to activate the edit feature initially.
(state "editable activated").
3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
4.Use SET_READY_FOR_INPUT to switch between the substates.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_layout = gs_layout
CHANGING it_outtab = gt_outtab.
*§2.Use SET_READY_FOR_INPUT to allow editing initially.
* (state "editable and ready for input").
CALL METHOD g_grid->set_ready_for_input
EXPORTING i_ready_for_input = 1.
*Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
IF g_grid->is_ready_for_input( ) EQ 0.
*Use SET_READY_FOR_INPUT to switch between the substates.
CALL METHOD g_grid->set_ready_for_input
EXPORTING i_ready_for_input = 1.
ELSE.
CALL METHOD g_grid->set_ready_for_input
EXPORTING i_ready_for_input = 0.
ENDIF. -
I used to update my iPhone 4S applications whenever a new update is available, but at this time, "unknown error" displays after entering my apple id password. Anyone who could help, whom they might have experienced? Thanks
Hi Christianjr,
When you say you reset your network settings, what do you mean, exactly?
I saw another post on this issue, and the poster indicated that they resolved the problem by turning off their cellular date option and wifi options in Settings, and then turned them back on.
Also, resetting your phone may help - press the Home and Power buttons at the same time and continue to hold both down until the Silver Apple appears. Once it is back up, click on the update option and see if it fixes the problem.
If none of those things work, then need to have details on what you did to reset your network settings....
Cheers,
GB -
How to merge rows with similar values in alv grid display in webdynpro
Hi experts,
i want to know about how to merge rows with similar values in alv grid display of webdynpro.grouping rows is possible in table display in webdynpro but i am not able to do row grouping in the alv grid display in webdynpro.
kindly suggest.
thanks ,
Anita.Hi Anita,
did you find a solution for this? I have opened a Thread, if you know the answer maybe you could help me out:
Is there an ALV function similar to the TABLE Row grouping?
Thanx in advanced!!!
Kind Regards,
Gerardo J -
Text after end of each type in ALV GRID DISPLAY
Hi Experts,
My Requirement is that after end of every order type I need to give the text to display how many records are there under that order type in ALV GRID DISPLAY.
Sample internal table is shown below
Ordertyp date
PM1 25/05/2010
PM1 25/05/2010
PM2 25/05/2010
PM2 25/05/2010
PM2 25/05/2010
PM2 25/05/2010
Out put should be as shown below
PM1 25/05/2010
PM1 25/05/2010
Total PM1 order types are 2
PM2 25/05/2010
PM2 25/05/2010
PM2 25/05/2010
PM2 25/05/2010
Total PM2 Order types are 4
Total all order types are 6.
Please note here I am not doing any subtotal, just I want to display how many records are there under that particular order
Thanks
Babumiya MohammadHi,
whatever it may be you can very well use the given logic to build.
Let say you are making the final table for display. While final table display make the process and append the data in final table itself and pass it to ALV.
LOOP AT ITAB.
ITAB1-FLD1 = ITAB-FLD1
ITAB1-FLD2 = ITAB-FLD2
APPEND ITAB1.
*For making the count
L_Cnt = L_cnt + 1.
At end of OrdTYP
L_ord_text = L_cnt.
MOVE L_ORD_TEXT to L_SUB_TEXT.
L_TEXT1 = '' TOTAL"
L_TEXT2 = "Order types are"
concatenate L_TEXT ITAB-ORDTYP L_TEXT2 L_ord_text into l_TOT1.
ITAB1- FLD2 = L_TOT1.
APPEDN ITAB1.
clear : L_cnt, L_ord_text .
ENDLOOP.
L_TOT_TEXT = L_TOT_TEXT + L_SUB_TEXT ( Here you will get total order type count)
Do the conactenate
L_TEXT3 = " Total all order types are"
concatenate L_TEXT3 L_TOT_TEXT INTo L_TOT2.
ITAB1-FLD2 = L_TOT2.
APPEND IATB1.
Here you will total text. Like above you can build the logic. It will work fine.
You should not clear the L_SUB_TEXT. -
Hi,
I'm modifying a program with ALV Grid Display.There are lot of Classes and Methods which i don't understand.
In my program, the Program is executes and displays an Output. Now in the O/P , when I dbl click a field of a row a POP up is displayed with the existing value.now i can edit this value or Update with a new value.After closing the POP up the edited valueor the new value is displayed in the field. The program works good upto here.Now if my O/P has 20 Pages and if i edit a field in the 18 page, then after closing the popup the cursor ( or display ) is displayed in the 1 page( the 1 page of the O/P is displayed). Now, again, if i want to edit a field in the 18 page i have to scroll to the 18 page. Is there any way to hold the display at the 18 page after closing the POPUP.
I arrived at using CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id
EXPORTING
IS_ROW_ID = <structure of type LVC_S_ROW >
IS_COLUMN_ID = <structure of type LVC_S_COL >
IS_ROW_NO = <structure of type LVC_S_ROID >.
can some one help me how to pass values to is_row_id and all the parameters.
Is there any other way?Thanks in advance.
Thanks,
Bhaskar.Dear Bhaskar,
To acheieve this follow the below steps:
1. On double click first get the scroll information using the method GET_SCROLL_INFO_VIA_ID of class CL_GUI_ALV_GRID.
CALL METHOD go_alv_grid->get_scroll_info_via_id
IMPORTING
es_row_no = gv_s_roid
es_row_info = gv_s_row
es_col_info = gv_s_col.
2. Again at the end of your double click event call the method SET_SCROLL_INFO_VIA_ID to set the scroll.
CALL METHOD go_alv_grid->set_scroll_info_via_id
EXPORTING
is_row_info = gv_s_row
is_col_info = gv_s_col
is_row_no = gv_s_roid.
Regards
Kesava -
Re: alv grid display.
Hi All,
I have a final alv grid display and i have two fields which are edited by clicking the EDIT button given on the output PF-Status.
now i want to disable this EDIT button when the user changes the value of these two fields. after which user presses the save button to save the updated list.
Please let me know any method or any parameter which has to be passed or any SAMPLE CODE to do this.
satisfactory answers will be rewarded.
Thanks,
NaveenTry this to deactivate the button..
Set pf-status 'STATUS' excluding itab. <---Populate the itab with EDIT Button
double click on STATUS, goto -> attributes -> push button assignment -> display all.
Now when you use the excluding itab the buton gets deactivated but not completely removed
As your requirement is when the field gets changed
IF ... <---------------Write the condition here if the field get changed
Set pf-status 'STATUS' excluding itab
else.
Set pf-status 'STATUS'.
endif. -
Dump when summing up CURR field in ALV GRID display
Hi All,
I am getting dump when I try to sum the CURR field in my ALV Grid Display. The field is of CURR 23. I am using classes and methods to display alv grid.
I tried passing <fs_fieldcat>-do_sum = 'X'. When I did this, it is dumping without even displaying the alv grid.
Here is the part it is throwing dump:
ls_lvc_data-value = space.
clear ls_lvc_data-style.
loop at it_fcat_local assigning <ls_fcat>
where tech ne 'X' and no_out ne 'X'.
if l_invisible eq 'X'.
clear l_invisible.
if <ls_fcat>-do_sum is initial.
continue.
else.
clear ls_lvc_data-col_pos.
endif.
endif.
add 1 to ls_lvc_data-col_pos.
assign component <ls_fcat>-fieldname
of structure <ls_data> to <l_field_value>.
_if sy-subrc ne 0.
message x000(0k).
endif._
Regards,
GuruThomas,
Here is the dump:
Runtime Errors MESSAGE_TYPE_X
Date and Time 10/22/2010 23:30:53
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Error analysis
Short text of error message:
Long text of error message:
Technical information about the message:
Message class....... "0K"
Number.............. 000
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MESSAGE_TYPE_X" " "
"SAPLSLVC" or "LSLVCF36"
"FILL_DATA_TABLE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
Source Code Extract
Line
SourceCde
2708
is_subtottxt_info = ls_subtot_info
2709
ip_subtot_line = lr_data
2710
changing
2711
c_subtottxt = l_subtottxt.
2712
ls_lvc_data-value = l_subtottxt.
2713
2714
append ls_lvc_data to ct_lvc_data.
2715
endif.
2716
2717
2718
Column per Fieldcat Entry
2719
2720
ls_lvc_data-value = space.
2721
clear ls_lvc_data-style.
2722
loop at it_fcat_local assigning <ls_fcat>
2723
where tech ne 'X' and no_out ne 'X'.
2724
if l_invisible eq 'X'.
2725
clear l_invisible.
2726
if <ls_fcat>-do_sum is initial.
2727
continue.
2728
else.
2729
clear ls_lvc_data-col_pos.
2730
endif.
2731
endif.
2732
2733
add 1 to ls_lvc_data-col_pos.
2734
2735
assign component <ls_fcat>-fieldname
2736
of structure <ls_data> to <l_field_value>.
2737
if sy-subrc ne 0.
>>>>>
message x000(0k).
2739
endif.
2740
2741
*... work on average
2742
if <ls_fcat>-do_sum eq 'C'.
2743
Initialize average result and entries
2744
<l_field_value> = 0.
2745
clear l_entries.
2746
2747
retrive unit from fieldcatalog
2748
assign space to <l_unit>.
2749
if not <ls_fcat>-cfieldname is initial.
2750
assign component <ls_fcat>-cfieldname
2751
of structure <ls_data> to <l_unit>.
2752
endif.
2753
if not <ls_fcat>-qfieldname is initial.
2754
assign component <ls_fcat>-qfieldname
2755
of structure <ls_data> to <l_unit>.
2756
endif.
2757 -
Maximum number of character we can print in a column uing ALV grid display
Hi frnds,
My requirment is to print 500 charcter data in a column using ALV grid display.
Could any body tell me is it possible and the maximum character it can i print in a column using ALV grid dispaly.
Regards,
SandipanHi Sandipan,
refer notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters.
857823 - ALV grid: Strings with a maximum of 128 characters
Symptom
Entries in cells of the type CHAR or string are truncated after 128
characters in the SAP GUI.
also refer,
ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
(Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
Cause and Prerequisites
The data table that is sent to the front end only allows character values
with the length 128.
Solution
This is the standard system behavior and cannot be changed. -
Top of page in ALV GRID display
Hi All,
Is it possible to have a top of page in ALV grid display?
If yes, then how?
Thanks and Regards,
Sirishahi
check out the following code:
report z_alv2 line-count 20.
type-pools : slis.
type-pools : icon.
tables:
lfa1, lfb1, lfm1.
selection-screen begin of block b1 with frame title text-001.
select-options:
s_lifnr for lfa1-lifnr, "VENDOR
s_bukrs for lfb1-bukrs, "COMPANY CODE
s_ekorg for lfm1-ekorg, "PURCHASING ORGANIZATION
s_ktokk for lfa1-ktokk. "ACCOUNT GROUP
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-002.
parameters: r1 radiobutton group g1,
r2 radiobutton group g1.
selection-screen end of block b2.
data:
v_repid like sy-repid,
begin of itab occurs 0,
lifnr like lfa1-lifnr,
bukrs like lfb1-bukrs,
ekorg like lfm1-ekorg,
ktokk like lfa1-ktokk,
name1 like lfa1-name1,
stras like lfa1-stras,
ort01 like lfa1-ort01,
regio like lfa1-regio,
pfort like lfa1-pfort,
pstlz like lfa1-pstlz,
pstl2 like lfa1-pstl2,
telf1 like lfa1-telf1,
end of itab.
data : itab_event type slis_t_event,
wa_event type slis_alv_event.
data : itab_fld_cat type slis_t_fieldcat_alv,
wa_fldcat type slis_fieldcat_alv.
data : wa_layout type slis_layout_alv.
start-of-selection.
*PERFORM GET_VARIANT.
PERFORM data_validation.
perform select_data.
perform get_events using itab_event .
perform fieldcatmerge.
if r1 = 'X'.
perform alvlistdisplay.
elseif r2 = 'X' .
perform alvgriddisplay.
endif.
*& Form DATA_VALIDATION
text
--> p1 text
<-- p2 text
form data_validation .
data: v_count type i.
if s_lifnr is initial and
s_bukrs is initial and
s_ekorg is initial and
s_ktokk is initial.
message e000(z13325).
Enter any value in the Selection Screen
endif.
select count(*) from lfa1 where lifnr in s_lifnr.
if sy-subrc <> 0.
message e000(z13325).
Enter any value in the Selection Screen
endif.
select count(*) from lfb1 where lifnr in s_bukrs.
if sy-subrc <> 0.
message e000(z13325).
Enter any value in the Selection Screen
endif.
select count(*) from lfm1 where lifnr in s_ekorg.
if sy-subrc <> 0.
message e000(z13325).
Enter any value in the Selection Screen
endif.
select count(*) from lfa1 where lifnr in s_ktokk.
if sy-subrc <> 0.
message e000(z13325).
Enter any value in the Selection Screen
endif.
endform. " DATA_VALIDATION
*& Form SELECT_DATA
text
--> p1 text
<-- p2 text
form select_data .
select a~lifnr
b~bukrs
c~ekorg
a~ktokk
a~name1
a~stras
a~ort01
a~regio
a~pfort
a~pstlz
a~pstl2
a~telf1
into corresponding fields of table itab
from lfa1 as a inner join lfb1 as b
on alifnr = blifnr
inner join lfm1 as c
on alifnr = clifnr
where a~lifnr in s_lifnr
and b~bukrs in s_bukrs
and c~ekorg in s_ekorg
and a~ktokk in s_ktokk.
sort itab by lifnr bukrs ekorg.
endform. " SELECT_DATA
*& Form FIELDCATMERGE
text
--> p1 text
<-- p2 text
form fieldcatmerge .
v_repid = sy-repid.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = v_repid
i_internal_tabname = 'ITAB'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
changing
ct_fieldcat = itab_fld_cat
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. " FIELDCATMERGE
*& Form ALVLISTDISPLAY
text
--> p1 text
<-- p2 text
form alvlistdisplay .
v_repid = sy-repid.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
is_layout = wa_layout
it_fieldcat = itab_fld_cat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
I_SAVE = 'A'
IS_VARIANT =
it_events = itab_event
IT_EVENT_EXIT = itab_exit
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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.
endform. " ALVLISTDISPLAY
*& Form ALVGRIDDISPLAY
text
--> p1 text
<-- p2 text
form alvgriddisplay .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'GRID DISPLAY'
I_GRID_SETTINGS =
IS_LAYOUT = WS_LAYOUT1
it_fieldcat = itab_fld_cat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = itab_event
IT_EVENT_EXIT = itab_exit
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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.
endform. " ALVGRIDDISPLAY
*& Form GET_EVENTS
text
--> p1 text
<-- p2 text
form get_events using itab_event type slis_t_event.
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
importing
et_events = itab_event
exceptions
list_type_wrong = 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.
read table itab_event with key name = slis_ev_top_of_page into wa_event
if sy-subrc = 0.
wa_event-form = 'FRM_TOP_OF_PAGE'.
modify itab_event from wa_event index sy-tabix.
endif.
endform. " GET_EVENTS
*& Form FRM_TOP_OF_PAGE
text
form frm_top_of_page.
write : 130 'Time:' ,sy-uzeit .
write :/2 'User: ', sy-uname.
write: 59 sy-title, 130 'Page:' , sy-pagno.
write:/ 'this is swathi and this is top of page '.
endform. "FRM_TOP_OF_PAGE
Reward points if helpful.
Regards
Swathi -
Problem with check box in ALV Grid Display
I am Displaying Material Master Data in ALV Grid Display with Check Box for each record and if i checked check box then i am processing Update operation in Database, my question is after perform update operation check box should be clear.
Kindly help me!!!!Hello Raj
Given the fact that you do not tell us the most important piece of information (namely whether you are using OO-based ALV or not) I assume you are using fm-based ALV lists.
In this case you probably have defined a USER_COMMAND routine as described in the documentation of the fm.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* define local data
DATA: ls_outtab LIKE LINE OF gt_outtab,
ld_idx TYPE i.
LOOP AT gt_outtab INTO ls_outtab
WHERE ( chkbox = 'X' ).
ld_idx = syst-tabix.
" Call your update function / method / perform
ls_outtab-chkbox = space.
MODIFY gt_outtab FROM ls_outtab INDEX ld_Idx
TRANSPORTING chkbox.
ENDLOOP.
" And now trigger refresh of the ALV display:
rs_selfield-refresh = 'X'. " <<< !!!
ENDFORM.
Regards
Uwe
Maybe you are looking for
-
Massive IMAP problem, multiple iPhones - constant spinning wheel
A friend has had problems using email on his iPhone since he got it, and now after a couple of months of no problems, mine has started doing the same thing. The problem started for him on a UK 1.1.2 firmware iPhone with an IMAP account. If you start
-
I have just bought the iPad Air but cannot access the roots I have on my iCloud account. They do appear on my old ipad 2, any ideas how I can access them please
-
please help Problem description: slow responding iMac EtreCheck version: 2.1.6 (109) Report generated 25 de enero de 2015 13:35:15 GMT-6 Download EtreCheck from http://etresoft.com/etrecheck Click the [Support] links for help with non-Apple products.
-
I am having a a problem here: Map<Integer, String> map = new ArrayList<Integer, String>(); Collection<Integer> keys = map.keySet(); for(String id : categories) { if(Collections.binarySearch(keys, Integer.valueOf(id)) > 0) { some code...} While c
-
Expresion showing from stuff function in ssrs
I have a table in sql server database, a column in it is made up using the stuff function, when i try to create a report in ssrs using the query, the column shows up like this <Expr1>, 1</Expr1><Expr1>, 2</Expr1><Expr1>, 3</Expr1><Expr1>, 4</Expr1> .