‎2009 Mar 27 4:14 AM
Hi all,
I am developing a module program to allow the user to maintain price list for the product.
For this I am using a table control to display the existing price list. the list would be around 50 records.
Now, if the user modifies a single record in the table control list and goes to modify the second, third... records, I want to indicate/highlight(some icons) the changed line item/records. finally I want to update only the changed record/line item to the database table from the internal table.
Also, I want to display a status message when the user presses save button, if there is no changes made to the already listed values.
How can I achieve this?
Thanks,
Rajan
‎2009 Mar 27 5:07 AM
Hi,
The flow logic of your table control screen will be like:
PROCESS BEFORE OUTPUT.
MODULE STATUS_8001.
LOOP WITH CONTROL MOVIE. "movie is your table control name
MODULE PASS_DATA. "This module reads the data from the internal
"table into the table control
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_8001.
LOOP WITH CONTROL MOVIE.
MODULE DISPLAY_DATA. "This module will modify the table control
"changes back into the internal table
ENDLOOP.
******SCREEN 8001***READING DATA FROM MOVIE_TAB TO TABLE CONTROL********
MODULE PASS_DATA OUTPUT.
SORT MOVIE_TAB.
READ TABLE MOVIE_TAB INDEX MOVIE-CURRENT_LINE.
ENDMODULE. " GET_DATA OUTPUT.
******SCREEN 8001****MODIFYING INTERNAL TABLE FROM TABLE CONTROL********
MODULE DISPLAY_DATA INPUT.
* IF MOVIE_TAB-FLAG = 'X'.
MODIFY MOVIE_TAB INDEX MOVIE-CURRENT_LINE.
* ENDIF.
ENDMODULE. " DISPLAY_DATA INPUT
Hope it helps
Regards
Mansi
‎2009 Mar 27 4:19 AM
Rajan,
For each table control record fields, you must be using a work area to update or whatever action you are going to do.
I suggest you to have an extra field with a single character as a part of the above work area.
Now, loop on the table control and if any particular row is modified then modify the record and update the flag value as 'X'.
So, at the end you can track down all the records having the flag value as 'X' and update accordingly.
Hope this works out.
‎2009 Mar 27 5:01 AM
Hi babu,
My issue is
Now, loop on the table control and if any particular row is modified then modify the record and update the flag value as 'X'.
how to identify a particular row field(s) are/is modified??
Thanks,
Rajan
‎2009 Mar 27 5:18 AM
Rajan,
Mansi had provided with the code. It would be of help. Check that.
See, as you are maintaining the price list in a table control...whenever you click on particular row of the table control then flag would be updated as X.
Check SDN Forums for more help on this.
Edited by: Babu Kilari on Mar 27, 2009 6:23 AM
‎2009 Mar 27 9:01 AM
Rajan,
If you have got the solution by now. Close the thread by marking it as Answered.
Thanks,
Babu Kilari
‎2009 Mar 27 4:24 AM
Hi,
after modifying when the user presses the enter button. then the values from the values from the dynpro enters into ur program. there u can add ur icon...
PROCESS AFTER INPUT.
LOOP AT it_tab.
MODULE get_tab.
ENDLOOP.
MODULE get_tab INPUT.
DATA: wa_tab LIKE LINE OF it_tab.
READ TABLE it_tab
INTO wa_tab
INDEX tab1-current_line.
*-----------------------------------Updating Internal table from Screen*
IF sy-subrc = 0.
it_tab-icon = <icon>.
MODIFY it_tab INDEX tab1-current_line.
ELSE.
it_tab-icon = <icon>.
APPEND it_tab.
ENDIF.
*----------------------------------------------------------------------*
CLEAR: it_tab.
ENDMODULE. " GET_TAB INPUT
when performing save, just clear those icons....
‎2009 Apr 01 9:24 PM
‎2009 Mar 27 5:07 AM
Hi,
The flow logic of your table control screen will be like:
PROCESS BEFORE OUTPUT.
MODULE STATUS_8001.
LOOP WITH CONTROL MOVIE. "movie is your table control name
MODULE PASS_DATA. "This module reads the data from the internal
"table into the table control
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_8001.
LOOP WITH CONTROL MOVIE.
MODULE DISPLAY_DATA. "This module will modify the table control
"changes back into the internal table
ENDLOOP.
******SCREEN 8001***READING DATA FROM MOVIE_TAB TO TABLE CONTROL********
MODULE PASS_DATA OUTPUT.
SORT MOVIE_TAB.
READ TABLE MOVIE_TAB INDEX MOVIE-CURRENT_LINE.
ENDMODULE. " GET_DATA OUTPUT.
******SCREEN 8001****MODIFYING INTERNAL TABLE FROM TABLE CONTROL********
MODULE DISPLAY_DATA INPUT.
* IF MOVIE_TAB-FLAG = 'X'.
MODIFY MOVIE_TAB INDEX MOVIE-CURRENT_LINE.
* ENDIF.
ENDMODULE. " DISPLAY_DATA INPUT
Hope it helps
Regards
Mansi
‎2009 Mar 27 5:17 AM
Hi all,
to modify a particular line item, I am not selecting the line by pressing push button beside the table control.
so, my point is that when I change the value of any particular field in the line, I need to set a flag in the corresponding row.
Regards,
Rajan