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

Former Member
0 Likes
1,045

Hi friends.

a)

read table it_zsat into wa_zsat with key matnr = '5003' binary search.

if sy-subrc = 0.

wa_zsat-ERNAM = 'FERT'.

modify it_zsat from wa_zsat index sy-tabix .

endif.

b) read table it_zsat into wa_zsat with key matnr = '5003' binary search.

if sy-subrc = 0.

wa_zsat-ERNAM = 'FERT'.

modify it_zsat from wa_zsat index sy-tabix transporting ernam.

endif.

performance wise which one should i use in my program and why.

Regards

Satish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,017

Hi,

I suggest use Field-SYmbols instead of using MODIFY... Performanace wise it is very good.

FIELD-symbols : <f2s1> TYPE wa_zsat.

read table it_zsat assigning <fs1> with key...

if sy-subrc eq 0.

assign the value.

endif.

regarding to ur question: using Tranporting will perform good. (2nd Modify)

Hope it helps!!

Rgds,

Pavan

11 REPLIES 11
Read only

Former Member
0 Likes
1,018

Hi,

I suggest use Field-SYmbols instead of using MODIFY... Performanace wise it is very good.

FIELD-symbols : <f2s1> TYPE wa_zsat.

read table it_zsat assigning <fs1> with key...

if sy-subrc eq 0.

assign the value.

endif.

regarding to ur question: using Tranporting will perform good. (2nd Modify)

Hope it helps!!

Rgds,

Pavan

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,017

Hello Pavan,

Can you share the source for your claim?

BR,

Suhas

Read only

0 Likes
1,017

i mean if we use transaporting field name ie : transporting ernam it will only modify that particular field and if i dont use transporting then it will try to modify all the fields of work area even though if i dont chnage the value... is that correct....?

Read only

0 Likes
1,017

Yes, u r correct, it will modify only the values only for those u assign a new value after READ...

Read only

0 Likes
1,017

Hello

Yes.

In first case the complete line is moved.

In second case only selected component is moved.

Read only

0 Likes
1,017

thanks...

points awarded.... cheers...:)

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,017

Hello Satish,

An F1 on MODIFY stmt will answer these queries.

Your question is answered by that explanation 😮

BR,

Suhas

Read only

0 Likes
1,017

Hi,

read table itab assigning <fs1> with key ...

binary search..

if sy-subrc EQ 0.

ASSIGN 'FERT' to <fs1>-matnr.

endif.

I think if u take F1 help from SAP, u ill more understand with an example...

Rgds,

Pavan

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,017

And where does SAP F1 talk about the performance ??

Read only

0 Likes
1,017

Thats the reason i have posted here.

if i was just using forum then the question would not have been on performance based.

just checked the F1 help then later i posted it here guys...

Regards

Satish

Read only

Former Member
0 Likes
1,017

Hi Satish,

2nd statement is better in performance, when u have a complex structure....

so,its better to go for the modify statement with transporting rather than modifying alone..