‎2007 Jul 11 11:06 AM
Hi all,
I've created a selection screen with several select-options.
however after i enter the 'execute' button, the program exit without any warning and return to the main menu.
what've i done wrong here and how to correct it?
thanks
‎2007 Jul 11 11:07 AM
Hi,
DO you have code in the START-OF-SELECTION event block.
Any List generating statements like WRITE, ULINE or SKIP etc.
Can you show us your code.
Regards,
Sesh
‎2007 Jul 11 11:07 AM
Hi,
DO you have code in the START-OF-SELECTION event block.
Any List generating statements like WRITE, ULINE or SKIP etc.
Can you show us your code.
Regards,
Sesh
‎2007 Jul 11 11:16 AM
Mr Sesh, here is my code
SELECTION-SCREEN BEGIN OF BLOCK frm1 WITH FRAME TITLE text-t01 .
SELECT-OPTIONS : sidnum FOR zcustomer-idnumber,
sconame FOR zcustomer-contactname,
SELECTION-SCREEN END OF BLOCK frm1.
SELECT * FROM zcustomer WHERE ( idnumber IN sidnum ) and
( contactname IN sconame ).
MOVE-CORRESPONDING zcustomer TO tbl_customer.
APPEND tbl_customer. CLEAR tbl_customer.
ENDSELECT.
loop at tbl_customer.
itab-idnumber = tbl_customer-idnumber.
itab-coname = tbl_customer-contactname.
APPEND itab. CLEAR itab.
endloop.
loop at itab.
add 1 TO bil.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
write:/1(274) sy-uline.
write:/1 sy-vline , 2 bil, 7 sy-vline ,
8 sy-vline,
22 sy-vline , 23 itab-idnumber, 39 sy-vline ,
40 itab-coname, 70 sy-vline , 71 sy-vline ,
119 sy-vline , 120 sy-vline , 134 sy-vline,
135 sy-vline , 159 sy-vline,
160 sy-vline , 170 sy-vline,
171 sy-vline , 195 sy-vline,
196 sy-vline , 206 sy-vline,
207 sy-vline , 236 sy-vline,
237 sy-vline , 255 sy-vline,
256 sy-vline ,
274 sy-vline.
endloop.
write:/1(274) sy-uline.
TOP-OF-PAGE.
SKIP 2.
WRITE:/1(206) 'SENARAI FAIL PERMOHONAN LESEN PERNIAGAAN' CENTERED.
SKIP 1.
WRITE:/1(274) sy-uline.
FORMAT COLOR COL_HEADING.
WRITE:/1 sy-vline , 2 'Bil' , 7 sy-vline ,
8(15) 'XXXXXX' CENTERED, 22 sy-vline ,
23(12) 'XXXXX' CENTERED, 39 sy-vline ,
40(30) 'XXXXXXXXXXXXXXXXXXXXXX' CENTERED, 70 sy-vline ,
71(48) 'XXXXXXXXXXXXX' CENTERED, 119 sy-vline ,
120(14) 'XXXXXX' CENTERED, 134 sy-vline,
135(24) 'XXXXX' CENTERED, 159 sy-vline,
160(10) 'XXXXX' CENTERED, 170 sy-vline,
171(24) 'XXXXX' CENTERED, 195 sy-vline,
196(10) 'XXXXX' CENTERED, 206 sy-vline,
207(29) 'XXXXX' CENTERED, 236 sy-vline,
237(18) 'XXXXX' CENTERED, 255 sy-vline,
256(18) 'XXXXX' CENTERED, 274 sy-vline.
FORMAT COLOR OFF.
‎2007 Jul 11 11:56 AM
insert "START-OF-SELECTION." or "END-OF-SELECTION." between "SELECTION-SCREEN END..." and "SELECT * FROM..."
‎2007 Jul 12 11:01 AM
sorry still cannot solve the problem. no matter where i put start-of-selection and end-of-selection, the program keeps exiting to the main menu after i execute. Any other help please, experts?
‎2007 Jul 13 6:51 AM
Try the following... comment out all your code and replace it with (temporarily):
report zlocal_jc_pf_status.
tables:
sscrfields. "Fields on selection screens
parameters:
p_test type checkbox default 'X'.
at selection-screen output.
perform message.
at selection-screen.
perform message.
start-of-selection.
perform message.
*&---------------------------------------------------------------------*
*& Form message
*&---------------------------------------------------------------------*
form message.
break-point.
message i398(00) with 'PF-KEY' sy-pfkey 'UCOMM:' sy-ucomm.
break-point.
message i398(00) with 'SCCRFIELDS-UCOMM' sscrfields-ucomm space space.
endform. "messageWhen you run it, step through the breaks and display SY-PFKEY and SY-UCOMM and SCCRFIELDS-UCOMM at each stage... what do you see... are you getting something like "%_00" for SY-PFKEY and "ONLI" when you execute, or something else?... To get the behaviour you are describing, it seems that the "execute" is causing the code to exit instead of run, and the PF-STATUS seems the most likely culprit. You could try creating a brand new report program, and pasting your existing code across there to test this too.
‎2007 Jul 13 10:49 AM
Mr Coleman,
I've replace the code as u suggested for testing. The result :
SY-PFKEY -> %-CS
SY-UCOMM -> CRET
SSCRFIELDS-UCOMM ->CRET
What does that mean?
I also have created new report and pasted the code at the new report but the result remains the same.
I didnt put any PF-STATUS in my program. therefore how it can be the problem?
‎2007 Jul 13 10:59 AM
Hi,
What are the attributes of your program? <i>Goto - Attributes</i> from The Editor.
I have seen similar problems where the program is defined as a Module Pool (type M), when it should be an executable (type 1)
‎2007 Jul 14 12:56 AM
Are you running this from SE38, or a transaction code? - I saw something similar quite recently once where the transaction code that called the report had been set up wrongly, so I deleted it and recreated the transaction code correctly and all was good.
‎2007 Jul 16 3:08 AM
Thanks Mr Coleman for the suggestion. It solve the problem. I think the previous trans code was wrongly created where I maybe select the wrong select object during creation. For the second trans code, I selected 'program and selection screen (report transaction)' and right now the program can execute correctly. I've awarded points to u. thanks again