‎2008 Nov 25 9:43 AM
Hi all,
I am working on module pool and in that i want to modify the record but it i snot working.
i written a code as
In PAI,
select single * from zdesign INTO ITAB1
where code = ZDESIGN-code and matnr = ZDESIGN-matnr.
when record is displayed, i made a changes and press Modify button.
case OK_CODE.
WHEN 'MODI'.
modify zdesign .
CLEAR ZDESIGN.
clear ok_code.
endcase.
Regards,
‎2008 Nov 25 9:46 AM
Hi,
your record is displayiong from itab to the screen.so use modify itab instead of zdesign and if they want that changes to be updated in databse then we have to use update zdesign with where condition.
Hope this will help.
Regards,
Rohan.
‎2008 Nov 25 9:49 AM
Hi Kushi,
if you are displaying the values in Table control try the following.
in PAI
loop at itab.
module modify_tab.
endloop.
module modify_tab.
descibe table itab lines tc-lines.
if tc-current_line > tc-lines.
append itab.
else.
modify itab index tc-current_line.
endmodule.
hope this will serve your purpose.
Regards
Ramchander Rao.K
‎2008 Nov 25 9:51 AM
‎2008 Nov 25 9:55 AM
hI All,
no, it is not working.
as i make changes on screen , it is not updating in itab1 itself.
‎2008 Nov 25 9:59 AM
When you do a select single & use into internal table then it should actually be into work ara since only one record will be fetched from select single.
‎2008 Nov 25 10:04 AM
Hi Kushi,
Just follow these steps,
1. See whether the internal table is filled by selection from database table.
2. Check whether the changed record is updated as well in the internal table of structure.
3. Use the same structure to modify the database table..
MODIFY target FROM source.
Thanks & Regards
Santhosh
‎2008 Nov 25 10:16 AM
hi Santhosh,
internal table is filled by data from database table,but changes record is not updated in the internal table
I am modifying the same way.
MODIFY target FROM source.
‎2008 Nov 25 10:48 AM
hI,
Why intermediate table is filled with updated values. I have given screen fields as itab1-matnr , itab1-menge etc, Is there any wrong declaration on my screen field.
when record is displayed with select single
select single * from zdesign INTO ITAB1
where code = itab1-code and matnr = itab1-matnr.
i made a changes on screen and press modify button , but itab1 is not updated with new values.
‎2008 Nov 25 11:30 AM
‎2008 Nov 25 9:56 AM
Hi Kushi,
As also told by others why are you clearing you database table instead you have to clear you internal table and modify your internal table rather than your database table.
With luck,
Pritam.
‎2008 Nov 25 10:08 AM