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

modify table

Former Member
0 Likes
972

Hallow I have a table with org unit

And for all org unit I have some jobid .my key for this table is org.unit my problem is that I have in jobid the belong to 163 0000 how can I have 163 for all this job

For example I don’t wont 000 for abc because its belong to 163 I wont 163 instead of 000

How I can do that

thankes

Org unit jobid

163 abc

000 abc

000 abc

000 abc

523 de

000 de

000 de

111 f

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
904

misunderstood ur question...here it goes

loop at itab into wa_itab.

at new org_unit.

clear : flag , v_orgunit.

v_orgunit = wa_itab-org_unit.

flag = 'X'.

endat.

if flag ne 'X'.

wa_itab-orgunit = v_orgunit.

modify itab from wa_itab.

endif.

endloop.

Message was edited by:

Chandrasekhar Jagarlamudi

7 REPLIES 7
Read only

Former Member
0 Likes
904

I Think it is better to use another table for this

loop at itab.

at new orgunit.

v_ordunit = itab-orgunit.

endat.

move-corresponding itab to itab2.

itab2-orgunit = v_orgunit.

append itab2.

clear otab2.

endloop.

Regards,

Ravi

Read only

Former Member
0 Likes
905

misunderstood ur question...here it goes

loop at itab into wa_itab.

at new org_unit.

clear : flag , v_orgunit.

v_orgunit = wa_itab-org_unit.

flag = 'X'.

endat.

if flag ne 'X'.

wa_itab-orgunit = v_orgunit.

modify itab from wa_itab.

endif.

endloop.

Message was edited by:

Chandrasekhar Jagarlamudi

Read only

0 Likes
904

hi ravi

how i declere flag

regards

Read only

0 Likes
904

HI,

Data My_Flag type BOOLEAN.

loop at itab into wa_itab.

clear : my_flag , v_orgunit.

at new unit.

v_orgunit = wa_itab-unit.

my_flag = 'X'.

endat.

if my_flag ne 'X'.

wa_itab-unit = v_orgunit.

modify itab from wa_itab.

endif.

endloop.

Regards

SAB

Read only

Former Member
0 Likes
904

Hi Antonio,

You can either copy all of 'em which you want to change and then change them manually if the table ( This is database table !! ).

Else, you can write a program to get all the non-163 org unit data and then replace the org unit with 163 and then insert those entries in the database.

Hope this helps

Regards

Nishant

Read only

Former Member
0 Likes
904

use modify statement and condition where 1=1.

modify table itab from witab transporting org_unit.

where witab is a workarea for itab

Regards,

Wojciech

Read only

Former Member
0 Likes
904

Hi Antonio,

Please try this.

DELETE ITAB WHERE ORG_UNIT = '000'.

Regards,

Ferry Lianto