‎2010 Feb 11 7:46 AM
Dear All,
I am trying to develop on module pool program using push buttons to pass the data to input/out filed. When I do the debugging the sy-ucomm is showing the data but not OK_CODE in case statement.
Case OK_CODE.
When 'one'.
num = '1'.
call function 'ZCA_INPUT_OUT'.
Import
numz = num
export
number = inputi. " input/output field in screen painter
end case.
Can you pls give me a solutions what is the main mistake I did here.
I could not able to pass the data through push button to input/out field.
Regards,
Chandra.
‎2010 Feb 11 9:03 AM
hi,
i think you are write OK_CODE entry in the Module pool screen's Element list is not there.enter OK_CODE in last of the element list.
Regards
Gaurav
‎2010 Feb 11 7:59 AM
have you declared ok_code in the top include of your module pool program
DATA: ok_code TYPE sy-ucomm.
In the element list of your screen.
give Name of a Screen Element : OK_CODE .
then it will have value same as sy-ucomm.(system varaible to hold the user selected function code value)
‎2010 Feb 11 8:16 AM
You need to declare OK_CODE TYPE SY_UCOMM. And pass sy-ucomm value to ok_code.
‎2010 Feb 11 8:22 AM
hi,
OK_code is a user define variable where as SY_UCOMM is a system variavle to store the user action for example double click, etc.
what you have to do.
DATA: ok_code type sy-ucomm.
ok_code = sy-ucomm
use the above code before the case statement in your code its works fine.
hope this helps
Regards
Ritesh
‎2010 Feb 11 8:54 AM
I have written this code in main program. When I am declaring the data types.
‎2010 Feb 11 8:59 AM
Hi Chandra,
>John wrote:
>
>In the element list of your screen.
>give Name of a Screen Element : OK_CODE .
>
>then it will have value same as sy-ucomm.(system varaible to hold the user selected function code value)
You declared this one?
Regards,
Swarna Munukoti
Edited by: Rob Burbank on Feb 11, 2010 1:21 PM
‎2010 Feb 11 9:00 AM
OK_CODE is just a user define field to transfer SY-UCOMM data to your main program....You have to link them in Element List --> General attributes to field of type OK....If you define variable with same name (OK_CODE) in your main program, values of SY-UCOMM will automatically get transferred to it...
You may very define this variable as OKIE_CODE, OKKKK_CODE or whatever you like
Thanks,
Regards,
Mohaiyuddin
‎2010 Feb 11 11:24 AM
Hi Swarna,
I have not created this field in screen painter.
Can you pls explain how to assign this field in screen painter. Do you want me to just mention in field attributes ... or some where else I need to assign .........
pls give me the replay asap.
Regards,
Chandra.
‎2010 Feb 11 11:47 AM
Hi,
In screen painter you have Attributes, Element list and Flowlogic tabs. In the Element list tab create OK_CODE.
Thanks,
Sri.
‎2010 Feb 11 11:51 AM
You don't have to create it, there will be field with type OK created by default...You have to mention OK_CODE as it's name and define same in your main program
Data : OK_CODE type sy-ucomm.
‎2010 Feb 11 11:52 AM
Only one answer.Do not copy the codes.Just understand them first
‎2010 Feb 11 11:54 AM
Hi Chandra,
This is not a seperate field to create. In the element list tab, the last row contains a type - OK. Write ok_code in the Name column against this OK type.
Hope you already know the path to elementary list tab.
Regards,
Swarna Munukoti.
‎2010 Feb 11 11:55 AM
Hi Aditya,
Can you please elaborate your comment ?? "COPY THE CODE???"
Regards,
Mohaiyuddin
‎2010 Feb 11 8:51 AM
In SCREEN PAINTER (SCREEN LAYOUT) you give push button name = ONE
and Fctcode = ONE
CASE sy-ucomm
WHEN 'ONE'
‎2010 Feb 11 8:53 AM
‎2010 Feb 11 9:03 AM
hi,
i think you are write OK_CODE entry in the Module pool screen's Element list is not there.enter OK_CODE in last of the element list.
Regards
Gaurav
‎2010 Feb 11 6:12 PM
Hi ,
In the element list tab, the last row contains a type - OK. and there have you write OK_CODE in 1st column last where ok is written in front of that and activate .......
Regards,
gaurav
‎2010 Feb 11 6:33 PM
Hi all,
still I have same problem.
below is my program code.
REPORT ZCA_CALCULATOR_DEMO.
DATA INPUTI TYPE string.
Data num type string.
DATA: OK_CODE TYPE SY-UCOMM,
save_ok like ok_code.
call screen '100'.
INCLUDE ZCA_CALCULATOR_DEMO_STATUS_O03.
----
***INCLUDE ZCA_CALCULATOR_DEMO_STATUS_O03 .
----
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GUI100'.
SET TITLEBAR 'ZCHAR'.
ENDMODULE. " STATUS_0100 OUTPUT
INCLUDE ZCA_CALCULATOR_DEMO_USER_COI01.
----
***INCLUDE ZCA_CALCULATOR_DEMO_USER_COI01 .
----
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
save_ok = ok_code.
clear ok_code.
CASE save_ok.
WHEN 'one'.
num = '1'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'two'.
num = '2'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'three'.
num = '3'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'FOUR'.
num = '4'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'FIVE'.
num = '5'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'SIX'.
num = '6'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'SEVEN'.
num = '7'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'EIGHT'.
num = '8'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'NINE'.
num = '9'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
WHEN 'ZERO'.
num = '0'.
CALL FUNCTION 'ZCA_CAL_INPUT'
EXPORTING
NUM = num
IMPORTING
NUMBER = inputi.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
function zca_cal_input.
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(NUM) TYPE STRING
*" EXPORTING
*" REFERENCE(NUMBER) TYPE STRING
*"----
data: nextnum type string,
currnum type string.
loop at screen.
if screen-name = 'inputi'.
nextnum = num.
concatenate currnum nextnum into currnum.
number = currnum.
endif.
endloop.
endfunction.
this is my entire program code.
now I have mention OK_code type ok in screen painter attribute also.
but still haveing sample problem .......
can you pls some one will explain what need to be done in this case.
Regards,
Chandra V
‎2010 Feb 12 7:24 AM
I hope function codes ONE, TWO.....ZERO are defined in PF-STATUS...-- just to cross check.
Also check if PF-STATUS is activated to be on safer side..
If I am correct, are you defining these buttons on Screen?
Regards,
Mohaiyuddin
Edited by: Mohaiyuddin Soniwala on Feb 12, 2010 12:55 PM
‎2010 Feb 12 6:34 AM
hi,
code looks fine...
recheck ....ok_code entry in elementary list & Activate screen painter,screen again.
regards
Gaurav
‎2010 Feb 15 8:33 AM
In screen painter you have to assign push button's fcode and name then and then your code is work
‎2010 Feb 15 9:10 AM
‎2010 Feb 16 12:43 PM