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

Internal table updation

Former Member
0 Likes
995

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

10 REPLIES 10
Read only

Former Member
0 Likes
963

WA_TEST-PLANT = 'PPP'.

MODIFY TABLE TEST FROM WA_TEST TRANSPORTING PLANT.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

0 Likes
963

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

Read only

oliver
Active Contributor
0 Likes
963

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

Read only

Former Member
0 Likes
963

HI,

wa-PLANT = 'PPP'.

MODIFY TABLE itab FROM wa TRANSPORTING plant.

Read only

Former Member
0 Likes
963

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

Read only

Former Member
0 Likes
963

Hi,

you can do this way...

x_final-palnt = 'PPP'.
modify table it_final from x_final transporting plant.

this will work.

Regards

vijay

Read only

Former Member
0 Likes
963

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'.

Read only

Former Member
0 Likes
963

HI

Sorry for the above code..it doesnt fit your scenario

Read only

Former Member
0 Likes
963

hi sridevi

wth s u r mail id

Message was edited by: Muthu kumar

Read only

Former Member
0 Likes
963

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.