on 11-28-2005 5:58 PM
Hi,
I am trying to enhance the screen FB12. User must be able to enter a range of values for a few fields like Company code, document number, posting date etc.
So I am trying to write a custom program say ZFB12 and want these fields to be displayed for user selection. After the user select the values, correspondence should be generated just like FB12 functionality.
It so happened that I copied the program responsible for FB12 and tried to add Selection screen fields like
SELECT-OPTIONS: so_cc FOR BKPF-BURKS,
so_doctype FOR BKPF-BLART,
so-entrydate FOR BKPF-CPUDT,
so_postingdate FOR BKPF-budat,
so_docnum FOR BKPF-BELNR,
so_fiscalyear FOR BKPF-GJAHR.
START-OF-SELECTION.
But I am getting a syntax error, which says
"SELECT-OPTIONS is only allowed between BEGIN/END OF SCREEN for programs with type other than 1"
What does it mean and what am I supposed to do ??
thanks
Hi, Please check whether the copied program is a module pool program, in which case you may have to change it to executable program.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Select Options or Parameters will work only for the report type of programs. I think you might have selected include type of program. So, select Report type in the attributes in SE38.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't know if this will help you because I don't know your full requirement, the function module in FB12 can only have the company code passed to it, so the other select-options are irrelavant.
report zrich_0001.
tables: bkpf.
select-options: so_cc for bkpf-bukrs,
so_doce for bkpf-blart,
so_edate for bkpf-cpudt,
so_pdate for bkpf-budat,
so_docn for bkpf-belnr,
so_fyr for bkpf-gjahr.
start-of-selection.
call function 'CORRESPONDENCE_SELECTION'
exporting
i_company = so_cc-low
exceptions
others = 1.
Regards,
Rich HEilman
this error occur when you are trying to use a select-option or parameter in a program that is not a report.
Try it,
Step 1 -> Declare in your TOP.
Tela
selection-screen begin of screen 9000 as subscreen.
selection-screen begin of block bl1.
parameters p_kunnr type kna1-kunnr.
select-options so_kunnr for kna1-kunnr.
selection-screen end of block bl1.
selection-screen end os screen 9000.
Step 2 -> On the screen, create a sub-screen.
Step 3 -> include the called for your su-screen in your poo, where:
v_dynpro = 9000 and
v_repid = program name
call subscreen "subscreen" INCLUDING v_repid v_dynpro.
step 4 -> in PAI include. It's calling the selection-screen event,
call subscreen "subscreen".
Alexandre Nogueira
Alexandre Nogueira
Did you copy SAPMF05M? If so, this is a module pool program, and in my system I don't think you really need. It calls a function module....
SET PARAMETER ID 'BUK' FIELD RF022-BUKRS.
CALL FUNCTION 'CORRESPONDENCE_SELECTION'
EXPORTING I_COMPANY = RF022-BUKRS
EXCEPTIONS OTHERS = 1.
Or are you coping this function module above?
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I did copy the program SAPMF05M.
Let me state my requirement very clearly..
Currently that program SAPMF05M allows users to input the Company code, on it's selection, document number, and fiscal year. But my requirement is to include a few more input fields and also provide range options !!
So I want one screen which will allow the user to input these as range and based on this input , invoice documents will be fetched from a table and stored in output table...
Later on with f.64 transaction code, user will select these to be printed !!
I want to develop a program similar to what SAPMF05M does and finally have it scheduled as a batch task so that it runs every morning !!
Also, I want to reuse the logic of SAPMF05M to store the invoice records retrived based on user input.
Can I just create a report program and have the selection screen there and from there call the function module responsible for data retrieval and storage in output tables ??
Please let me know if I am not clear !!
thanks
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.