Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calling standard program with logical database

Former Member
0 Likes
1,886

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?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,207

You screen field names are wrong(as least in a 46c system). Check this.



submit rptbal00  
with <b>PNPPERNR-LOW</b> = 'XXX'
with <b>pnpbegda</b> = '20020101'
with <b>pnpenddaa</b> = '99991231'
and return.


This is working in my system.

Regards,

Rich Heilman

7 REPLIES 7
Read only

Former Member
0 Likes
1,207

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

Read only

Former Member
0 Likes
1,207

Hi,

Why dont you create a variant with those values & use..

SUBMIT RPTBAL00

USING SELECTION-SET 'VARIANT1'

AND RETURN.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,208

You screen field names are wrong(as least in a 46c system). Check this.



submit rptbal00  
with <b>PNPPERNR-LOW</b> = 'XXX'
with <b>pnpbegda</b> = '20020101'
with <b>pnpenddaa</b> = '99991231'
and return.


This is working in my system.

Regards,

Rich Heilman

Read only

0 Likes
1,207

Also, SAP recommends not to use the PERNR structure to pass/read values..

Regards,

Suresh Datti

Read only

0 Likes
1,207

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

Read only

0 Likes
1,207

Hello Rich, do you have sample code of a custom program referencing a logical database, with selection criteria in the custom?

Thanks,

Ken

Read only

asarat
Explorer
0 Likes
1,207

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.