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

SY-UCOMM holds old function code

Former Member
0 Likes
7,131

Hi,

I have implemented screen exit for IW21 transaction where user can assign permits to notifications. I have added it as a new tab. Problem is when I click on any pushbutton in my screen, it works fine. Next, when I just simply press 'ENTER' key of keyboard, in PAI sy-ucomm holds old value which I had pressed earlier. I have cleared value of sy-ucomm before exiting screen exit. Though, it takes old value, as soon as it enters the standard code.

Regards,

Sneha

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
4,805

Hi Sneha

The enhancement has an exit EXIT_SAPMIWO0_008 to transfer data to subscreen. This FM has a parameter I_TABCD... What value does it hold each time..?

Yes please check screen sequence which Sushmita has mentioned above. Most like this can be the cause. In screen sequence you have to maitnain the OK codes as you have some buttons on custom tab.

Nabheet

13 REPLIES 13
Read only

Former Member
0 Likes
4,805

post screen shots of the new tab added. and source code.

Read only

Former Member
0 Likes
4,805

Hi Sneha,

                If my understanding is correct, it is not that it holds the old value, your new sy-ucomm value 'ENTER' is not getting picked or called in PAI. Please check the pf-status of the screen.

Or can you please explain the issue briefly again.

Regards,

Santhosh Yadav

Read only

Former Member
0 Likes
4,805

Hi,

I am clearing SY-UCOMM in my exit(SAPLXQQM), after all the corresponding steps are executed for that function code.

But, as soon as it enters standard code(SAPLIQS0), it again gets old value which I don't want.

Now, if I press 'Enter' key after this, it will hold same sy-ucomm(Z*ISSUE) value because of which wrong code is getting executed.

I can't add PF-status, as this is a subscreen. Screen exit does not allow normal screen.

Regards,

Sneha

Read only

0 Likes
4,805

Hi Sneha,

                The statement CLEAR sy-ucomm is commented in Module TC_PERMITS_USER_COMMAND did you check un commenting.

More over the standard program SAPLIQS0 is getting called after Processing the Module TC_PERMITS_USER_COMMAND rite? the code for CASE sy-ucomm should be in PAI module TC_PERMITS_USER_COMMAND where have you put it?

check the sequence in which the codes are being called.

Regards,

Santhosh Yadav

Read only

0 Likes
4,805

I am copying ok_code to sy-ucomm and ok_code is cleared inside the module TC_PERMITS_USER_COMMAND which is as good as clear sy-ucomm.

Yes, this module is in PAI event

Read only

Former Member
0 Likes
4,805

HI Sneha,

It is not wise to clear system fields like sy-ucomm.

Instead you use another variable to use the ok code and the following logic.

DATA: ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm.


and in the PAI.


MODULE user_command_100 INPUT.

  save_ok = ok_code.
  CLEAR ok_code.

  CASE save_ok.
        WHEN...
   ...
  ENDCASE.

ENDMODULE.


where ok_code is the ok code declaration in your screen.

Read only

0 Likes
4,805

In screen exit, I have created new screen which does not allow me to add ok_code to element list.

See below,

Rest all field are editable except Ok_code

Read only

0 Likes
4,805

Sneha,

This seems to be related to screen sequence groups associated with such transactions.

I think you can solve it by customizing screen sequences using transaction VFBS.

Check this thread which provides the solution on a similar situtation.

You could also check this thread.

Hope that will solve your issue.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
4,806

Hi Sneha

The enhancement has an exit EXIT_SAPMIWO0_008 to transfer data to subscreen. This FM has a parameter I_TABCD... What value does it hold each time..?

Yes please check screen sequence which Sushmita has mentioned above. Most like this can be the cause. In screen sequence you have to maitnain the OK codes as you have some buttons on custom tab.

Nabheet

Read only

0 Likes
4,805

I_TABCD holds '10\TAB02' which is fcode value of my new tab.

Screenshot of VFBS

I had tried by putting Z8ISSUE in Next location-Fucntion code as per the link suggested above. But,  not working.

Read only

0 Likes
4,805

Have you made the required entries in T185* table?

If still not working, try to clear it this way.

    FIELD-SYMBOLS: <fs_okcode> TYPE any.

data : save_ok type sy-ucomm.

CONSTANTS: c_okcode(17) TYPE c VALUE '(SAPLIQS0)OK-CODE'.

    ASSIGN: (c_okcode) TO <fs_okcode>.

    IF <fs_okcode> IS ASSIGNED.

         save_ok    = <fs_okcode> .

         if save_ok = 'Z8IS'.

*                Do processing

        endif.

* To clear the ok code.

       CLEAR: <fs_okcode>.

    ENDIF.

Read only

Former Member
0 Likes
4,805

Any update guys?

Regards,

Sneha

Read only

Former Member
0 Likes
4,805

Thanks all.

Found solution at Clearing sy-ucomm in subscreen | SCN