2009 Jan 24 2:31 AM
Hi Everyone,
I am new to the abap. Regarding these questions have a doubt pls let me know completely.
1) Have a 2 internal tables say itab1 and itab2, those having a one field.
My query is to pass the common records to 3rd internal table say final?
2) say 2 internal tables itab1 and itab2. Itab1 having 4 fields say f1,f2,f3,f4 and first two fields f1,f2 have
data and another itab2 having 3 fields f1,f3,f4 and last two fields have a data such as f3,f4.
I need to move the itab2 data to itab1 such as itab2-f3,itab2-f4 to itab1-f3,itab1-f4.
2) Difference between stock transport order and sales order?
Could u please anyone for the above...
Thanks®ards,
Rahul
Hi Everyone,
I am new to the abap. Regarding these questions have a doubt pls let me know completely.
1) Have a 2 internal tables say itab1 and itab2, those having a one field.
My query is to pass the common records to 3rd internal table say final?
2) say 2 internal tables itab1 and itab2. Itab1 having 4 fields say f1,f2,f3,f4 and first two fields f1,f2 have
data and another itab2 having 3 fields f1,f3,f4 and last two fields have a data such as f3,f4.
I need to move the itab2 data to itab1 such as itab2-f3,itab2-f4 to itab1-f3,itab1-f4.
2) Difference between stock transport order and sales order?
Could u please anyone for the above...
Thanks®ards,
Rahul
2009 Jan 24 2:42 AM
HI,
Check this code
Loop at itab1.
g_index = sy-tabix.
clear itab2.
read table itab2 with key f1 = itab1-f1.
if sy-aubrc eq 0.
itab1-f3 = itab2-f3.
itab1-f4 = itab2-f4.
Modify itab1 index g_index.
endif.
Endloop.Edited by: Avinash Kodarapu on Jan 24, 2009 8:13 AM
2009 Jan 24 4:22 AM
Hai,
loop at itab1.
read table itab2 with key f1 = itab1-f1 binary search.
if sy-subrc eq 0.
itab1-f3 = itab2-f3.
itab1-f4 = itab2-f4.
endif.
endloop.
interrelationship between Stock transport order and sales order :
Stock transport order acts as purchase order for the receiving plant
whereas it acts as a sales order for supplying plant. It contains the
shipping information in the purchase order itself.
i hope it will work out for you.
With Regards,
R.Dhineshraj.
Edited by: dhinesh raj on Jan 24, 2009 5:27 AM
2009 Jan 24 4:27 AM
hi,
1.
for example if ur itab1 itab2 is as follows
itab1
f1 f2
x x
y y
z z
itab2
f1 f2
y y
z z
a a
loop at itab1.
loop at itab2.
if itab1-f1 eq itab2-f1.
if itab2-f2 eq itab2-f2.
final-f1 = itab1-f1.
final-f2 = itab1-f2.
exit.
endif.
endif.
endloop.
endloop.
2009 Jan 24 6:16 AM
Hi Rahul,
Use this code to populated itab3 using itab1 and itab2.
Say you have:-
internal_table , work_area
itab1, wa1 ;
itab2 , wa2 ;
itab3 , wa3.
loop at itab1 into wa1.
wa3-f1 = wa1-f1.
wa3-f2 = wa1-f2.
read table itab2 into wa2 with key f1 = wa1-f1. "read itab2
if sy-subrc eq 0. "if record found
wa3-f3 = wa2-f3.
wa3-f4 = wa2-f4.
endif.
append wa3 to itab3. "append into itab3
clear wa3. "clear work_area
clear wa2. "clear work_area
clear wa1. "clear work_area
endloop.
Hope this solves you problem.
Thanks & Regards,
Tarun Gambhir
2009 Jan 24 6:24 AM
Hi, Rahul
Test the following code, hope will help you to solve your problem,
TYPES: BEGIN OF t_it,
name(10),
sale TYPE p DECIMALS 0,
END OF t_it.
DATA: it1 TYPE STANDARD TABLE OF t_it WITH HEADER LINE,
it2 TYPE STANDARD TABLE OF t_it WITH HEADER LINE,
it3 TYPE STANDARD TABLE OF t_it WITH HEADER LINE.
it1-name = 'F1'.
it1-sale = 10.
APPEND it1 TO it1.
it1-name = 'F2'.
it1-sale = 10.
APPEND it1 TO it1.
it1-name = 'F3'.
it1-sale = 10.
APPEND it1 TO it1.
it1-name = 'F4'.
it1-sale = 10.
APPEND it1 TO it1.
it2-name = 'F1'.
it2-sale = 10.
APPEND it2 TO it2.
it2-name = 'F2'.
it2-sale = 10.
APPEND it2 TO it2.
it2-name = 'F3'.
it2-sale = 10.
APPEND it2 TO it2.
LOOP AT it1 INTO it1.
READ TABLE it2 INTO it2 WITH KEY name = it1-name.
IF sy-subrc = 0.
APPEND it2 TO it3.
ENDIF.
ENDLOOP.Please Reply if any Issue,
Kind Regards,
Faisal
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |