06-12-2014 9:19 AM
Hi all,
I am doing screen exit for Cost center master. While using KS03 transaction, I have to disable the newly added I/O screen fields. So, I added the following code in PBO module.
*** PBO
MODULE modify_screen_input.
*** Include program of PBO
MODULE modify_screen_input OUTPUT.
IF sy-tcode EQ 'KS03'.
LOOP AT SCREEN.
IF screen-group1 eq 'CO'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
But, screen fields with that group are not getting disabled. Is there any way to disable those screen fields?
Thank You.
06-12-2014 9:33 AM
As with almost every customer exit or BAdI provided to add customer field, the PBO method/FM receives a flag mode or edit (here EXIT_SAPLKMA1_001 receives USER_MODE, check its description text in the FM) save this field value in the global data of the exit function module (you should easily find include ZXKM1TOP in LXKM1TOP) and check this value in the PBO. (Also check actual definition of dynpro and activation of every subobject)
Regards,
Raymond
06-12-2014 9:25 AM
Hello Shrilatha,
Please try with below code
IF sy-tcode EQ 'KS03'.
LOOP AT SCREEN.
IF screen-name = 'CI_CSKS-ZFIELD' ->changeit to field name
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE.
Thanks
06-12-2014 11:05 AM
Hi,
I tried with your code. But here, USER_MODE given in the function module should be checked instead of checking KS03. Now, It's working.
Thank you for your reply.
06-12-2014 9:29 AM
Hi,
Have u wrote ur code in the PBO of newly added subscreen?
And make sure that screen group is 1.
Regards
Sreekanth
06-12-2014 10:56 AM
Hi,
I checked it once again. I used group 1 only. But here, USER_MODE given in the function module should be checked instead of checking KS03. Now, It's working.
Thank you for your reply.
06-12-2014 12:27 PM
Hi,
Which value u set for USER_MODE?
Why do u want to check USER_MODE rather than sy-tcode?
Regards
Sreekanth
06-12-2014 12:45 PM
Hi,
I didn't set any value to USER_MODE. It is already given in the Exit "EXIT_SAPLKMA1_001" which its value changes according to the given transaction as 'I' or 'U' or 'S' or 'D' (I-Insert, U-Update, S-Show, D-Delete). So, I used this. And also please refer the Include "LXKM1F00" given in the function group "XKM1". I tried with sy-tcode also, but it doesn't work.
Thank you.
06-12-2014 12:52 PM
Without considering sy-tcode how u accomplish ur requirement?
U want to make your field as input disable only when tcode is KS03, right?
Whether the issue is related to unavailability of st-tcode value inside ur enhanced screen?
06-12-2014 1:00 PM
There are many SAP transactions that allow change of mode (e.g. display -> change) but the SY-TCODE is not changed, so better use the fields provided by SAP (and described in enhancement documentation)
Regards,
Raymond
06-12-2014 1:05 PM
Yes. But this enhancement is only for Cost Center Master Data. It works for KS01, KS02, KS03. When KS03 transaction is used, its USER_MODE will sets to show only. So, Instead of using sy-tcode, I directly used this USER_MODE as per given in function module.
06-12-2014 1:22 PM
ok.. one more to clear my doubt,is sy-tcode avilable there inside FM?
06-13-2014 5:58 AM
Hi,
As debugger can't be set in Module inside Include program, I couldn't check whether the sy-tcode value is changing or not. If I find any other way to check this value, I'll let you know. If you find, Please let me know.
Thank You.
06-13-2014 6:04 AM
06-12-2014 9:33 AM
As with almost every customer exit or BAdI provided to add customer field, the PBO method/FM receives a flag mode or edit (here EXIT_SAPLKMA1_001 receives USER_MODE, check its description text in the FM) save this field value in the global data of the exit function module (you should easily find include ZXKM1TOP in LXKM1TOP) and check this value in the PBO. (Also check actual definition of dynpro and activation of every subobject)
Regards,
Raymond