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

modifying ztable

Former Member
0 Likes
850

hi

i m having itab with vbeln

and ztable with objnr and ordsent.

where objnr and vbeln are equal

so now when i find objnr EQ vbeln i have to modify the ztable-ordsent = ' '.

plz can any one can tell me can i modify the ztable directly if yes then how?

7 REPLIES 7
Read only

Former Member
0 Likes
700

create a workarea which is of the structure of your z-table.

move all the required values into that workarea.

use the following statement

<b>modify ZTABLE from WA</b>

thx

pavan

Read only

Former Member
0 Likes
700

Hello,

you can do coding as below :

loop at itab.

select single * from ztable into ztable where objnr = itab-vbeln.

if sy-subrc eq 0.

ztable-ordsent = ' '.

***update stmts with commit.

endif.

endloop.

Hope it helps.

Thanks.

Read only

Former Member
0 Likes
700

hi neha,

1. do like this.

2.

LOOP AT ZTABLE.

READ TABLE ITAB WITH KEY VBLEN = ZTABLE-OBJNR.

<b> IF SY-SUBRC = 0.

ZTABLE-ORDSENT = ''.

MODIFY ZTABLE FROM ZTABLE.

ENDIF.</b>

ENDLOOP.

ENDLOOP.

3. Ztable (internal table)

and Actual ZTABLE should be same structure.

regards,

amit m.

Read only

Former Member
0 Likes
700

hi Neha,

do this way ..


 seect * from ztable in to table itab2 for all entries of itab where  objnr = itab-vbeln.

 if sy-subrc = 0.
 loop at itab2.
 ztable-ordsent = ' '.
 modify ztable from itab2 transporting rdsent.
 endloop.

Regards,

Santosh

Read only

Former Member
0 Likes
700

data : v_tabix like sy-tabix.

loop at ztable.

v_tabix = sy-tabix.

read table itab with key vbeln = ztable-objnr.

if sy-subrc = 0.

ztable-ordsent = ' '.

modify ztable index v_tabix.

endif.

clear: ztable, itab, v_tabix.

endloop.

Read only

Former Member
0 Likes
700

Hi Neha,

Get ztable records into an internal table ztable.

Loop at Ztable.

Read table itab with key vbeln = ztable-objnr.

if sy-subrc = 0.

ztable-ordsent = ' '.

modify ztable.

endif.

Hope this helps.

Regards,

Sudheer

Read only

Former Member
0 Likes
700

Hi Neha,

You can modify Z_TABLE. Please have look in the below example.

loop at itab into wa_tab.
select *
   into wa_ztable
 from ztable where objnr eq wa_tab-vbeln.
if sy-subrc eq 0.
  * lock the entry using FM 'ENQUEUE_Ztablelockobject
 wa_ztable-ordsent = space.
 modify ztable from wa_ztable.
 if sy-subrc ne 0.
*   Unlock table entry using FM 'DEQUEUE_Ztablelockobject'
   message 'Error while modifying' type 'E'.
endif.
*   Unlock table entry using FM 'DEQUEUE_Ztablelockobject'

I hope above pseucode will helps you.

Regards

Bhupal Reddy