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: 

Calling report in a Function module.

former_member184111
Active Contributor
0 Kudos

Hi ABAPers,

I am trying to call an executable ABAP report within a FM using SUBMIT as follows:

Data: wa_flight type zabapreport .

loop at itab_flight into wa_flight .
submit "TAW10_BASICS_CALL_FUNCTION"
 with  "pa_carr" eq wa_flight-carrid 'I'
       "pa_occ" eq wa_flight-seatsocc 'I'
       "pa_paysu" eq wa_flight-paymentsum 'I'
       "pa_curr" eq wa_flight-currency 'I'
       and return .
   endloop.

but when i try to test the FM by passing values to itab_flight ie import parameter i get the following error..

On account of a branch in the program

(CALL FUNCTION/DIALOG, external PERFORM, SUBMIT)

or a transaction call, another ABAP/4 program

is to be loaded, namely "WITH".

However, program "WITH" does not exist in the library.

Possible reasons:

a) Wrong program name specified in an external PERFORM or

SUBMIT or, when defining a new transaction, a new

dialog module or a new function module.

b) Transport error

what am i doing wrong?

Thanks,

Anubhav.

ENDFUNCTION.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, get rid of the quotes around the parameter names and the program name.

submit TAW10_BASICS_CALL_FUNCTION
 with  pa_carr = wa_flight-carrid
         pa_occ = wa_flight-seatsocc
         pa_paysu = wa_flight-paymentsum 
         pa_curr = wa_flight-currency
            and return .

Regards,

Rich Heilman

1 REPLY 1

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, get rid of the quotes around the parameter names and the program name.

submit TAW10_BASICS_CALL_FUNCTION
 with  pa_carr = wa_flight-carrid
         pa_occ = wa_flight-seatsocc
         pa_paysu = wa_flight-paymentsum 
         pa_curr = wa_flight-currency
            and return .

Regards,

Rich Heilman