‎2007 Mar 26 5:42 AM
Hi All,
we have a table control wherein we can enter some value in a field.Based on some condition the remaining fields are disabled.When the user tries to enter some value in the field that is input enabed and click MODIFY button for the first time the db table is getting updated.But when the user tries modifying for the second time the value that is entered is not getting captured insted it is capturing the old value.what should be done to get the first value?
Thanks,
Rakesh.
‎2007 Mar 26 6:14 AM
Hi Rakesh,
Please check code written in PAI module. in loop of PAI you have to modify the internal table for values you are changing.
hope this will resolve u r problem,
If u r still stucked then reply with the code details of PAI module I will suggest you with details.
Darshan.
**Give points if u find this useful.
‎2007 Mar 26 6:22 AM
Hi Darshan
plz find the code below.
PROCESS BEFORE OUTPUT.
loop at gt_zltstrigger into wa_zltstrigger with control t_control1.
MODULE STATUS_0200.
endloop.
PROCESS AFTER INPUT.
loop at gt_zltstrigger.
module read_table_control.
endloop.
MODULE USER_COMMAND_0200.
&----
*& Module read_table_control INPUT
&----
text
----
MODULE read_table_control INPUT.
MODIFY gt_zltstrigger FROM wa_zltstrigger INDEX t_control1-current_line.
ENDMODULE. " read_table_control INPUT
&----
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
MODULE USER_COMMAND_0200 INPUT.
CASE sy-ucomm.
when c_modify.
select single * from zltstrigger_prnr
into corresponding fields of wa_prnr
where werks eq wa_zltstrigger-werks
and vstel eq wa_zltstrigger-vstel
and lgort eq wa_zltstrigger-lgort
and lfart eq wa_zltstrigger-lfart.
if sy-subrc eq 0.
message e034(001) with 'Partner type cannot be maintained when there are Doc partner records present'(003).
endif.
wa_zltstrigger2-mandt = sy-mandt.
wa_zltstrigger-werks = t001w-werks.
wa_zltstrigger-vstel = likp-vstel.
wa_zltstrigger-lgort = t001l-lgort.
wa_zltstrigger-lfart = tvlkt-lfart.
wa_zltstrigger-counter = zltstrigger-counter.
wa_zltstrigger2-rcvprn = zltstrigger-rcvprn.
wa_zltstrigger-parvw = zltstrigger-parvw.
update zltstrigger from wa_zltstrigger2.
commit work.
g_flag = '1'.
clear zltstrigger.
‎2007 Mar 26 7:39 AM
HI rakesh,
Have you tried debugging your code?Try to debug it and see what is happening,
‎2007 Mar 26 8:08 AM
seems rest of the code is ok. You need to change this statement.
MODIFY gt_zltstrigger FROM zltstrigger INDEX t_control1-current_line.
i.e instead of wa_zltstrigger write zltstrigger .
Darshan
‎2007 Mar 26 2:26 PM
Hi Rakesh,
Hope this has solved your problem,
If yes then pl. reward points.
DARSHAN