‎2006 Mar 30 4:16 PM
Hi all,
I am trying to call a standard report (RPTBAL00) from a custom program without displaying the selection screen. I want to fill some of the select-options programmatically.
My code is somethig like this
submit RPTBAL00
with pernr-pernr = 'XXX'
with pernr-pnpbegda = '20020101'
with pernr-pnpenddaa = '99991231'
and return.
but the report gets called with defaults.
Does anyone know what I am doing wrong?
‎2006 Mar 30 4:31 PM
‎2006 Mar 30 4:29 PM
Hi
I seem your code is right, but I don't understand which elements are filled with default values.
Anyway this is a little code to submit a report with logical database:
..................
Co.Ge.
loop at so_umskz.
move-corresponding so_umskz to selopt.
append selopt to frange-selopt_t.
endloop.
if sy-subrc = 0.
frange-fieldname = 'UMSKZ'.
append frange to range-frange_t.
endif.
refresh frange-selopt_t.
loop at so_zlsch.
move-corresponding so_zlsch to selopt.
append selopt to frange-selopt_t.
endloop.
if sy-subrc = 0.
frange-fieldname = 'ZLSCH'.
append frange to range-frange_t.
endif.
...............
if not range-frange_t[] is initial.
range-tablename = 'BSIK'.
append range to trange.
call function 'FREE_SELECTIONS_RANGE_2_EX'
exporting
field_ranges = trange
importing
expressions = texpr.
endif.
submit rfitemap
with ................
with free selections texpr and return.
Max
‎2006 Mar 30 4:30 PM
Hi,
Why dont you create a variant with those values & use..
SUBMIT RPTBAL00
USING SELECTION-SET 'VARIANT1'
AND RETURN.
‎2006 Mar 30 4:31 PM
‎2006 Mar 30 4:52 PM
Also, SAP recommends not to use the PERNR structure to pass/read values..
Regards,
Suresh Datti
‎2006 Mar 31 10:29 AM
That solved my problem, Rich. I was using the wrong names.
Using a variant was not an option as I have to be able to change the select-options dynamically.
Thank you all for your help
‎2006 May 09 3:48 PM
Hello Rich, do you have sample code of a custom program referencing a logical database, with selection criteria in the custom?
Thanks,
Ken
‎2006 Mar 30 8:27 PM
In addition to the fields you are passing values, if it is populating additional fields that are populate dby default, try making then blank in you "Submit.....and Return" code.