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

Using Function Module in a Loop

Former Member
0 Likes
648

Hi Gurus,

I have a program with a function module "TB_DATAFEED_MODIFY_OICQP"for updating table OICQP for price data.

The function module can be used for mass update but user requirement is in such a way that the error records which are not updated needs to be displsyed in LOG.

So i was using the function module inside the final loop of data and doing the update 1 by 1 and checking SY-SUBRC = 0.

The function module has a ENQUE , DEQUE function inbuilt inside this.

QUESTION: Is there any problem in using a mass update function module in LOOP, but only updating record 1 by 1.

Avi.

4 REPLIES 4
Read only

former_member404244
Active Contributor
0 Likes
570

Hi,

I don't see any problem in that.

Regards,

Nagaraj

Read only

former_member1125862
Participant
0 Likes
570

Hi,

You will not get any problem while writing that in LOOP.

read it 1 by 1.

Go a head.

Kruthik

Read only

mrio_espinheira
Participant
0 Likes
570

Hello,

Well, it all depends on the volume of data, if it is too much, you can eventually have time out problems. If you can, run your program in background, as a job, and at least you will never have a time out.

Best regards.

Read only

Former Member
0 Likes
570

it's not preferred, but if there is no alternate solution. Calling function module in loop for 100 to 5000 times usually works ok (depending on FM memory handling). If it's complex, usually performance goes on reducing. one can measure time after each call & then see how time taken for each call, goes on increasing.