05-07-2009 1:23 PM
Hi,
ITAB = Final internal table has 9 fields : 1 2 3 4 5 6 7 8 9
Ztable = Ztable has 6 fields ex : 1 3 4 6 7 8
Structure of both Itab and Ztable are different.
I have data in the Final Internal table and needs to update data into a ztable.
If condition is true...
Modify ztable from itab
endif.
Any suggestions how I can update Ztable from the INternal table
Regards,
Kittu
05-07-2009 1:26 PM
Hello,
Create one more internal table with simliar structure of ZTABLE
If u r condition is true
Populate the required 6 entries into that internal table
and update u r ztable from internal table
regards
05-07-2009 1:26 PM
Hello,
Create one more internal table with simliar structure of ZTABLE
If u r condition is true
Populate the required 6 entries into that internal table
and update u r ztable from internal table
regards
05-07-2009 1:26 PM
if you want to UPDATE the entries in ZTABLE,then you can declare a internal with the same structure of ZTABLE and fill the data into taht and then use the MODIFY statement..
but if u r inserting new entries you can diretly INSERT the entries in internal table to the ZTABLE
05-07-2009 1:27 PM
hello kittu ,
if two have different strucutres then declare a work area which has same as ztable
and move the fields into work area and update from this work area
hope it soles ur issue
afzal
05-07-2009 1:27 PM
Use move-corresponding to move the data contents to the work area of the ztable and update the ztable.
05-07-2009 1:28 PM
Hello,
First keep the loop to the final internal table then move all the records to the work area after moving to workarea then create another workarea for the Ztable then move only the field values which are there in Ztable then use modify keyword.
example
move:
y_wa_final_itab-kdauf to y_wa_zhr_item-vbeln,
y_wa_final_itab-kdpos to y_wa_zhr_item-posnr,
y_wa_final_itab-receiptno to y_wa_zhr_item-receiptno
modify zhr_item from y_wa_zhr_item
05-07-2009 1:29 PM
Hi Kittu,
The best thing to do here is to have an internal table with the same structure of the ztable.
1. create a new internal table with the same structure as your table
2. loop at your final table and do the conditions and update your new internal table
3. modify the ztable from your new internal table by using this MODIFY ztable FROM new_itab.
Regards,
Peter
05-07-2009 1:30 PM
If condition is true...
move-corresponding itab to ztable.
modify ztable.
clear ztable.
endif.
05-07-2009 1:30 PM
Modify ztable from itab . "COmment this
MODIFY ztable from table itab. "Add this or write table
if sy-subrc = 0.
COmmit worK. "add this staement also
Endif.
regards,
Prabhudas
05-20-2009 8:08 AM
HI ,
Thank you rfor your response!
Your suggestions were helpful...
Regards,
Kittu