loops on the T.U.R.F. side of the world
Author: ulrichmerkel@web.de (ulrich-merkel)
remove data witha condition
http://hosted.byjones.net/turf/viewtopic.php?f=2&t=1545
remove data witha condition
Posted: 20.06.12 12:35
Dear ALL,
in my form i'm retrieving material codes and enter the quantity. before save, i want to remove all the codes wich i have not filled any quantity value. how can i write this.
if (ISSUED_QTY <= 0)
remocc "INTRDMT", 0
message "No ISSUED QTY is removed."
endif
Below code can remove only the current code. But i want to remove all the codes which fill the above condition, when press a button.
regards
se
in my form i'm retrieving material codes and enter the quantity. before save, i want to remove all the codes wich i have not filled any quantity value. how can i write this.
if (ISSUED_QTY <= 0)
remocc "INTRDMT", 0
message "No ISSUED QTY is removed."
endif
Below code can remove only the current code. But i want to remove all the codes which fill the above condition, when press a button.
regards
se
Re: remove data witha condition
Posted: 21.06.12 07:15
Hi,
you can place a loop in front of your store (-Trigger).
variables
numeric n_index
endvariables
setocc "INTRDMT",-1
n_index = $status
while (n_index > 0)
setocc "INTRDMT", n_index
; then your codeblock
if (ISSUED_QTY <= 0)
remocc "INTRDMT", 0
message "No ISSUED QTY is removed."
endif
n_index = n_index - 1
endwhile
if you are on 9.5, you may have a look at the forentity example:
forentity
Defines a loop that processes all the occurrences of an entity.
forentity EntityName
Your Proc Code
endfor
you can place a loop in front of your store (-Trigger).
variables
numeric n_index
endvariables
setocc "INTRDMT",-1
n_index = $status
while (n_index > 0)
setocc "INTRDMT", n_index
; then your codeblock
if (ISSUED_QTY <= 0)
remocc "INTRDMT", 0
message "No ISSUED QTY is removed."
endif
n_index = n_index - 1
endwhile
if you are on 9.5, you may have a look at the forentity example:
forentity
Defines a loop that processes all the occurrences of an entity.
forentity EntityName
Your Proc Code
endfor