2007 Mar 13 8:53 AM
Hi all,
How to set a particular Field in table control either as display only or
change only for <b>each row</b> based on certain condition.I need to set this property for each record in table control not for the entire coloumn?.I know the procedure for setting up an entire coloumn in table control either as diplay or change only using <b>Loop at screen</b> statement.
Conditions:
If Material is batch managed:
itab-batch field has to be <b>Display only</b> mode.
if material is not batch managed:
itab-batch field has to be <b>change mode</b>.
<b>O/p of Table Control :</b>
Material Batch
1000 Display only
2000 Change only
8000 Change only
3500 Display only
3600 Display only
2007 Mar 13 2:07 PM
Hi Vigneswaran,
Do something like this.
in PBO.
loop at itab with <table control>....
module modify_tc.
endloop.
in Program
module modify_tc.
if itab-batchmanged = 'X'.
loop at screen.
if screen-group1 = '<group name for all the columns of the table control>'.
screen-input = 0.
modifyy screen.
endif.
endloop.
endif.
endmodule.
Regards,
Ravi
2007 Mar 13 1:57 PM
2007 Mar 13 2:01 PM
Before activating & deacting the row, check the material batch and do accordingly.
i am not sure whethr it works.
2007 Mar 13 2:07 PM
Hi Vigneswaran,
Do something like this.
in PBO.
loop at itab with <table control>....
module modify_tc.
endloop.
in Program
module modify_tc.
if itab-batchmanged = 'X'.
loop at screen.
if screen-group1 = '<group name for all the columns of the table control>'.
screen-input = 0.
modifyy screen.
endif.
endloop.
endif.
endmodule.
Regards,
Ravi
2007 Mar 13 2:52 PM
Hi Ravi,
Thanks for your reply.I have put the code as u said. It is modifying the whole coloumn insted of modifying Current row of the coloumn.
I have tried to modify the screen property using Table control attributes (TC-COLS).The following commented code is that logic.Even that also doing the same thing.Can yoy please tell me how to do it.
MODULE tc_get_lines OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'X_ZPINV-CHARG'.
IF fg_batch = ' '.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT tc-cols INTO tc_wa
WHERE screen-name = 'X_ZPINV-CHARG'.
IF x_zpinv-matnr IS NOT INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = x_zpinv-matnr
IMPORTING
output = v_matnr.
*
SELECT SINGLE * FROM marc WHERE matnr = v_matnr
AND werks = w_plant.
*
IF marc-xchar IS INITIAL.
tc_wa-screen-input = 0.
ELSE.
tc_wa-screen-input = 1.
ENDIF.
MODIFY tc-cols FROM tc_wa INDEX sy-tabix." transporting screen-input
ENDIF.
ENDLOOP.
ENDMODULE. "TC_GET_LINES OUTPUT
2007 Mar 15 11:03 AM
Hi experts,
Can you please help me to this question?I need to do immediately.
2007 Mar 15 12:21 PM
Hi,
Pls check this out
in PBO
Loop at itab into wa with control c_tb1.
module modify.
endloop.
module modify output.
if (for any condition).
loop at screen.
screen-input = 0.
modify screen.
endloop.
endif.
endmodule.
pls reply if it works
with regards Naveena & Athulya
Message was edited by:
Naveena M
2007 Mar 16 12:50 PM
Hi Naveena,
The code i have shown in the previous reply is also under
Loop at itab into wa with control.
module modify.
Endloop.
But it is modifying the entire coloumn instead of specific row of the coloumn.