2013 Aug 01 5:41 AM
Hi everyone,
Am trying to update table in a module pool programming.
where i need to update a filed when user creates a field entry and also i need to disable the same field when second record is updated
I have created a field to which when the user creates(save) the record it should be updated in my table at the same time when the user creates new(second) record the first filed in the table should be disabled
could anybody help me on this am trying hard to get this done please....
2013 Aug 02 4:12 AM
Hi Anand.
1) Set a flag to identify the record that is saved.
2) Then based on the flag, write the business logic in a PBO module to disable the row.
MODULE DISABLE_ROW OUTPUT.
if itab-flag = 'X'.
loop at screen.
screen-active = 0.
modify screen.
endloop.
endif.
ENDMODULE. " DISABLE_ROW OUTPUT
Regards.
2013 Aug 01 5:53 PM
2013 Aug 02 5:52 AM
thank for your response
am using table control
thanks & regards
anand
2013 Aug 02 4:12 AM
Hi Anand.
1) Set a flag to identify the record that is saved.
2) Then based on the flag, write the business logic in a PBO module to disable the row.
MODULE DISABLE_ROW OUTPUT.
if itab-flag = 'X'.
loop at screen.
screen-active = 0.
modify screen.
endloop.
endif.
ENDMODULE. " DISABLE_ROW OUTPUT
Regards.
2013 Aug 02 5:54 AM
thnak you arun,
I will try it and let u know if i have any issues with this
thanks & regards
anand
2013 Aug 02 7:48 AM
Hello ,
Please go thru the following link..
http://scn.sap.com/thread/2095701
http://scn.sap.com/thread/1876341
will clear all doubts..
2013 Aug 07 11:20 AM
2013 Aug 07 11:57 AM
Anand,I liked it but No need to say thanks to all individually. if you liked someone's reply just like or mark it helpful ans, because it make a notification for all. Please take care of this thing next time.
Best Rgds
Chandra..
2013 Aug 02 6:20 AM
Hi,
take one extra field for your table control as flag type c.
In PAI of your screen,
When 'SAVE':
set flag for all rows that you want to be disable.
Now in PBO of screen,
loop at ITAB into wa_itab
..
..
..
module make_non_editable.
Endloop.
*******
Module make_non_editable.
data : gv_line_no type i.
IF wa_itab-flag EQ 'X'. "if data is already sent for approval.
gv_line_no = tc_9001-current_line. "to get current line which is looped
ENDIF.
LOOP AT SCREEN.
IF tc_9001-current_line = gv_line_no .
screen-input = 0.
screen-active = 1.
MODIFY SCREEN .
ENDIF.
ENDLOOP.
Endmodule.
this will definitely work as i had tested.
Regards,
Abdul
2013 Aug 02 7:25 AM
Hello Anand,
create a Boolean variable (e.g-u_flag) .make it marked after data base update in PAI .in PBO check that flag variable is checked or not
MODULE dib_field OUTPUT.
if u-flag = 'X'.
loop at screen.
if screen-group1 ='G1'.
screen-active = 0.
and screen-output = '1'.
modify screen.
<query to ftech data from previous record to fill the field>
endloop.
endif.
ENDMODULE.
at same time you make a group of field read only .
2013 Aug 07 11:16 AM
2013 Aug 02 7:34 AM
Hi Anand,
Whenever you want to disable, enable or hide or show a screen you should always use the fields from the "SCREEN" table
Then you can set screen-input = 0 or screen-active = 0 or screen-invisible = 1 as per your requirement.
Thanks.
Ankita
2013 Aug 07 11:19 AM