Skip to Content
1
Nov 02, 2012 at 07:22 AM

how to get return value from a program using 'submit' statement

26026 Views

Hi Gurus,

I am new to abap, trying to call a program within a function module through "SUBMIT" statement.

whats my question is , I am passing importing parameters 'a' and 'b' in the submit statement. I debugged it the values of 'a' and 'b' are correctly passing to calling program and it calculating the result but i don't know how to get the result back to the calling function module.

Hereby attached the called program and calling fm code. please help me

****************************************************************************************************

FUNCTION ZTEST_GURU.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(A) TYPE I
*" REFERENCE(B) TYPE I
*" EXPORTING
*" REFERENCE(C) TYPE I
*"----------------------------------------------------------------------

submit ztest_guru with p_a = a
with p_b = b
and return.
ENDFUNCTION.

**********************************************************************************************************

REPORT ZTEST_GURU.

data: res type i.

*
parameters: p_a type i ,
p_b type i .

res = p_a + p_b.

***********************************************************************************************************