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: 

Disabling I/O Screen Field in Cost center Screen Enhancement

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

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

13 REPLIES 13

Mohamed_Mukhtar
Active Contributor
0 Kudos

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

0 Kudos

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.

former_member202818
Active Contributor
0 Kudos

Hi,

Have u wrote ur code in the PBO of newly added subscreen?

And make sure that screen group is 1.

Regards

Sreekanth

0 Kudos

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.

0 Kudos

Hi,

Which value u set for  USER_MODE?

Why do u want to check USER_MODE rather than sy-tcode?

Regards

Sreekanth

0 Kudos

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.

0 Kudos

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?

0 Kudos

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

0 Kudos

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.

0 Kudos

ok.. one more to clear my doubt,is sy-tcode avilable there inside FM?

0 Kudos

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.

0 Kudos

Hi,

Thank you Shrilatha..

raymond_giuseppi
Active Contributor
0 Kudos

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