Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to get variables in one shot in loop?

Hello Friends,

I have one internal table with fields material and plant like...

Material	Plant
m1		p1
m2		p1
m3		p1
m4		p2
m5		p2
------------------
------------------

By processing this i_tab for each record I am calculating variable v_version and material (as it is) like....

v_1	m1	" for 1st record process of i_tab
v_1	m2	" for 2nd record process of i_tab
v_2	m3	" for 3rd record process of i_tab
v_3	m4	" for 4th record process of i_tab
v_3	m5	" for 5th record process of i_tab
----------
----------

Now i have one function like call Z_VERSION_UPDATE which is called with in this loop with exporting parameter version and update the values in the tables.

My code is like....

LOOP AT i_tab into wa_tab.
	
"	Calculating version here.
	v_version = (some calculation)
	
	CALL FUNCTION 'Z_VERSION_UPDATE'

ENDLOOP.

and I want to make one shot for each version.

When it process for

v_1 m2

Function should update

v_1 m1

v_1 m2

When it process for

v_2 m3

Function should update

v_2 m3

When it process for

v_3 m5

Function should update

v_3 m4

v_3 m5

Means end of same version end it should update both.

Here, version is not field So i cant use AT commands.

Please help me out . Please post the code example.

Regards,

Ronny.

Edited by: Ronny Hanks on Sep 10, 2008 4:14 PM

Edited by: Ronny Hanks on Sep 10, 2008 4:16 PM

Edited by: Ronny Hanks on Sep 10, 2008 4:17 PM

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question