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

update syntax

Former Member
0 Likes
690

if flag is X i want to clear the flag and update the date and time. So far I have tried

if zcitorderout-flag = 'X'.
update zcitorderout set flag = space and erdat = wa_zcitorderout-erdat and erzet = wa_zcitorderout-erzet.

AND

if zcitorderout-flag = 'X'.
      zcitorderout-flag = space.
      zcitorderout-erdat = wa_zcitorderout-erdat.
      zcitorderout-erzet = wa_zcitorderout-erzet.
      modify zcitorderout.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
652

Try theses syntax

if zcitorderout-flag = 'X'.
update zcitorderout 
  set flag = space 
       erdat = wa_zcitorderout-erdat 
       erzet = wa_zcitorderout-erze.
endif.

or

if zcitorderout-flag = 'X'.
      zcitorderout-flag = space.
      zcitorderout-erdat = wa_zcitorderout-erdat.
      zcitorderout-erzet = wa_zcitorderout-erzet.
      update  zcitorderout.
endif

Regards

5 REPLIES 5
Read only

former_member194669
Active Contributor
0 Likes
652

Please don't forget to give COMMIT WORK.

aRs

Read only

Former Member
0 Likes
652

neither of the above syntax work.. so i am looking for some syntax that will work

Read only

RaymondGiuseppi
Active Contributor
0 Likes
653

Try theses syntax

if zcitorderout-flag = 'X'.
update zcitorderout 
  set flag = space 
       erdat = wa_zcitorderout-erdat 
       erzet = wa_zcitorderout-erze.
endif.

or

if zcitorderout-flag = 'X'.
      zcitorderout-flag = space.
      zcitorderout-erdat = wa_zcitorderout-erdat.
      zcitorderout-erzet = wa_zcitorderout-erzet.
      update  zcitorderout.
endif

Regards

Read only

Former Member
0 Likes
652

hi raymond do i need commit work after the update statement

Read only

ferry_lianto
Active Contributor
0 Likes
652

Hi,

Please try this.


data: wa_zcitorderout like zcitorderout.

if zcitorderout-flag = 'X'.
  update zcitorderout 
  set flag = space 
       erdat = wa_zcitorderout-erdat 
       erzet = wa_zcitorderout-erze
  where <condition>.
endif.

AND 

if zcitorderout-flag = 'X'.
  wa_zcitorderout-flag = space.
  modify zcitorderout from wa_zcitorderout.
endif.

Regards,

Ferry Lianto