Application Development 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: 

How to call a report thru an RFC w/o displaying the Report UI

Former Member
0 Kudos

Hi ,

I have to pass the parameter to a report thru an RFC.

I am using submit command , but I do not want SAP gui to appear..

This is the report UI code .

PARAMETERS : werks LIKE mseg-werks OBLIGATORY.

SELECT-OPTIONS : budat FOR mkpf-budat OBLIGATORY,

material FOR mseg-matnr.

I have to pass the value to the report from my RFC by assiging values to these control in my RFC . and also I do not want display the SAP GUI for the Screen.

I have used this code to achive this.

SUBMIT ZRPT_MM_045 EXPORTING LIST TO MEMORY AND RETURN

USING SELECTION-SET 'ZZZ'.

where 'ZZZ' is my variant .

the problem here is I can not change the values dynamically in my RFC. All the values in 'zzz' variant are predefined.

HOw to achive this ...

A sample piece of code greatly appreciated

thanks

pkiran

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

Hi ,

you can say:

SUBMIT ZRPT_MM_045

USING SELECTION-SET 'ZZZ'

with werks = p_werks

...

EXPORTING LIST TO MEMORY AND RETURN.

regards Andreas

4 REPLIES 4

Former Member
0 Kudos

Hi Prashanth,

As far as i know, the selection-screen will not appear when you submit a program unless there's some errorneous value that you have supplied for one of the selection-screen fields.

Can you please confirm this point ?

Regards,

Anand Mandalika.

Former Member
0 Kudos

Hello,

you could try this format of submit:

SUBMIT ZRPT_MM_045 EXPORTING LIST TO MEMORY AND RETURN

with selection-table yyyy.

<u>Documentation:</u>

Effect

seltab is an internal table with the structure RSPARAMS.

This variant allows you to set the names and contents of the parameters and selection options dynamically at runtime.

You can use the function module RS_REFRESH_FROM_SELECTOPTIONS to read the contents of the parameters and selection options of the current program into an internal table seltab with the structure RSPARAMS. By using SUBMIT ... WITH SELECTION-TABLE seltab, you can then pass these values on directly.

Hope this helps

Wolfgang

andreas_mann3
Active Contributor
0 Kudos

Hi ,

you can say:

SUBMIT ZRPT_MM_045

USING SELECTION-SET 'ZZZ'

with werks = p_werks

...

EXPORTING LIST TO MEMORY AND RETURN.

regards Andreas

0 Kudos

If you want to pass parameters dynamically without using a static variant, you can do the following.

In this example, P_1, P_2, P_3, S_1, S_2, S_3 are the names of the parameters/select-options in the submitted program. PA_1, PA_2, PA_3, SO_1, SO_2, SO_3 are fields in your RFC that can be built dynamically.



* Lets say that S_1 in the submitted program is a date 
* range.  We want to pass a seven day range starting
* today.
<b>ranges: SO_1 for sy-datum.

SO_1-sign = 'I'.
sO_1-option = 'BT'.
SO_1-low   = sy-datum.
SO_1-high  = sy-datum + 7.
append SO_1.</b>


SUBMIT ZRPT_MM_045 EXPORTING LIST TO MEMORY 
     WITH P_1 = PA_1
     with p_2 = PA_2
     with p_3 = pa_3
<b>     with s_1 in so_1</b>
     with s_2 in so_2
     with s_3 in so_3
     AND RETURN.



Regards,

Rich Heilman