‎2008 Mar 07 11:50 AM
Hi Experts!!
I have two tables A and B.
A has two value 10
20.
B is empty here.
{Loop at A.
Call Fuction ' Find_Value'
Export
em_a = A
Import
im_b = B.
Endloop.}
here b has 3 records
75
25
39
case-2: I want to call same function module.
I want pass B value here till following condition satisfy. Let Say 10times.
Problem is I dont want to call same function module again and again.
{loop at B.
Call Fuction ' Find_Value'
Export
em_a = B
Import
im_b = B.
Table B,Field A = Table A Field C.
if B-A = A-C
Exit.
endif.
Endloop. }
Please suggest how to call above Fuction Module recursively for all value...in B.
Any clarification appreciated.
Please suggest.
Anee.
‎2008 Mar 07 12:21 PM
use a local variable to assign the value of B.
and after calling the FM, update B.
keep calling the FM in a loop until and unless until the value of prev B = the local variable.
‎2008 Mar 07 12:21 PM
use a local variable to assign the value of B.
and after calling the FM, update B.
keep calling the FM in a loop until and unless until the value of prev B = the local variable.
‎2008 Mar 07 12:36 PM
Hi,
Thanks for your quick reply.
But how to do that.
if B has 3 values, again each record giving me multiple import value. I have to again pass the same function module to find their subtransaction values.
when condition not satisfied , then quit.
Please give me example if any u have.
‎2008 Apr 16 1:50 PM
Hi anee,
use do...while loop.
declare a flag
Data flag type c.
do
if sy-index eq 10.
flag = 'X'.
endif.
call function
Export
tab = B
IMPORT
tab = B.
while flag <> 'X'.
it will call the same function 10 times.
Reward if helps.
Edited by: Hemant on Apr 16, 2008 6:21 PM