Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

editable alv with oops

Former Member
0 Kudos

hi experts

my requirement is to work with editable alv

like under save i have to write logic for insert and update and delete functionality

and also increase the serial no dynamically

save has  > insert and update and delete

serial no should be increase automatically

while save it should compare whether is any data change or not

2 REPLIES 2

Abhijit74
Active Contributor
0 Kudos

Hello,

If you want to work with oops editable alv then first you have to create a screen and draw a custom control inside the screen , I hope you know this. So, instead of going detail i would like to share the other functionality.

1. Automatically Serial no increment : I hope you are saving the serial no data somewhere in the database. So, it can be easily done in the PBO of the screen by retrieving the data from the table.

If it is multiple row of serial no's  then you have to re-arrange the data.

Suppose you have created a one row alv list. Now you want to add 2 rows then first create all the row and while saving the data it will regenerate the serial nos.

First retrieve data into internal table. then loop in to that internal table.

Please refer to below code for regeneration.

DATA: lv_item      TYPE  serial_no,

          lt_item  Standard table of ty_item.


FIELD-SYMBOLS <lfs_item> TYPE ty_item.

   CLEAR lv_item.

   LOOP AT lt_item ASSIGNING <lfs_item>.

     lv_item = lv_item + 1.

     <lfs_item>-item = lv_item.

   ENDLOOP.

2. Saving data:

First you keep your old data into an internal table. then when you will insert or update any row in alv then after insert or update your new data will generate in a new internal table of same format.

Compare two tables if you found that two tables are not matching then there is a change in alv.  so, you can track the changes and save data.

3. Insert, update and delete.

If you are working with editable alv then you have option to add row, delete row or updating the data in the cell as will.

To achieve this ,there are so many things you need to write in your code.  I have just briefed you.

Please let me know if you need more.

Thanks & regards,

Abhijit

Venkat_Sesha
Advisor
Advisor
0 Kudos

Requirement Dumping is against Forum Rules.

Please show what research you have done before posting

Read the Rules of Engagement