‎2006 Nov 22 9:39 AM
Hi Everyone!
I have added three custom fields into a new infotype/subtype.
Everything is working fine when I use PA20 to display a persons
data for this new infotype i.e. the three new fields are being displayed.
However, if I use PA30 (Change) the three new fields are still in display only
mode and does not allow any user input for these new fields.
The code below is what I am using:
IF p0019-tmart = '61'. " New Subtype 61
LOOP AT SCREEN.
IF screen-group1 = 'CRB'. " I have added this as a modification group
screen-active = '1'.
MODIFY SCREEN.
ELSE.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Do I have to make the distinction between PA20/PA30 when activating?
Cheers
Andy
‎2006 Nov 22 9:45 AM
Hi Andy,
IF screen-group1 = 'CRB'.
screen-active = '1'.
screen-input = 1 . " you can use it for input
MODIFY SCREEN.
ELSE.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
hope this helps
‎2006 Nov 22 9:45 AM
Hi Andy,
You just need to include the transaction codes as well while checking for the modification groups.
Suppose you have 3 fields on the screen A,B & C-->MOD is modification group for them. You wan to keep them display only in T1 transaction & allowed for change in T2 transaction. Then the code would be:
LOOP AT SCREEN.
IF screen-group1 = 'MOD' AND sy-tcode = 'T1'.
screen-active = 0.
ELSE.
screen-active = 1.
ENDIF.
Regards,
Chetan.
Reward points if this helps.
‎2006 Nov 22 9:51 AM
Chetan,
Thanks very much for your reply, much appreciated.
Is there anyway I can capture if the user has pressed the display icon
or the change icon. They have the option to do both from PA30
Cheers
Andy
‎2006 Nov 22 10:00 AM
Hi Andy,
When it is from PA30, then you can go with the help of SY-UCOMM = 'DIS'.
along with TCODE. that way you can solve.
Regards
Vijay
‎2006 Nov 22 10:01 AM
in the command line put ' /h ' and in the debugging mode check for sy-ucomm
if sy-ucomm eq 'DISP'. " for example this is for display
.. " some code here
elseif sy-ucomm eq 'CHNG'. " this one is for change mode
..
endif.
hope this helps.
‎2006 Nov 22 10:05 AM
I have used debug mode and the sy-ucomm is blank when I choose
both display and change options
‎2006 Nov 22 9:48 AM
yes u have to distinguish
if sy-tcode = 'PA20'.
var = 0.
elseif sy-tcode = 'PA30'.
var = 1.
endif.
LOOP AT SCREEN.
IF screen-group1 = 'CRB'. " I have added this as a modification group
screen-active = '1'.
scree-input = var.
MODIFY SCREEN.
ELSE.
screen-active = '0'.
scree-input = var.
MODIFY SCREEN.
ENDIF.
ENDLOOP.Message was edited by:
chandrasekhar jagarlamudi
‎2006 Nov 22 10:41 AM
Hey Andy,
Sorry for the late reply mate.
The function code for the Change icon is MOD & that for the Display icon is DIS.
I don't think you will be able to capture this event using sy-ucomm.
Please compare these values against the system variable SY-PFKEY. The SY-PFKEY value when you press change icon is MOD & when you press Display icon is DIS.
Do let me know if this works or not.
Regards,
Chetan.
PS: Reward points if this helps.
Message was edited by:
Chetan H. Dubey
‎2006 Nov 22 11:59 AM
Thanks Guys for your replies.
I have now managed to solve it now.
Cheers
Andy