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

Report p rogram to update Z table

Former Member
0 Likes
542

Moderator message: Your duplicate posting has been deleted. Do not post the same question more than once.

hi to all

please clarify me rgarding below points

i am developing one module pool program to update a Z table

in PBO i am eriting like this.

MODULE status_9000.

LOOP WITH CONTROL so_control.

MODULE pbo_9000.

ENDLOOP.

***PAI----


PROCESS AFTER INPUT.

LOOP WITH CONTROL so_control.

MODULE pai_9000.

MODULE pai_control.

ENDLOOP.

MODULE user_command_9000.

in module pai_9000 i am insering data into internal table from the table control.

and in the module pai_control ia m doing some validation.

and in the module user_command_9000 i am performing the operations like select all, deselct all, insert, delete copy etc ..

my problem is i dont want to continue if the duplicates exist with the key

ZZBUKRS, ZZHEDNR, ZZCURR.

i have writetn code for this in the module pai_9000 (for duplicates)

suppose now i ahve data in table control like this

ZZBUKRS, ZZHEDNR, ZZCURR etc fields are there

00001 123 EUR

00001 143 INR

now i am seelcting the first line and copying the record

Now i am changing the last record like this

ZZBUKRS, ZZHEDNR, ZZCURR etc fields are there

00001 123 EUR

00001 143 INR

00001 123 USD

now if i press enter then it will show that duplicate entries exist with 00001 123 EUR, because i have written code

in pai_9000. till now intenal table has not been updated with the value i changed, after the end loop in PAI only it will update the entry into internal table.

if i write the code after end loop then it is ok, but the control will not go the record where it is having duplicates.

if i press enter again then it will be ok .........

how to rectify this error

i dont want to display message because i have already chenged before pressing enter

coulld any one sugegst me pls on this??

Edited by: Matt on Nov 5, 2008 1:18 PM

Moderator message: Your duplicate posting has been deleted. Do not post the same question more than once.

hi to all

please clarify me rgarding below points

i am developing one module pool program to update a Z table

in PBO i am eriting like this.

MODULE status_9000.

LOOP WITH CONTROL so_control.

MODULE pbo_9000.

ENDLOOP.

***PAI----


PROCESS AFTER INPUT.

LOOP WITH CONTROL so_control.

MODULE pai_9000.

MODULE pai_control.

ENDLOOP.

MODULE user_command_9000.

in module pai_9000 i am insering data into internal table from the table control.

and in the module pai_control ia m doing some validation.

and in the module user_command_9000 i am performing the operations like select all, deselct all, insert, delete copy etc ..

my problem is i dont want to continue if the duplicates exist with the key

ZZBUKRS, ZZHEDNR, ZZCURR.

i have writetn code for this in the module pai_9000 (for duplicates)

suppose now i ahve data in table control like this

ZZBUKRS, ZZHEDNR, ZZCURR etc fields are there

00001 123 EUR

00001 143 INR

now i am seelcting the first line and copying the record

Now i am changing the last record like this

ZZBUKRS, ZZHEDNR, ZZCURR etc fields are there

00001 123 EUR

00001 143 INR

00001 123 USD

now if i press enter then it will show that duplicate entries exist with 00001 123 EUR, because i have written code

in pai_9000. till now intenal table has not been updated with the value i changed, after the end loop in PAI only it will update the entry into internal table.

if i write the code after end loop then it is ok, but the control will not go the record where it is having duplicates.

if i press enter again then it will be ok .........

how to rectify this error

i dont want to display message because i have already chenged before pressing enter

coulld any one sugegst me pls on this??

Edited by: Matt on Nov 5, 2008 1:18 PM

3 REPLIES 3
Read only

Former Member
0 Likes
515

HI,

you define a interna table with header line.

and use the fields if this table in table control.

in pbo you write as.

loop at <itab> with control <tcon>.

endloop.

in pbo you write as.

loop at <itab> .

module modify.

endloop.

in modify you write as.

modify itab1 index tcon-current_line.

if sy-subrc <> 0.

append itab.

endif.

module user command.

modify ztab from table itab.

Read only

0 Likes
515

hello swati gupta

i am doign the same thing

i am getting updated Z table

i need some error criteria

i am getting fail in that

pls read question one more time

Read only

0 Likes
515

hello

could any one suggest me on this isuue pls