‎2007 Jun 01 11:55 AM
Hi All.
it_tab1: (Po number) EBELN, (Line item number) EBELP , (vendor) LIFNR, (plant) WERKS, (material number) MATNR,NETPR ,PEINT.
IT_tab2: (Po number) EBELN, (Line item number) EBELP , (vendor) LIFNR, (plant) WERKS, (material number) MATNR. etc.
it_tab1 internal table gets value from EXCEL .
it_tab2 internal table gets value from header and line item.
Now i need to change value for fileds NETPR ,PEINT in internal table it_merge from it_excel.
Thanks
Jay
‎2007 Jun 01 1:11 PM
ty this,
ow i need to change value for fileds NETPR ,PEINT in internal table it_merge from it_excel.
loop at it_excel.
it_excel-netpr = 'changed value'.
it_excel-peint = 'changed value'.
modify it_excel transporting netpr peint.
append it_merge from it_excel.
endloop.
reward point if useful
Regards,
Imran
‎2007 Jun 01 12:05 PM
Use table control in the screen and called internal table. Use input/output attribute for fileds NETPR ,PEINT . You can get codes from abap examples.
‎2007 Jun 01 1:11 PM
ty this,
ow i need to change value for fileds NETPR ,PEINT in internal table it_merge from it_excel.
loop at it_excel.
it_excel-netpr = 'changed value'.
it_excel-peint = 'changed value'.
modify it_excel transporting netpr peint.
append it_merge from it_excel.
endloop.
reward point if useful
Regards,
Imran
‎2007 Jun 01 1:27 PM
hi jay,
loop at it_excel.
it_excel-netpr = 'changed value'.
it_excel-peint = 'changed value'.
modify it_excel transporting netpr peint.
move it_excel it_iab1.
endloop.
if helpful reward some points.
with regards,
suresh babu.
‎2007 Jun 01 1:28 PM
This sample code is better then using MODIFY:
FIELD-SYMBOLS: <fs_tab2> LIKE LINE OF it_tab2.
LOOP AT it_tab2 ASSIGNING <fs_tab2>.
Read corresponding document/item combo from the EXCEL table
READ TABLE it_tab1 INTO wa_tab1
WITH KEY ebeln = <fs_tab2>-ebeln
ebelp = <fs_tab2>-ebelp.
IF sy-subrc = 0.
This directly modifies the 2 fields in IT_TAB2 without using the MODIFY statement
<fs_tab2>-NETPR = wa_tab1-NETPR.
<fs_tab2>-PEINT = wa_tab1-PEINT.
ENDIF.
ENDLOOP.
Hope this helps you.
With kind regards,
Roel van den Berge
‎2007 Jun 01 1:36 PM
1. l function module - ALSM_EXCEL_TO_INTERNAL_TABLE to get the excel sheet data into internal table itab.
2. sort the itab ebeln
3. declare a structure with netpr and perint. let it be stab for now.
4. loop at itab.
read table i_ekko_ekpo with key ebeln = itab=eblen.
if sy-subrc = 0.
move: stab-netpr to i_ekko_ekpo-netpr ,
stab-peint to i_ekko_ekpo-peint.
modify i_ekko_ekpo from stab transporting netnr peint where ebeln = itab-eblen.
endif.
endloop.
5,. now check the values in the i_ekko_ekpo table