Application Development and Automation 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: 
Read only

Table Control Cell Display/Change

Former Member
0 Likes
1,343

Hi ,

In table control , Few cells have to be displayed Change mode and few cells in display mode ( Just like Conditions tab table control in Sales order ).

How can code for this senario . Could you please provide me the Solution for this ?

Thanks

Srinivas

1 ACCEPTED SOLUTION
Read only

rahulkavuri
Active Contributor
0 Likes
710

hi this depends on PBO event where u set your records to editable or uneditable format, check the solution here

https://forums.sdn.sap.com/click.jspa?searchID=736686&messageID=1794330

just add another field say FIELD1(6) to your internal table, set this to ON or OFF according to ur requirement

PROCESS PBO.

LOOP AT ....

MODULE LOOP_SCREEN.

ENDLOOP.

MODULE LOOP_SCREEN.

LOOP AT SCREEN.

IF SCREEN-NAME = 'FIELD1'.

IF ITAB-FIELD1 = 'OFF'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDLOOP.

In this sample the field of colunm FIELD1 will be avaible for input if the value of ITAB-FIELD1 is ON.

If you delete the control of field name (so the cell) the attribute'll be valide for whole row:

MODULE LOOP_SCREEN.

LOOP AT SCREEN.

IF ITAB-FIELD1 = 'OFF'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

In this way the row with field FIELD1 is OFF aren't available for input.

award points if found helpful, this solves the problem

Hi ,

In table control , Few cells have to be displayed Change mode and few cells in display mode ( Just like Conditions tab table control in Sales order ).

How can code for this senario . Could you please provide me the Solution for this ?

Thanks

Srinivas

2 REPLIES 2
Read only

rahulkavuri
Active Contributor
0 Likes
711

hi this depends on PBO event where u set your records to editable or uneditable format, check the solution here

https://forums.sdn.sap.com/click.jspa?searchID=736686&messageID=1794330

just add another field say FIELD1(6) to your internal table, set this to ON or OFF according to ur requirement

PROCESS PBO.

LOOP AT ....

MODULE LOOP_SCREEN.

ENDLOOP.

MODULE LOOP_SCREEN.

LOOP AT SCREEN.

IF SCREEN-NAME = 'FIELD1'.

IF ITAB-FIELD1 = 'OFF'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDLOOP.

In this sample the field of colunm FIELD1 will be avaible for input if the value of ITAB-FIELD1 is ON.

If you delete the control of field name (so the cell) the attribute'll be valide for whole row:

MODULE LOOP_SCREEN.

LOOP AT SCREEN.

IF ITAB-FIELD1 = 'OFF'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

In this way the row with field FIELD1 is OFF aren't available for input.

award points if found helpful, this solves the problem

Read only

Former Member
0 Likes
710

Yeah this is possible and this we can do when we the same table control has to behave differently for some conditions .

For this based on the input set the condition like GV_flag = 'X'. This will be done in the pai of that module .

Now once the flag is set the in PBO make the table control behave with the Screen groups which u can define for the elements in the field attributes

You need to make use of the<b> screen groups</b> very well in this regard.

so based on condition we can make the table control display or change for the same .

Just a pseudo code for demo .

IF GV_FLAG = 'X'.

 IF SCREEN-NAME = 'ITAB-XXX1' AND ITAB-XXX2 = 'CN2'.
      SCREEN-INPUT = 1.
ELSE.
     SCREEN-INPUT = 0.
      MODIFY SCREEN.
 ENDIF.

ENDIF.

(or)

IF <b>SCREEN-group1</b> = '0001' or SCREEN-group1 = '0002'.

SCREEN-INPUT = 0.

ELSE.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

Screen-input / screen-active /screen-visible } make use of this .

regards,

vijay