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 Internal Table

Former Member
0 Likes
784

can anybody advice me please.

As I'm trying to modify ITAB, but not able to modify......

READ TABLE i_yibrk_earnings INTO w_yibrk_earnings INDEX 1.

IF sy-subrc EQ 0.

w_yibrk_earnings-status = 'S'. "Status S-Submitted

w_yibrk_earnings-cname = sy-uname. "submitted by

w_yibrk_earnings-cdate = sy-datum. "submitted date (should be in MM-DD-yyyy format)

MODIFY TABLE i_yibrk_earnings FROM w_yibrk_earnings TRANSPORTING status cname cdate.

ENDIF.

Structure and Data of i_yibrk_earnings:

*********************************************

Field:BAREA PLTYP PLAN_OPT BEGDA ENDDA VALUE_DATE

Data: SPACE DMP D SPACE SPACE 26.01.2007

field:PERCENTAGE STATUS CNAME CDATE UNAME AEDTM

data: 10,00

first line fields are key fields...

Thanks in advance...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
752

Why don't you use the below MODIFY statement:

MODIFY i_yibrk_earnings INDEX 1 FROM w_yibrk_earnings

TRANSPORTING status cname cdate.

7 REPLIES 7
Read only

Former Member
0 Likes
752

Hi,

Give the WHERE condition also in the MODIFY TABLE.

Regards

Subramanian

Read only

Former Member
0 Likes
752

regards

shiba dutta

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
753

Why don't you use the below MODIFY statement:

MODIFY i_yibrk_earnings INDEX 1 FROM w_yibrk_earnings

TRANSPORTING status cname cdate.

Read only

Former Member
0 Likes
752

hi BR.

use field symbols to modify the internal tabe.. so that it very esy for u as well as improves the performance. u no need to use MODIFY again.

FIELD-SYMBOLS: <fs_ w_yibrk_earnings> TYPE TY_ITAB.

READ TABLE i_yibrk_earnings  ASSIGNING <fs_ w_yibrk_earnings> INDEX 1.
IF sy-subrc EQ 0.
<fs_ w_yibrk_earnings>-status = 'S'. "Status S-Submitted
<fs_ w_yibrk_earnings>-cname = sy-uname. "submitted by
<fs_ w_yibrk_earnings>-cdate = sy-datum. "submitted date (should be in MM-DD-**yyyy format)
***MODIFY TABLE i_yibrk_earnings FROM w_yibrk_earnings TRANSPORTING **status cname cdate.
ENDIF.

Please Close this thread.. when u r problem is solved

Reward if Helpful

Regards

Naresh Reddy K

Read only

Former Member
0 Likes
752

Hi,

Since u r reading a record of INDEX 1.., u have to mention the Index while modifying...

this will modify a single entry...

But if u use a WHERE condition this can modify many records depending on the condition specified in where clause..

Cheers

Rajiv

Read only

Former Member
0 Likes
752

Hi,

Use the modify statement within a loop.The table should get modified.

Pls reward if found useful.

Thanks

Shyam

Read only

Former Member
0 Likes
752

hi all,

my problem was solved with Sushant's advice.

Thanks to all for helpful advices and points rewarded to all...

Thanks...