‎2007 Aug 03 9:51 AM
Hi.
i am getting error in screen printer its showing like this
Unable to interpret "OK_CODE " as a number .
am using CASE SY-UCOMM statement. what may be the problem
my code.
module CLEAR INPUT.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
LOOP AT SCREEN.
IF Screen-name = 100.
Screen-input = 0.
ENDIF.
ENDLOOP.
ta = 1.
IF SY-UNAME = 'SKOKANE'.
CLEAR ITAB.
SELECT * FROM ZSETTLEMENT INTO ITAB WHERE SLNO = ITAB1-SLNO.
APPEND ITAB.
ENDSELECT.
ITAB1-ECOD = ITAB-ECOD.
APPEND ITAB1.
ENDIF.
ENDCASE.
endmodule. " CLEAR OUTPUT
‎2007 Aug 03 10:04 AM
Hi..
There are several errors in you code.
1) You can use LOOP AT SCREEN.. in a PAI module it works only in PBO module
2) IF SCREEN-NAME = 100
Here NAME stores the Screen field names , not the Screen number.
So you have to use
MODULE TEST OUTPUT. "this is called in PBO
LOOP AT SCREEN.
<b> IF SCREEN-NAME = 'MARA-MATNR'. </b> "Screen field
SCREEN-INPUT = 0.
<b> MODIFY SCREEN .</b> "This line is missing in ur code
ENDIF.
ENDLOOP.
Here you are getting the error for OK_CODE bcoz you are using
IF SCREEN-NAME = 100. "Without quotes
<b>Reward if Helpful.</b>
module CLEAR INPUT.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
LOOP AT SCREEN.
IF Screen-name = 100.
Screen-input = 0.
ENDIF.
ENDLOOP.
ta = 1.
IF SY-UNAME = 'SKOKANE'.
CLEAR ITAB.
SELECT * FROM ZSETTLEMENT INTO ITAB WHERE SLNO = ITAB1-SLNO.
APPEND ITAB.
ENDSELECT.
ITAB1-ECOD = ITAB-ECOD.
APPEND ITAB1.
ENDIF.
ENDCASE.
endmodule. " CLEAR OUTPUT
‎2007 Aug 03 9:55 AM
Hi ,
Enclose the screen name in quotes
Screen-name = ' '.
And u cant pass the screen name as number..give the name in capital letter.
Hope this would work.
‎2007 Aug 03 9:56 AM
Hi
You have to pass the function code for the Sy-ucomm as a 4 digit code
WHEN 'DISPLAY'.
declare as DISP as function code for the display button and use and see
use WHEN 'DISP'.
and give the field name in caps and quotes instead of number like
screen-name = 'ITAB-KUNNR'.
<b>Reward points for useful Answers</b>
Regards
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Aug 03 10:12 AM
ITS giving same error no change.
if u have any working code please give me .
regards
prajwal
‎2007 Aug 03 10:00 AM
Hi Prajwal,
If you declare a Variable as Character[ Data Type : C" means, you must give your data's with in the Quote.
Example :
Data : Name(10) Type C.
Name = ' prajwal'.
otherwise it shows error as like you get.
Thanks,
Reward If Helpful.
‎2007 Aug 03 10:04 AM
Hi..
There are several errors in you code.
1) You can use LOOP AT SCREEN.. in a PAI module it works only in PBO module
2) IF SCREEN-NAME = 100
Here NAME stores the Screen field names , not the Screen number.
So you have to use
MODULE TEST OUTPUT. "this is called in PBO
LOOP AT SCREEN.
<b> IF SCREEN-NAME = 'MARA-MATNR'. </b> "Screen field
SCREEN-INPUT = 0.
<b> MODIFY SCREEN .</b> "This line is missing in ur code
ENDIF.
ENDLOOP.
Here you are getting the error for OK_CODE bcoz you are using
IF SCREEN-NAME = 100. "Without quotes
<b>Reward if Helpful.</b>
module CLEAR INPUT.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
LOOP AT SCREEN.
IF Screen-name = 100.
Screen-input = 0.
ENDIF.
ENDLOOP.
ta = 1.
IF SY-UNAME = 'SKOKANE'.
CLEAR ITAB.
SELECT * FROM ZSETTLEMENT INTO ITAB WHERE SLNO = ITAB1-SLNO.
APPEND ITAB.
ENDSELECT.
ITAB1-ECOD = ITAB-ECOD.
APPEND ITAB1.
ENDIF.
ENDCASE.
endmodule. " CLEAR OUTPUT