1-time 4GL program to update ud fields

I was able to compile the .p and run it thru admin tools.
Thank you all for your help.

--- In vantage@yahoogroups.com, "Alex Fiedler" <alex@...> wrote:
>
> Actually I am not sure your inability to compile, is the problem here:
> You need to ensure your PROPATH includes an entry x such that
>
> x\db\repl\glaccount\write.p exists.
>
> your override seems to be causing this problem. You could do 2 things:
> 1) correct your propath
> 2) remove the on write clause.
>
> What happens in each case?
>
>
> --- In vantage@yahoogroups.com, "pklein256" <pklein@> wrote:
> >
> > We just went up to version 9.04.506C
> > In Vantage 8 we could run a 4GL program to update UD fields. When I run this code,
> >
> > /* Export GLACCOUNT.p */
> > ON WRITE OF GLACCOUNT override do:
> > END.
> > DO:
> > for each GLACCOUNT where GLACCOUNT.segvalue1 = '310000' and GLACCOUNT.segvalue2 = '2010' and GLACCOUNT.segvalue3 = '00' :
> > /* display glaccount.segvalue1 glaccount.segvalue2 glaccount.segvalue3 glaccount.shortchar01. */
> > ASSIGN glaccount.shortchar01 = 'X'.
> > end.
> > end.
> > OUTPUT CLOSE.
> > QUIT.
> >
> > I get the following error:
> > ---------------------------
> > Error
> > ---------------------------
> > ** "db/repl/glaccount/write.p" was not found. (293)
> > ---------------------------
> > OK
> >
> > Is anyone else going into progress and running a program to fix UD fields?
> > Thanks,
> > Pam
> >
>
We just went up to version 9.04.506C
In Vantage 8 we could run a 4GL program to update UD fields. When I run this code,

/* Export GLACCOUNT.p */
ON WRITE OF GLACCOUNT override do:
END.
DO:
for each GLACCOUNT where GLACCOUNT.segvalue1 = '310000' and GLACCOUNT.segvalue2 = '2010' and GLACCOUNT.segvalue3 = '00' :
/* display glaccount.segvalue1 glaccount.segvalue2 glaccount.segvalue3 glaccount.shortchar01. */
ASSIGN glaccount.shortchar01 = 'X'.
end.
end.
OUTPUT CLOSE.
QUIT.

I get the following error:
---------------------------
Error
---------------------------
** "db/repl/glaccount/write.p" was not found. (293)
---------------------------
OK

Is anyone else going into progress and running a program to fix UD fields?
Thanks,
Pam
You have to compile the program first, we had the same problem.
Sincerely
Jose C Gomez

http://www.josecgomez.com


On Tue, Aug 3, 2010 at 11:22 PM, pklein256 <pklein@...> wrote:

>
>
> We just went up to version 9.04.506C
> In Vantage 8 we could run a 4GL program to update UD fields. When I run
> this code,
>
> /* Export GLACCOUNT.p */
> ON WRITE OF GLACCOUNT override do:
> END.
> DO:
> for each GLACCOUNT where GLACCOUNT.segvalue1 = '310000' and
> GLACCOUNT.segvalue2 = '2010' and GLACCOUNT.segvalue3 = '00' :
> /* display glaccount.segvalue1 glaccount.segvalue2 glaccount.segvalue3
> glaccount.shortchar01. */
> ASSIGN glaccount.shortchar01 = 'X'.
> end.
> end.
> OUTPUT CLOSE.
> QUIT.
>
> I get the following error:
> ---------------------------
> Error
> ---------------------------
> ** "db/repl/glaccount/write.p" was not found. (293)
> ---------------------------
> OK
>
> Is anyone else going into progress and running a program to fix UD fields?
> Thanks,
> Pam
>
>
>


[Non-text portions of this message have been removed]
There is a way to do this without compiling. It is a little convoluted but it works well enough.

Example: We had to do a one-off populate of the UD01 table with records for just backordered items.

1. Created E:\epicor\mfgsys803\server\ud\udUserTablePopulate.p
with following 4GL code:

for <some set of orderRel records>:
call ud01maintain.p(<parameters>).
end.

2. ud01maintain.p looks like this:

define input parameter ipCompany like OrderRel.Company no-undo.
define input parameter ipPartNum like OrderRel.PartNum no-undo.
define input parameter ipOrderNum like OrderRel.OrderNum no-undo.
define input parameter ipOrderLine like OrderRel.OrderLine no-undo.
define input parameter ipOrderRelNum like OrderRel.OrderRelNum no-undo.
define input parameter ipRowMod as char no-undo.
define input parameter ipOutstanding like OrderRel.OurReqQty no-undo.

{bo/ud01_ds.i}

define variable h_ud01 as handle no-undo.
run bo/ud01.p persistent set h_ud01.

find first UD01
where UD01.Company = ipCompany
and UD01.Key1 = ipPartNum
and UD01.Key2 = string(ipOrderNum)
and UD01.Key3 = string(ipOrderLine)
and UD01.Key4 = string(ipOrderRelNum)
no-lock no-error.

if avail UD01 then
do:
message "ud01 avail".
if ipRowMod = "D" or ipOutstanding = 0 then
do:
message " deleting ud01".
run DeleteByID in h_ud01 (ipPartNum, string(ipOrderNum), string(ipOrderLine), string(ipOrderRelNum), "").
end.
else
run lib/UpdateTableBuffer.p (input buffer UD01:HANDLE, "Number01", ipOutstanding).
end.
else
do:
message " no ud01 available, creating...".
empty temp-table ttUD01.

run GetaNewUD01 in h_ud01 ({&input-output_dataset_UD01DataSet}).

find first ttUD01.

Assign
ttUD01.Company = ipCompany
ttUD01.Key1 = string(ipPartNum)
ttUD01.Key2 = string(ipOrderNum)
ttUD01.Key3 = string(ipOrderLine)
ttUD01.Key4 = string(ipOrderRelNum)
ttUD01.Number01 = ipOutstanding.

run Update in h_ud01({&input-output_dataset_UD01DataSet}).
message "new ud01 created".
end.

/* end of ud01maintain.p */

4. How to call udUserTablePopulate.p? Create any BPM with an action of "execute 4GL code" and the 4GL code shall be:

run ud\udUserTablePopulate.p.

5. Ensure this BPM is triggered by some user action.



Cheers.


















--- In vantage@yahoogroups.com, "pklein256" <pklein@...> wrote:
>
> We just went up to version 9.04.506C
> In Vantage 8 we could run a 4GL program to update UD fields. When I run this code,
>
> /* Export GLACCOUNT.p */
> ON WRITE OF GLACCOUNT override do:
> END.
> DO:
> for each GLACCOUNT where GLACCOUNT.segvalue1 = '310000' and GLACCOUNT.segvalue2 = '2010' and GLACCOUNT.segvalue3 = '00' :
> /* display glaccount.segvalue1 glaccount.segvalue2 glaccount.segvalue3 glaccount.shortchar01. */
> ASSIGN glaccount.shortchar01 = 'X'.
> end.
> end.
> OUTPUT CLOSE.
> QUIT.
>
> I get the following error:
> ---------------------------
> Error
> ---------------------------
> ** "db/repl/glaccount/write.p" was not found. (293)
> ---------------------------
> OK
>
> Is anyone else going into progress and running a program to fix UD fields?
> Thanks,
> Pam
>
Actually I am not sure your inability to compile, is the problem here:
You need to ensure your PROPATH includes an entry x such that

x\db\repl\glaccount\write.p exists.

your override seems to be causing this problem. You could do 2 things:
1) correct your propath
2) remove the on write clause.

What happens in each case?


--- In vantage@yahoogroups.com, "pklein256" <pklein@...> wrote:
>
> We just went up to version 9.04.506C
> In Vantage 8 we could run a 4GL program to update UD fields. When I run this code,
>
> /* Export GLACCOUNT.p */
> ON WRITE OF GLACCOUNT override do:
> END.
> DO:
> for each GLACCOUNT where GLACCOUNT.segvalue1 = '310000' and GLACCOUNT.segvalue2 = '2010' and GLACCOUNT.segvalue3 = '00' :
> /* display glaccount.segvalue1 glaccount.segvalue2 glaccount.segvalue3 glaccount.shortchar01. */
> ASSIGN glaccount.shortchar01 = 'X'.
> end.
> end.
> OUTPUT CLOSE.
> QUIT.
>
> I get the following error:
> ---------------------------
> Error
> ---------------------------
> ** "db/repl/glaccount/write.p" was not found. (293)
> ---------------------------
> OK
>
> Is anyone else going into progress and running a program to fix UD fields?
> Thanks,
> Pam
>