‎2007 Apr 12 8:46 AM
Hi
I want to check one condition
ex : select field1 field2 from table
into i_table..where..
select from table1
select from table2 for all entries of table1.
now ..
if i_table-field1 = something
perform update table1 table2.(in this perform iam passing to bapi fm from tabl1 and table2)
which tables to loop..and read here..i tried..but not working...dont know where doing mistake..
Please help me on this.
thanks in advance
‎2007 Apr 12 9:03 AM
Hi,
loop at table1.
if table1-field = 'required value'.
read table table2 with key k1 = table1-key1.
if sy-subrc = 0.
perform f_ff.
endif.
endif.
endloop.
Regards,
Sonika
‎2007 Apr 12 8:52 AM
Hi,
loop at table1 and read table2 based on some field
and write ur code in loop.
Regards,
Sonika
‎2007 Apr 12 8:53 AM
‎2007 Apr 12 8:55 AM
Hi,
Consider the example of EKKO and EKPO.
select the data from EKKO and use the data in itab1 to fetch the data fromEKPO.this is itab2.
Now use second itab since it as an item level
loop at itab2 into wa2.
read table itab1.
call BAPI.
endloop.
Regards
Kannaiah
‎2007 Apr 12 9:02 AM
Hi
I know those how to loop and fetch..
My req is I want to check condition first then proceed further.
to check the condition iam using select at beginning...
after i had written some code...
now i want to check condition again for this..
assume i have 10 performs ...for every perform iam checking condition
..now i want to check that condition
select system abc from zdabc..
if i_zdpd-system = 'abc'
perform ...
‎2007 Apr 12 9:03 AM
Hi,
loop at table1.
if table1-field = 'required value'.
read table table2 with key k1 = table1-key1.
if sy-subrc = 0.
perform f_ff.
endif.
endif.
endloop.
Regards,
Sonika
‎2007 Apr 12 9:06 AM
try like this
data : index1 like sy-tabix,
index2 like sy-tabix.
loop at itab1.
index1 = sy-tabix.
if itab1-field1 = something.
read table itab2 with key f1 = itab-f1<ince u are using for all entries means common field may be there>
if sy-subrc = 0.
index2 = sy-tabix.
perform update .
endif.
endif.
form update.
read table itab1 index index1.
itab1-field = changevalue.
modify itab1 index index1.
read table itab2 index index2.
itab2-field = changevalue.
modify itab2 index index2.
endform.
regards
shiba dutta