02-23-2005 5:23 AM
Hi,
I am having problem with Table control.
I created a screen having Table control.
This screen is used by 2 users . If User1 uses the 'Z' transaction for this table control screen, i want certain fields in Table control should be input.
The same when the User2 uses the same transaction for the screen, then the table control should not be input.
By userid , i have to made this.
I used If sy-uname = 'usr01'.
Loop at screen.
if screen-field = 'IT_TC1-MATNR'.
SCREEN-INPUT = 0.
endif.
modify screen.
endloop.
endif.
But it is not working.Pls suggest me.
Thanks in Advance,
Best Regards,
Pavan.
02-23-2005 5:30 AM
Hi Pavan,
Could try out this piece of code instead ?
IF SY-UNAME = 'USER1'.
LOOP AT TC-COLS-SCREEN.
IF TC-COLS-SCREEN-NAME = 'IT_TC1-MATNR'
TC-COLS-SCREEN-INPUT = 0.
MODIFY TC-COLS-SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,
Anand Mandalika.
02-23-2005 5:28 AM
Hi,
1. Have you checked if this block of code is being executed? Is the IF condition being met? If you have written code exactly as you specified, you will have to change <b>IF sy-uname = 'USR01'</b> rather than <b>'usr01'</b>.
2. Have you put this code in PBO or PAI?
Regards
Message was edited by: Shehryar Khan
02-23-2005 5:30 AM
Hi Pavan,
Could try out this piece of code instead ?
IF SY-UNAME = 'USER1'.
LOOP AT TC-COLS-SCREEN.
IF TC-COLS-SCREEN-NAME = 'IT_TC1-MATNR'
TC-COLS-SCREEN-INPUT = 0.
MODIFY TC-COLS-SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,
Anand Mandalika.
02-23-2005 8:26 AM
Hi Pavan,
Put the code you have mentioned inside the LOOP... ENDLOOP for the table control. This will work. The LOOP AT SCREEN outside this loop only contains fields outside the table control.
Best regards,
Mayank