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

Doubt in Internal Table

Former Member
0 Likes
542

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
520

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

5 REPLIES 5
Read only

Former Member
0 Likes
520

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.

Read only

Former Member
0 Likes
521

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

Read only

Former Member
0 Likes
520

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.

Read only

Former Member
0 Likes
520

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

Read only

Former Member
0 Likes
520

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