Prob in Inserting values from table control to ZTABLE.

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Locked
yogi007
Posts: 17
Joined: Tue Oct 22, 2002 1:07 am

Prob in Inserting values from table control to ZTABLE.

Post by yogi007 » Tue Oct 22, 2002 1:11 am

Hi All,

This is a Prob of module pool with Tab strip. I ahve amde one tab strip on that there is two screens 101, 102. on screen 101 there is table control . which is editable . and there is also one " SAVE" button on screen 101. Now Prob is that when i insert value in the table control after running and press the "SAVE" button . It will not go to the ZTABLe. I wann to insert the value from my table control to the Ztable. Its not inserting.

plz help me out .

thx in advance . and waiting for ur kind reply.

yogi

TwoABAPers
Posts: 990
Joined: Sun Oct 20, 2002 9:16 pm
Location: web
Contact:

Post by TwoABAPers » Tue Oct 22, 2002 1:23 am

Questions:
1. Are the values getting updated in your internal table, befor you try to update the database table?
2. What statement are you using for inserting/updating the Z-table.

Regards
Sudhir/Mohit

yogi007
Posts: 17
Joined: Tue Oct 22, 2002 1:07 am

Post by yogi007 » Tue Oct 22, 2002 1:45 am

hi sudhir/mohit,

thx for ur reply i am pasting the code of screen 101. the internal table is not updating . Values are not coming in the internal table.

PROCESS BEFORE OUTPUT.
MODULE STATUS_0101.
loop at itab_01 with control tab_ctrl1 cursor tab_ctrl1-current_line.
module disp_item.
* move corresponding itab_01 to zmaintenance01.
ENDLOOP.

*------------------------------------
PROCESS AFTER INPUT.
loop at itab_01.
FIELD itab_01-mark.
MODULE trans_from_tc.



ENDLOOP.

MODULE USER_COMMAND_0101.

this is a pbo and PAI module .

PAI of 101 where i am inserting the and writing the the code for SAVE.

MODULE USER_COMMAND_0101 INPUT.
case ok_code.
WHEN 'SELE'.
LOOP AT itab_01 where mark = space.
itab_01-mark = 'X'.
MODIFY itab_01 tranSPORTING mark.
ENDLOOP.
WHEN 'DSELE'.
LOOP AT itab_01 WHERE mark = 'X'.
itab_01-mark = space.
MODIFY itab_01 TRANSPORTING mark.
ENDLOOP.
when 'SAVE'.
loop at itab_01 where mark = space.
itab_01-mark = 'X'.
move-corresponding itab_01 to zmaintenance03 .
update zmaintenance03.
endloop.
endcase.
ENDMODULE. " USER_COMMAND_0101 INPUT



MODULE trans_from_tc INPUT.
* MOVE itab_01-mark TO zmaintenance03-mark.
MOVE itab_01-mark TO zmaintenance03.
update zmaintenance03.
*MODIFY zmaintenance03 from itab_01 INDEX tabl_ctrl1-current_line.

ENDMODULE. " trans_from_tc INPUT


here i am updating the ztable. but its not updating . zmaintenance03.

again thx ..and waiting for ur kind reply .


yogi

yogi007
Posts: 17
Joined: Tue Oct 22, 2002 1:07 am

Post by yogi007 » Thu Oct 24, 2002 12:56 am

Hi all ,

I am still waiting for the solution. Can anybody solve my prob . This is still pending .
i am very gr8ful toward him
thx in advance

yogi

TwoABAPers
Posts: 990
Joined: Sun Oct 20, 2002 9:16 pm
Location: web
Contact:

Post by TwoABAPers » Thu Oct 24, 2002 2:51 am

Seems from your code that PAI is not updating the Internal table values correctly, resulting in the problem.

What value sor sy-subrc does the update statement return. consider using MODIFY in place of UPDATE.

Regards
Sudhir/Mohit

gest

Re: Prob in Inserting values from table control to ZTABLE.

Post by gest » Thu Oct 24, 2002 3:29 am

I wann to insert the value from my table control to the Ztable. Its not inserting.

if ur getting the records properly as u entered in table control

check this at move-corresponding to ZTAB.

if it is fine use ' insert ZTAB '.

if ur unable to update the internal table rec properly check the PAI.
i.e the table which is related to ur table control.

instead of looping ur internal table and inserting records into ZTABLE.

insert ZTAB from table I_ZTAB[].

bye.












yogi007 wrote:Hi All,

This is a Prob of module pool with Tab strip. I ahve amde one tab strip on that there is two screens 101, 102. on screen 101 there is table control . which is editable . and there is also one " SAVE" button on screen 101. Now Prob is that when i insert value in the table control after running and press the "SAVE" button . It will not go to the ZTABLe. I wann to insert the value from my table control to the Ztable. Its not inserting.

plz help me out .

thx in advance . and waiting for ur kind reply.

yogi

Locked