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 statement for Table-Field-Field

Former Member
0 Likes
858

Hi Guys,

I am using this structure LBBIL_INVOICE.

My Internal table is like this structure.

I used Modify statement as below


Loop at itab-it_gen tinto wa.
   " some read condition for getting one value.
 wa-x = read condition value.
Modify itab-it_gen from wa.
Endloop.

I am getting error as The field Itab-it_gen cannot be changed.

What is the procedure to modify itab-it_gen?

Thanks,

Prasad.

Edited by: Dheeru Prasad on Jul 13, 2009 5:00 PM

7 REPLIES 7
Read only

Former Member
0 Likes
819

Per my understanding, you can try below

Loop at itab-it_gen tinto wa.
 data: index  type sy-tabix.
   index = sy-tabix.
   " read condition

 wa-x = read condition value.
Modify itab-it_gen index from wa
           transporting x.
Endloop.

Edited by: Raja gurrala on Jul 13, 2009 5:17 PM

Read only

0 Likes
819

Dear Raja,

Still I am getting the same error message The field ITAB-IT_GEN cannot be changed.

Here IT_GEN has some more fields.How to update one field of IT_GEN.

Thanks,

Prasad.

Edited by: Dheeru Prasad on Jul 13, 2009 5:40 PM

Read only

0 Likes
819

Hi,

I think u have used this table in a form routine in which u might have used this table as using parameter. Instead use it as changing parameter.

I do not know if that is the case. Plz chk and let me know if there are concerns.

Thanks

sourav

Read only

0 Likes
819

Sorry. I should not see your requirment.

You can make use of below code to make it to work for you.

COMPANY internal table has Address. Similarly like ITAB has IT_GEN

adress-street= 'Rue des Montagnes'.
    address-city   = 'Geneve'.
    READ TABLE company_tab
         WITH TABLE KEY name = 'COMP1'
         INTO company.
    READ TABLE company-addresses TRANSPORTING NO FIELDS
               WITH TABLE KEY city = address-city.
    idx = sy-tabix.
    MODIFY company-addresses FROM address INDEX idx.
    MODIFY TABLE company_tab FROM company.

Hope it helps you.

Regards,

Raja

Read only

former_member302911
Active Participant
0 Likes
819

Hi,

this is a similar working example:



DATA BEGIN OF SYSTTB OCCURS 0.
INCLUDE STRUCTURE SYST.
DATA X.
DATA END OF SYSTTB.

DATA WA LIKE LINE OF SYSTTB.

MOVE-CORRESPONDING SYST TO SYSTTB.
APPEND SYSTTB.

LOOP AT SYSTTB INTO WA.

MOVE 'X' TO WA-X.
MODIFY SYSTTB FROM WA.

ENDLOOP.

REgards,

Angelo.

Read only

0 Likes
819

No Dudes,

Nothing is working out for me.

Read only

Former Member
0 Likes
819

Guys,

I resolved it myself.