reenageorge5
New Member
Hi,
If anybody knows reply me..
Bolow given is the code i have written for getting the details of an item from tables pt_mstr & tr_hist when user enters the item code(pt_part) (where pt_mstr.pt_part=tr_hist.tr_part).But i want to repeat the same for several times (if user wants).i want a dialog box asking do you want to repeat?
Once user select yes for it the same procedure should repeat....Is there any statement in Progress like GO TO in Other languages to return the ctrl to a particular stmt in pgm, so that i can repeat it once user selects yes.


Define Variable code like pt_part.
Define Variable ans as Logical Format "yes/no" No-Undo.
Define Temp-Table result field ptpart like pt_mstr.pt_part
field ptprodline like pt_prod_line
field ptchr05 like pt_mstr.pt__chr05
field trpart like tr_hist.tr_part
field trtype like tr_hist.tr_type
field trdate like tr_hist.tr_date
field ptstatus like pt_status
field ptprice like pt_price
field ptordqty like pt_ord_qty
field ptrop like pt_rop
field trqtyreq like tr_qty_req
field trqtyshort like tr_qty_short
field trshiptype like tr_ship_type.
Form header space (15)" **************ITEM DEATILS*************" WITH FRAME B.
Form "Item code:" ptpart space(15) "Transaction Type:" trtype SKIP(2)
"Date:" trdate SPACE(31) "Product Line:" ptprodline SKIP(2)
"CBU Code:" ptchr05 Space(27) "Price:" ptprice Skip(2)
"Ordered Quantity:" ptordqty space(17) "Re-Order Point:" ptrop skip(2)
"Status:" ptstatus space(29) "Quantity Required:" trqtyreq
Skip(2)
"Shortage:" trqtyshort space(23) "Ship Type:" trshiptype
with frame b 20 down width 100.
Prompt-For pt_mstr.pt_part Label "Item Number" WITH FRAME a CENTERED.
Assign code = Input pt_mstr.pt_part.
Find First pt_mstr where pt_mstr.pt_part = code NO-ERROR.
FInd first tr_hist where tr_hist.tr_part = code.
If avail pt_mstr Then
Create result.
ptpart = pt_part.
ptprodline = pt_prod_line.
ptchr05 = pt__chr05.
trpart = tr_part.
trtype = tr_type.
trdate = tr_date.
ptstatus = pt_status.
ptprice = pt_price.
ptordqty = pt_ord_qty.
ptrop = pt_rop.
trqtyreq = tr_qty_req.
trqtyshort = tr_qty_short.
trshiptype = tr_ship_type.
For each result:
Display ptpart
trdate
trtype
ptprodline
ptchr05
ptprice
ptstatus
ptrop
ptordqty
trqtyreq
trqtyshort
trshiptype
with frame b no-Labels.
Else Message "NOt Found.....".
END.


Also is therein progrss any stmt like "Select Distinct" in SQL to avoid duplicate rows in a tables.
If anybody knows reply me..
Bolow given is the code i have written for getting the details of an item from tables pt_mstr & tr_hist when user enters the item code(pt_part) (where pt_mstr.pt_part=tr_hist.tr_part).But i want to repeat the same for several times (if user wants).i want a dialog box asking do you want to repeat?
Once user select yes for it the same procedure should repeat....Is there any statement in Progress like GO TO in Other languages to return the ctrl to a particular stmt in pgm, so that i can repeat it once user selects yes.



Define Variable code like pt_part.
Define Variable ans as Logical Format "yes/no" No-Undo.
Define Temp-Table result field ptpart like pt_mstr.pt_part
field ptprodline like pt_prod_line
field ptchr05 like pt_mstr.pt__chr05
field trpart like tr_hist.tr_part
field trtype like tr_hist.tr_type
field trdate like tr_hist.tr_date
field ptstatus like pt_status
field ptprice like pt_price
field ptordqty like pt_ord_qty
field ptrop like pt_rop
field trqtyreq like tr_qty_req
field trqtyshort like tr_qty_short
field trshiptype like tr_ship_type.
Form header space (15)" **************ITEM DEATILS*************" WITH FRAME B.
Form "Item code:" ptpart space(15) "Transaction Type:" trtype SKIP(2)
"Date:" trdate SPACE(31) "Product Line:" ptprodline SKIP(2)
"CBU Code:" ptchr05 Space(27) "Price:" ptprice Skip(2)
"Ordered Quantity:" ptordqty space(17) "Re-Order Point:" ptrop skip(2)
"Status:" ptstatus space(29) "Quantity Required:" trqtyreq
Skip(2)
"Shortage:" trqtyshort space(23) "Ship Type:" trshiptype
with frame b 20 down width 100.
Prompt-For pt_mstr.pt_part Label "Item Number" WITH FRAME a CENTERED.
Assign code = Input pt_mstr.pt_part.
Find First pt_mstr where pt_mstr.pt_part = code NO-ERROR.
FInd first tr_hist where tr_hist.tr_part = code.
If avail pt_mstr Then
Create result.
ptpart = pt_part.
ptprodline = pt_prod_line.
ptchr05 = pt__chr05.
trpart = tr_part.
trtype = tr_type.
trdate = tr_date.
ptstatus = pt_status.
ptprice = pt_price.
ptordqty = pt_ord_qty.
ptrop = pt_rop.
trqtyreq = tr_qty_req.
trqtyshort = tr_qty_short.
trshiptype = tr_ship_type.
For each result:
Display ptpart
trdate
trtype
ptprodline
ptchr05
ptprice
ptstatus
ptrop
ptordqty
trqtyreq
trqtyshort
trshiptype
with frame b no-Labels.
Else Message "NOt Found.....".
END.


Also is therein progrss any stmt like "Select Distinct" in SQL to avoid duplicate rows in a tables.