BPM on ORDER MISC

Jose, this BPM is updating twice. I have few other BPMs in the same BO(SalesOrder.Update) which also gets triggered when this BPM runs.
Is there anyway, I could make it run only once.
If I am correct the last update line: RUN Update IN hSalesOrder({&input-output_dataset_SalesOrderDataSet}). is causing the problem. How can I fix it? Thanks.



--- In vantage@yahoogroups.com, Jose Gomez <jose@...> wrote:
>
> Sure...
> Sanya wanted to add a line misc charge using a BPM.
>
> Last night i finished testing this and I know it works its commented the
> best I can. This example will add a Misc Charge to the First line in the
> order if that charge is not already there. This needs to be done as a Post
> Proc directive on Sales Order Update
>
>
> DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
> DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
> DEFINE VARIABLE orderNum AS INTEGER NO-UNDO.
> ASSIGN miscCode ='GCTF'.
> /* CREATE A HANDLE FOR THE SALES ORDER BO */
> RUN bo/SalesOrder.p PERSISTENT SET hSalesOrder.
> /* GET THE SALES ORDER NUMBER*/
> FOR EACH ttOrderHed:
> Assign orderNum= ttOrderHed.OrderNum.
> END.
>
> /* RUN GET BY ID TO GET THE MOST UP TO DATE COPY OF THE ORCER */
> RUN GetByID IN hSalesOrder(INPUT orderNum,
> {&output_dataset_SalesOrderDataSet}).
>
> /* WE GET THE FIRST ORDER LINE IN THE ORDER*/
> FOR FIRST ttOrderDtl:
> /* CHECK TO SEE IF OUR MISC CHARGE ALREADY EXISTS*/
> FIND FIRST OrderMsc WHERE OrderMsc.Company=ttOrderDtl.Company AND
> OrderMsc.OrderNum=ttOrderDtl.OrderNum AND OrderMsc.OrderLine =
> ttOrderDtl.OrderLine AND OrderMsc.MiscCode=miscCode NO-LOCK NO-ERROR.
> /* IF IT DOES NOT EXIST */
> IF NOT AVAILABLE OrderMsc THEN DO:
> /* GET A NEW MISC CHARGE FOR THE FIRST LINE */
> RUN GetNewOrderMsc IN
> hSalesOrder({&input-output_dataset_SalesOrderDataSet}, ttOrderDtl.OrderNum,
> ttOrderDtl.OrderLine).
> /* ASSIGN THE MISC CODE */
> FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
> Assign ttOrderMsc.MiscCode=miscCode.
> END.
> /* RUN THE CHANGE MISC CODE BO TO GET DESCRIPTION AND SUCH */
> RUN ChangeMiscCode IN
> hSalesOrder({&input-output_dataset_SalesOrderDataSet}, 'OrderMsc').
> /* ASSIGN THE AMOUNT OF THE MISC CHARGE */
> FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
> Assign ttOrderMsc.DocMiscAmt=35.50.
> END.
> /* RUN THE CHANGE AMOUNT BO TO GET THE REST OF THE INFO FILLED */
> RUN ChangeMiscAmount IN
> hSalesOrder({&input-output_dataset_SalesOrderDataSet}, 'OrderMsc').
> /* SET THE FREQUENCY */
> FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
> Assign ttOrderMsc.FreqCode='F'.
> END.
> /* UPDATE OUR CHANGES. THIS TIME OUR BPM WILL STOP SHORT BECAUSE WE HAVE
> THAT MISC CHARGE */
> RUN Update IN hSalesOrder({&input-output_dataset_SalesOrderDataSet}).
> /* RUN GET BY ID TO GET THE MOST FRESH COPY OF OUR DATA */
> RUN GetByID IN hSalesOrder(INPUT orderNum,
> {&output_dataset_SalesOrderDataSet}).
> END.
> END.
>
>
> *Jose C Gomez*
> *Software Engineer*
> *
> *
> *
> *T: 904.469.1524 mobile
> E: jose@...
> http://www.josecgomez.com
> <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
> <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> <http://www.josecgomez.com/professional-resume/>
> <http://www.josecgomez.com/feed/>
> <http://www.usdoingstuff.com>
>
> *Quis custodiet ipsos custodes?*
>
>
> [Non-text portions of this message have been removed]
>
How can I create a new OrderMisc Table record(add a new misc line from within
the salesorder.Update BPM) when the orderdtl.termscode='CC'?
Insert into ordermisc(Company, OrderNum, etc...)
Values(cur-comp, ttorderdtl.ordernum, etc..).



Marco Vissuet
Systems Engineer
Pacific Contours Corporation
Cell (619)507-2311
Anaheim Office (714) 693-1260
San Diego Office (619)670-3900
Fax (714) 693-1252
mvissuet@...<mailto:marcov@...>
http://www.pacificcontours.com/

"The information contained herein may be subject to the International Traffic in Arms Regulations (ITAR) Warning: - This document contains data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) as amended, or the Export Administration Act (Title 50, U.S.C., App 2401 et seq.) as amended. Violations of these export laws are subject to severe criminal and civil penalties. Disseminate in accordance with provisions of DoD Directive 5230.25.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of sanjay219@...
Sent: Wednesday, June 05, 2013 2:45 PM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM on ORDER MISC



How can I create a new OrderMisc Table record(add a new misc line from within
the salesorder.Update BPM) when the orderdtl.termscode='CC'?



[Non-text portions of this message have been removed]
DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
FOR EACH ttCallContextBpmData:

IF ttCallContextBpmData.ShortChar01='Yes' THEN DO:

RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.

FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
Customer.CustNum=iCustNum:
Assign miscCode = Customer.ShortChar01.
END.
RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).
RUN GetNewOHOrderMsc in
hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
Assign ttOHOrderMsc.MiscCode=miscCode.
END.

RUN ChangeMiscCode in
hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
'OHOrderMsc').
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
ttOHOrderMsc.FreqCode='F'.
END.
RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).

RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).

DELETE OBJECT hSalesOrder.
END.
END.



*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Wed, Jun 5, 2013 at 5:44 PM, sanjay219@... <sanjay219@...>wrote:

> **
>
>
> How can I create a new OrderMisc Table record(add a new misc line from
> within
> the salesorder.Update BPM) when the orderdtl.termscode='CC'?
>
>
>


[Non-text portions of this message have been removed]
Thank you so much Jose,
Can you Please explain what it does?

--- In vantage@yahoogroups.com, Jose Gomez <jose@...> wrote:
>
> DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
> DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
> FOR EACH ttCallContextBpmData:
>
> IF ttCallContextBpmData.ShortChar01='Yes' THEN DO:
>
> RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.
>
> FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
> Customer.CustNum=iCustNum:
> Assign miscCode = Customer.ShortChar01.
> END.
> RUN GetByID IN hSalesOrder(INPUT iOrderNum,
> {&output_dataset_SalesOrderDataSet}).
> RUN GetNewOHOrderMsc in
> hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
> FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
> Assign ttOHOrderMsc.MiscCode=miscCode.
> END.
>
> RUN ChangeMiscCode in
> hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
> 'OHOrderMsc').
> FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
> ttOHOrderMsc.FreqCode='F'.
> END.
> RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).
>
> RUN GetByID IN hSalesOrder(INPUT iOrderNum,
> {&output_dataset_SalesOrderDataSet}).
>
> DELETE OBJECT hSalesOrder.
> END.
> END.
>
>
>
> *Jose C Gomez*
> *Software Engineer*
> *
> *
> *
> *T: 904.469.1524 mobile
> E: jose@...
> http://www.josecgomez.com
> <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
> <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> <http://www.josecgomez.com/professional-resume/>
> <http://www.josecgomez.com/feed/>
> <http://www.usdoingstuff.com>
>
> *Quis custodiet ipsos custodes?*
>
>
> On Wed, Jun 5, 2013 at 5:44 PM, sanjay219@... <sanjay219@...>wrote:
>
> > **
> >
> >
> > How can I create a new OrderMisc Table record(add a new misc line from
> > within
> > the salesorder.Update BPM) when the orderdtl.termscode='CC'?
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
Hi

If you can't glean what it does from the code I don't recommend you use it
in productino. Don't put something in production that you don't fully
understand.
What it does is create a misc charge on sales order from a 4GL BPM as you
requested.


*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Thu, Jun 6, 2013 at 9:56 AM, sanjay219@... <sanjay219@...>wrote:

> **
>
>
> Thank you so much Jose,
> Can you Please explain what it does?
>
>
> --- In vantage@yahoogroups.com, Jose Gomez <jose@...> wrote:
> >
> > DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
> > DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
> > FOR EACH ttCallContextBpmData:
> >
> > IF ttCallContextBpmData.ShortChar01='Yes' THEN DO:
> >
> > RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.
> >
> > FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
> > Customer.CustNum=iCustNum:
> > Assign miscCode = Customer.ShortChar01.
> > END.
> > RUN GetByID IN hSalesOrder(INPUT iOrderNum,
> > {&output_dataset_SalesOrderDataSet}).
> > RUN GetNewOHOrderMsc in
> > hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
> > FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
> > Assign ttOHOrderMsc.MiscCode=miscCode.
> > END.
> >
> > RUN ChangeMiscCode in
> > hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
> > 'OHOrderMsc').
> > FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
> > ttOHOrderMsc.FreqCode='F'.
> > END.
> > RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).
> >
> > RUN GetByID IN hSalesOrder(INPUT iOrderNum,
> > {&output_dataset_SalesOrderDataSet}).
> >
> > DELETE OBJECT hSalesOrder.
> > END.
> > END.
> >
> >
> >
> > *Jose C Gomez*
> > *Software Engineer*
> > *
> > *
> > *
> > *T: 904.469.1524 mobile
> > E: jose@...
> > http://www.josecgomez.com
> > <http://www.linkedin.com/in/josecgomez> <
> http://www.facebook.com/josegomez>
> > <http://www.google.com/profiles/jose.gomez> <
> http://www.twitter.com/joc85>
> > <http://www.josecgomez.com/professional-resume/>
> > <http://www.josecgomez.com/feed/>
> > <http://www.usdoingstuff.com>
> >
> > *Quis custodiet ipsos custodes?*
> >
> >
> > On Wed, Jun 5, 2013 at 5:44 PM, sanjay219@... <sanjay219@...>wrote:
> >
> > > **
>
> > >
> > >
> > > How can I create a new OrderMisc Table record(add a new misc line from
> > > within
> > > the salesorder.Update BPM) when the orderdtl.termscode='CC'?
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>


[Non-text portions of this message have been removed]
Im in V8. I tried the following code.
Its giving an error: 4GL STOP condition: The Server application has returned an error. (7243) (7241) when i try to add a new line.




DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
DEFINE VARIABLE icustnum AS integer NO-UNDO.
DEFINE VARIABLE iordernum AS integer NO-UNDO.

FOR EACH ttorderhed where ttorderhed.TermsCode='CC'.



RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.

FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
Customer.CustNum=iCustNum:
Assign miscCode = Customer.ShortChar01.
END.
RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).
RUN GetNewOHOrderMsc in
hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
Assign ttOHOrderMsc.MiscCode=miscCode.
END.

RUN ChangeMiscCode in
hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
'OHOrderMsc').
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
ttOHOrderMsc.FreqCode='E'.
ttohordermsc.MiscCode='FRGT'.
ttordermsc.DocMiscAmt = ttordermsc.DocMiscAmt + 10.
END.
RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).

RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).

DELETE OBJECT hSalesOrder.
END.
I need to create this New Order Misc line only when I click save.
I tried this code. Its working, but its not letting me create a new sales order. or update or add a new line. When I add a new line or update an existing line, upon saving, it goes back to its original existing condition(deletes the newly added lines or no updates).



DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
DEFINE VARIABLE icustnum AS integer NO-UNDO.
DEFINE VARIABLE iordernum AS integer NO-UNDO.

find first ttorderdtl where ttorderdtl.RowMod='U' or ttorderdtl.RowMod='A'.
if available ttorderdtl then do:
find first ttorderhed where ttorderhed.Company=ttorderdtl.Company and ttorderhed.OrderNum = ttorderdtl.OrderNum and ttorderhed.TermsCode='CC'.
if available ttorderhed then do:


RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.

RUN GetNewOrderMsc in
hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
Assign ttOrderMsc.MiscCode='FRGT'.
END.

RUN ChangeMiscCode in
hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
'OrderMsc').
FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
ttOrderMsc.FreqCode='E'.
END.
RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).

DELETE OBJECT hSalesOrder.
END.
end.
I gave you another line of code to use... that is a lot easier to use....

Look at my previous emails..


Marco Vissuet
Systems Engineer
Pacific Contours Corporation
Cell (619)507-2311
Anaheim Office (714) 693-1260
San Diego Office (619)670-3900
Fax (714) 693-1252
mvissuet@...<mailto:marcov@...>
http://www.pacificcontours.com/

"The information contained herein may be subject to the International Traffic in Arms Regulations (ITAR) Warning: - This document contains data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) as amended, or the Export Administration Act (Title 50, U.S.C., App 2401 et seq.) as amended. Violations of these export laws are subject to severe criminal and civil penalties. Disseminate in accordance with provisions of DoD Directive 5230.25.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of sanjay219@...
Sent: Friday, June 07, 2013 8:48 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM on ORDER MISC



I tried this code. Its working, but its not letting me create a new sales order. or update or add a new line. When I add a new line or update an existing line, upon saving, it goes back to its original existing condition(deletes the newly added lines or no updates).

DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
DEFINE VARIABLE icustnum AS integer NO-UNDO.
DEFINE VARIABLE iordernum AS integer NO-UNDO.

find first ttorderdtl where ttorderdtl.RowMod='U' or ttorderdtl.RowMod='A'.
if available ttorderdtl then do:
find first ttorderhed where ttorderhed.Company=ttorderdtl.Company and ttorderhed.OrderNum = ttorderdtl.OrderNum and ttorderhed.TermsCode='CC'.
if available ttorderhed then do:

RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.

RUN GetNewOrderMsc in
hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
Assign ttOrderMsc.MiscCode='FRGT'.
END.

RUN ChangeMiscCode in
hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
'OrderMsc').
FOR EACH ttOrderMsc WHERE ttOrderMsc.RowMod='A':
ttOrderMsc.FreqCode='E'.
END.
RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).

DELETE OBJECT hSalesOrder.
END.
end.



[Non-text portions of this message have been removed]
Thanks.
Im trying to use the 4GL action Method Directive. How can I use your code in it??
For last ttorderdtl no-lock where
Ttorderdtl.rowmod = "A" and
Ttorderdtl.termscode = "C":

Insert into ordermisc(Company, OrderNum, etc...)
Values(cur-comp, ttorderdtl.ordernum, etc...).

End.



Try it in your training database first....
Make sure you use all fields that are required...

Marco Vissuet
Systems Engineer
Pacific Contours Corporation
Cell (619)507-2311
Anaheim Office (714) 693-1260
San Diego Office (619)670-3900
Fax (714) 693-1252
mvissuet@...<mailto:marcov@...>
http://www.pacificcontours.com/

"The information contained herein may be subject to the International Traffic in Arms Regulations (ITAR) Warning: - This document contains data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) as amended, or the Export Administration Act (Title 50, U.S.C., App 2401 et seq.) as amended. Violations of these export laws are subject to severe criminal and civil penalties. Disseminate in accordance with provisions of DoD Directive 5230.25.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of sanjay219@...
Sent: Friday, June 07, 2013 9:04 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM on ORDER MISC



Thanks.
Im trying to use the 4GL action Method Directive. How can I use your code in it??



[Non-text portions of this message have been removed]
I am using Vantage 8.03.409c. i cant update my database from this version. All i could do is to use the TT tables.
Thanks. I tried this code:

For last ttorderhed no-lock where
Ttorderhed.rowmod = "A" and
Ttorderhed.termscode = "CC":

Insert into ordermisc(Company, OrderNum) Values(cur-comp, ttorderdtl.ordernum).

End.




The following application error was encountered:

** Table ordermisc does not exist or cannot be accessed. (962)
** Could not understand line 27. (196)
However, I tried the following code just to test:

For last ttorderhed no-lock where

Ttorderhed.rowmod = "A" and
Ttorderhed.termscode = "CC":

Insert into ttordermsc(Company, OrderNum) Values(cur-comp, ttorderdtl.ordernum).

End.

Its throwing an error.

The following application error was encountered:

** Table ttordermsc does not exist or cannot be accessed. (962)
** Could not understand line 28. (196)
Double check what the table name is....


Marco Vissuet
Systems Engineer
Pacific Contours Corporation
Cell (619)507-2311
Anaheim Office (714) 693-1260
San Diego Office (619)670-3900
Fax (714) 693-1252
mvissuet@...<mailto:marcov@...>
http://www.pacificcontours.com/

"The information contained herein may be subject to the International Traffic in Arms Regulations (ITAR) Warning: - This document contains data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) as amended, or the Export Administration Act (Title 50, U.S.C., App 2401 et seq.) as amended. Violations of these export laws are subject to severe criminal and civil penalties. Disseminate in accordance with provisions of DoD Directive 5230.25.

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of sanjay219@...
Sent: Friday, June 07, 2013 9:22 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BPM on ORDER MISC



However, I tried the following code just to test:

For last ttorderhed no-lock where

Ttorderhed.rowmod = "A" and
Ttorderhed.termscode = "CC":

Insert into ttordermsc(Company, OrderNum) Values(cur-comp, ttorderdtl.ordernum).

End.

Its throwing an error.

The following application error was encountered:

** Table ttordermsc does not exist or cannot be accessed. (962)
** Could not understand line 28. (196)



[Non-text portions of this message have been removed]
Table name is correct!
Jose, When i tried your code, its not recognizing ttcallcontectbpmdata. Its giving an error unambiguous table.
And i tried the following code:

DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
DEFINE VARIABLE icustnum as integer no-undo.
DEFINE VARIABLE iordernum as integer no-undo.

FOR EACH ttorderdtl where ttorderdtl.RowMod='A' or ttorderdtl.rowmod='U',first ttorderhed where ttorderhed.ordernum=ttorderdtl.OrderNum and ttorderhed.Company=ttorderdtl.Company and ttorderhed.TermsCode='CC'.

RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.

FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
Customer.CustNum=iCustNum:
Assign miscCode = Customer.ShortChar01.
END.
RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).
RUN GetNewOHOrderMsc in
hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
Assign ttOHOrderMsc.MiscCode='FRGT'.
END.

RUN ChangeMiscCode in
hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
'OHOrderMsc').
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
ttOHOrderMsc.FreqCode='E'.
ttohordermsc.DocMiscAmt= ttohordermsc.DocMiscAmt + 10.
END.
RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).

RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).

DELETE OBJECT hSalesOrder.

end.

Nothing is happening!! please help.
You are on 8 there is no ttcallcontextdata, also your .P is in a slightly
different location since you are in 8 it should be RUN bo/SalesOrder.p


*Jose C Gomez*
*Software Engineer*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
<http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
<http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
<http://www.josecgomez.com/professional-resume/>
<http://www.josecgomez.com/feed/>
<http://www.usdoingstuff.com>

*Quis custodiet ipsos custodes?*


On Fri, Jun 7, 2013 at 1:42 PM, sanjay219@... <sanjay219@...>wrote:

> **
>
>
> Jose, When i tried your code, its not recognizing ttcallcontectbpmdata.
> Its giving an error unambiguous table.
> And i tried the following code:
>
>
> DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
> DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
> DEFINE VARIABLE icustnum as integer no-undo.
> DEFINE VARIABLE iordernum as integer no-undo.
>
> FOR EACH ttorderdtl where ttorderdtl.RowMod='A' or
> ttorderdtl.rowmod='U',first ttorderhed where
> ttorderhed.ordernum=ttorderdtl.OrderNum and
> ttorderhed.Company=ttorderdtl.Company and ttorderhed.TermsCode='CC'.
>
> RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.
>
> FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
> Customer.CustNum=iCustNum:
> Assign miscCode = Customer.ShortChar01.
> END.
> RUN GetByID IN hSalesOrder(INPUT iOrderNum,
> {&output_dataset_SalesOrderDataSet}).
> RUN GetNewOHOrderMsc in
> hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
> FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
> Assign ttOHOrderMsc.MiscCode='FRGT'.
>
> END.
>
> RUN ChangeMiscCode in
> hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
> 'OHOrderMsc').
> FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
> ttOHOrderMsc.FreqCode='E'.
> ttohordermsc.DocMiscAmt= ttohordermsc.DocMiscAmt + 10.
>
> END.
> RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).
>
> RUN GetByID IN hSalesOrder(INPUT iOrderNum,
> {&output_dataset_SalesOrderDataSet}).
>
> DELETE OBJECT hSalesOrder.
>
> end.
>
> Nothing is happening!! please help.
>
>
>


[Non-text portions of this message have been removed]
ttCallContextBpmData should turn purple as you type if it doesn't it doesn't exist.



Joshua Giese

CTO

920.437.6400 Ext. 337

Site ID: 27450-E905700B2-SQL64

----- Original Message -----

From: sanjay219@...
To: vantage@yahoogroups.com
Sent: Friday, June 7, 2013 12:42:17 PM
Subject: [Vantage] Re: BPM on ORDER MISC



Jose, When i tried your code, its not recognizing ttcallcontectbpmdata. Its giving an error unambiguous table.
And i tried the following code:

DEFINE VARIABLE hSalesOrder AS HANDLE NO-UNDO.
DEFINE VARIABLE miscCode AS CHARACTER NO-UNDO.
DEFINE VARIABLE icustnum as integer no-undo.
DEFINE VARIABLE iordernum as integer no-undo.

FOR EACH ttorderdtl where ttorderdtl.RowMod='A' or ttorderdtl.rowmod='U',first ttorderhed where ttorderhed.ordernum=ttorderdtl.OrderNum and ttorderhed.Company=ttorderdtl.Company and ttorderhed.TermsCode='CC'.

RUN bo/SalesOrder/SalesOrder.p PERSISTENT SET hSalesOrder.

FOR EACH Customer WHERE Customer.Company=CUR-COMP AND
Customer.CustNum=iCustNum:
Assign miscCode = Customer.ShortChar01.
END.
RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).
RUN GetNewOHOrderMsc in
hSalesOrder({&input-output_dataset_SalesOrderDataSet}, iOrderNum,0).
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
Assign ttOHOrderMsc.MiscCode='FRGT'.
END.

RUN ChangeMiscCode in
hSalesOrder({&input-output_dataset_SalesOrderDataSet},INPUT
'OHOrderMsc').
FOR EACH ttOHOrderMsc WHERE ttOHOrderMsc.RowMod='A':
ttOHOrderMsc.FreqCode='E'.
ttohordermsc.DocMiscAmt= ttohordermsc.DocMiscAmt + 10.
END.
RUN Update in hSalesOrder({&input-output_dataset_SalesOrderDataSet}).

RUN GetByID IN hSalesOrder(INPUT iOrderNum,
{&output_dataset_SalesOrderDataSet}).

DELETE OBJECT hSalesOrder.

end.

Nothing is happening!! please help.





[Non-text portions of this message have been removed]