Application Development 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: 

Table cntrol field to be display/Change only For each record

former_member491305
Active Contributor
0 Kudos
184

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

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
156

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

7 REPLIES 7

former_member491305
Active Contributor
0 Kudos
156

Hi,

Please help me out if any body knows the procedure.

Former Member
0 Kudos
156

Before activating & deacting the row, check the material batch and do accordingly.

i am not sure whethr it works.

former_member181962
Active Contributor
0 Kudos
157

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

0 Kudos
156

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

0 Kudos
156

Hi experts,

Can you please help me to this question?I need to do immediately.

0 Kudos
156

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

0 Kudos
156

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.