‎2010 Jul 02 6:59 AM
I have a table control in the screen and I set the select column for the table control.The first column of the table control is a button(OKCODE is MSGI) column , we use this button to generate a screen(we call it messages screen) to display the error messages of the corresponding line item in the table control. Actually the program works well as far as I had countered below problem.
The problem is:
when I entry the data in the table control, and then I select one row and the selected row in table control is highlighted(become yellow). And then I press the ENTER key in keyboard, but It is strange that the message screen is displayed. I debug the program and I found that the OK CODE is automatically set to the message button(OKCODE MSGI). But in the whole process I had not click this button.
I was confused by this problem. Please any friends had countered this problem and you can give me some idea to solved this problem.
PS: I clear the okcode and sy-ucomm at last the PAI process.
Thanks in advance.
Joe
Edited by: Gangrong Chen on Jul 2, 2010 1:59 PM
‎2010 Jul 02 10:32 AM
Hi Joe,
Could you please try with the below logic,
In the PAI module user_command:
Data: g_save_ok_code type sy-ucomm.
G_save_ok_code = ok_code.
Clear ok_code.
.
.
.
Then check the variable g_save_ok_code instead of ok_code in the block.
I had the same issue and it got solved once I did like above. Hope, your problem is also the similar one.
Regards,
Selva K.
‎2010 Jul 02 11:27 AM
‎2010 Jul 02 11:55 AM
Hi Joe,
Go to GUI status -> Function keys -> Give function code 'ENTER' for first button (previous to SAVE button)
Now execute your program and press ENTER button, henceforth OKCODE will always have function code 'ENTER' so it will never affect your logic.
-Amol
‎2010 Jul 03 6:50 AM
Hi Friends,
Thanks very much for your kindly response. I had tried your idea but I am sorry that my issue is still not solved.
I am afraid that I should give up handling this issue, because I found that the standard SAP program have this problem as well. For example, we change the purchase odrder item through ME22N, if the PO items have error mesage then the Status button column of the table control will show a led-red icon to indicate the status of the line item. Now if you select this line item and press ENTER, the message screen will be shown out.
Thank you.
Joe
‎2010 Jul 03 8:25 AM
Joe,
Not sure if I follow, but basically pressing ENTER key triggers empty function code. This means that if there was previous function code value in OK_CODE you would be getting the same value each time after you press ENTER. So I think this is a matter of clearing the OK_CODE each time at the end of PAI and evaluate real function code value in some addtional SAVE_OK data object.
Please refer http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa1335c111d1829f0000e829fbfe/frameset.htm.
Regards
Marcin
‎2010 Jul 03 9:31 AM
HI,
I think wen u select the row ur cursor might be on the button of table control , so wen u press enter the okcode = msg is triggered
‎2010 Jul 03 6:11 PM
Its not automatically set, after previous assignment of ok code its not cleared.
‎2010 Jul 07 7:12 PM
I am afraid that I have to agree with Madhukar Shetty 's idea.
Below is my code of user-command modue in PAI.
*PAI*
PROCESS AFTER INPUT.
CALL SUBSCREEN : left_sel,
right_sel,
window .
MODULE user_command_2000.
MODULE user_command_2000 INPUT.
save_ok_code = ok_code.
CLEAR ok_code.
PERFORM user_command_2000.
CLEAR save_ok_code.
ENDMODULE. " USER_COMMAND_2000 INPUT
FORM user_command_2000.
CASE save_ok_code.
WHEN zfisc_s_okcode-is_execute OR zfisc_s_okcode-is_re_execute.
PERFORM select_data.
WHEN zfisc_s_okcode-is_back OR
zfisc_s_okcode-is_up OR
zfisc_s_okcode-is_cancel.
PERFORM leave_program.
WHEN zfisc_s_okcode-is_save.
PERFORM save_entry.
WHEN zfisc_s_okcode-is_dbclick.
WHEN zfisc_s_okcode-is_change_display_shift.
PERFORM shift_display_change_mode.
WHEN zfisc_s_okcode-is_check.
PERFORM check_all_entries.
WHEN zfisc_s_okcode-is_check_item OR
zfisc_s_okcode-is_wbs_range OR
zfisc_s_okcode-is_display_item_msg OR
zfisc_s_okcode-is_delete_single_item OR
zfisc_s_okcode-is_release_single_item.
PERFORM handle_single_entry.
ENDCASE.
ENDFORM. " USER_COMMAND_2000
The first column in table control is a message button and the function code is zfisc_s_okcode-is_display_item_msg(a constant defined in type-pool ZFISC ). If the item is selected in table control and then you press ENTER in keyboard, the subroutine PERFORM handle_single_entry is triggered. The ok_code is cleared in PAI, so I do not think it is a metter of clearing ok_code.
‎2010 Jul 08 9:12 AM