Application Development and Automation 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: 
Read only

Modify in Module pool

Former Member
0 Likes
1,209

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,

11 REPLIES 11
Read only

Former Member
0 Likes
1,185

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.

Read only

Former Member
0 Likes
1,185

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

Read only

Former Member
0 Likes
1,185

USe modify zdesign from itab1.

Read only

0 Likes
1,185

hI All,

no, it is not working.

as i make changes on screen , it is not updating in itab1 itself.

Read only

0 Likes
1,185

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.

Read only

0 Likes
1,185

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

Read only

0 Likes
1,185

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.

Read only

0 Likes
1,185

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.

Read only

0 Likes
1,185

Hi, Problem is solved.

Read only

Former Member
0 Likes
1,185

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.

Read only

Former Member
0 Likes
1,185

How you are displaying this data, ALV ?

Regards,

Mohaiyuddin