‎2006 Jul 18 7:20 AM
Hi,
Internal table declaration
data: begin of test occurs 0,
salesorg type vkorg,
palnt type werks,
end of test.
Internal table Data
Sales org Plant
-
XXX PPP
YYY OOO
ZZZ III
-
Now the plant of all records should be changed to 'PPP' <b>without looping the test table.</b>
<u><i>Need syntax for changing plant in all records to PPP without using loop statement.</i></u>
Regards,
Sreedevi P
‎2006 Jul 18 7:27 AM
WA_TEST-PLANT = 'PPP'.
MODIFY TABLE TEST FROM WA_TEST TRANSPORTING PLANT.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 18 8:51 AM
Ravi,
Data declaration is
ORDER_ITEMS_IN type STRUCTURE BAPIITEMIN,
wa_order_items_in LIKE order_items_in.
Population is
wa_order_items_in-plant = 'R81N'.
MODIFY TABLE order_items_in FROM wa_order_items_in
TRANSPORTING plant.
<b>After modify statement sy-subrc = 4 it's not modifying table order_items_in.</b>
What is the problem?
Sreedevi
‎2006 Jul 18 7:30 AM
Hi Sreedevi,
You can do something like
data: lv_cnt type i value 0.
do.
read table lt_itab index i.
if sy-subrc eq 0.
* do work here
else.
break.
endif.
i = i + 1.
enddo.
regards,
ok
‎2006 Jul 18 7:32 AM
HI,
wa-PLANT = 'PPP'.
MODIFY TABLE itab FROM wa TRANSPORTING plant.
‎2006 Jul 18 7:33 AM
Hi Sreedevi,
I don't think you can do that modification of the only one field without looping the internal table.
Looping the internal table is the best alternative.
Loop at test.
test-plant = 'PPP'.
Modify test transporting plant.
Endloop.
Reward if helpful.
Regards,
Tushar
Message was edited by: Tushar Marshall Dass
‎2006 Jul 18 7:39 AM
Hi,
you can do this way...
x_final-palnt = 'PPP'.
modify table it_final from x_final transporting plant.this will work.
Regards
vijay
‎2006 Jul 18 9:13 AM
Hi
Try doing it this way..
DATA: BEGIN OF TAB OCCURS 500,
FLAG TYPE C,
COMP(20) TYPE C,
END OF TAB.
CLEAR TAB-FLAG.
MODIFY TAB TRANSPORTING FLAG WHERE FLAG = 'X'.
‎2006 Jul 18 9:18 AM
‎2006 Jul 18 11:16 AM
‎2006 Jul 18 11:26 AM
Sridevi,
I dont think that u will be able to modify all the records with a single statement.
Either u will have to loop at the itab or read each row of the itab using index and modify it.
loop at itab is the better option.