Help required...

Namasiva

Member
Hi,

I have created a Program which will deliver the purchase order and receipt details i want the out put should be mentioned below.

I am here with attching the codes as well as the example of the out put
kindly look in to that and give me a solution.



Thanks in Advance
 

Attachments

  • xxporp02i.txt
    2.5 KB · Views: 16
  • xxporp02p.txt
    5.4 KB · Views: 12
  • out put example.doc
    45 KB · Views: 22

ovf

Member
Hi,

I would rewrite to something like:

/* xxporp02.p - PURCHASE ORDER REPORT BY PART */


/* DISPLAY TITLE */
define {1} shared frame zz.
{mfdtitle.i "2686871"}

define new shared variable incl_b2b_po like mfc_logical
label "Include EMT PO's".
define variable part like pod_part no-undo.
define variable part1 like pod_part no-undo.
define variable nbr like pod_nbr label "Purchase Order" no-undo.
define variable nbr1 like pod_nbr no-undo.
define variable due like pod_due_date no-undo.
define variable due1 like pod_due_date no-undo.
define variable loc like pod_loc no-undo.
define variable loc1 like pod_loc no-undo.
define variable name like ad_name no-undo.
define variable qty_open like pod_qty_ord label "Qty Open" no-undo.
define variable rctstat like in_rctpo_status no-undo.
define variable desc1 like pt_desc1 format "x(49)" no-undo.
define variable um like pt_um no-undo.
define variable open_only like mfc_logical initial yes
label "Open PO's Only" no-undo.
define variable sortby like mfc_logical label "Sort by "
initial no no-undo.

{gprunpdf.i "mcpl" "p"}

form
nbr colon 20
nbr1 label "To" colon 49 skip
due colon 20
due1 label "To" colon 49 skip
part colon 20
part1 label "To" colon 49 skip
loc colon 20
loc1 label "To" colon 49 skip (1)
open_only colon 20
incl_b2b_po colon 49
with frame a side-labels attr-space width 80.

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).
/* SET EXTERNAL LABELS */
setFrameLabels(frame zz:handle).
find first gl_ctrl
where gl_domain = global_domain
no-lock no-error.

{wbrp01.i}

repeat:
if nbr1 = hi_char then nbr1 = "".
if due = low_date then due = ?.
if due1 = hi_date then due1 = ?.
if part1 = hi_char then part1 = "".
if loc1 = hi_char then loc1 = "".
if c-application-mode <> "WEB" then
update
nbr nbr1
due due1
part part1
loc loc1
open_only
incl_b2b_po
with frame a.

{wbrp06.i &command = update
&fields = " nbr nbr1 due due1
part part1
loc loc1
open_only incl_b2b_po "
&frm = "a"}

if (c-application-mode <> "WEB") or
(c-application-mode = "WEB" and
(c-web-request begins "DATA"))
then do:

bcdparm = "".

{mfquoter.i nbr }
{mfquoter.i nbr1 }
{mfquoter.i part }
{mfquoter.i part1 }
{mfquoter.i due }
{mfquoter.i due1 }
{mfquoter.i loc }
{mfquoter.i loc1 }
{mfquoter.i open_only }
{mfquoter.i incl_b2b_po}

if part1 = "" then part1 = hi_char.
if nbr1 = "" then nbr1 = hi_char.
if due = ? then due = low_date.
if due1 = ? then due1 = hi_date.
if loc1 = "" then loc1 = hi_char.
end.

/* OUTPUT DESTINATION SELECTION */
{gpselout.i &printType = "printer"
&printWidth = 256
&pagedFlag = " "
&stream = " "
&appendToFile = " "
&streamedOutputToTerminal = " "
&withBatchOption = "yes"
&displayStatementType = 1
&withCancelMessage = "yes"
&pageBottomMargin = 6
&withEmail = "yes"
&withWinprint = "yes"
&defineVariables = "yes"}

{mfphead.i}

for each pod_det where pod_domain = global_domain and
not pod_sched and
(pod_part >= part and pod_part <= part1) and
((pod_due_date >= due) and (pod_due_date <= due1)
or pod_due_date = ? and (due = low_date))
and (pod_nbr >= nbr) and (pod_nbr <= nbr1)
and ((pod_status <> "c" and pod_status <> "x") or open_only = no)
no-lock,
each po_mstr where po_domain = global_domain and
( po_nbr = pod_nbr
and (not po_is_btb or incl_b2b_po)
and po_type <> "B")
no-lock break by pod_due_date
by po_vend
by pod_nbr
by pod_line
by pod_loc
with frame detframe width 256 no-attr-space no-box:

/* SET EXTERNAL LABELS */
setFrameLabels(frame detrame:handle).

/* SET EXTERNAL LABELS */
setFrameLabels(frame zz:handle).


if pod_status = "c" or pod_status = "x" then
qty_open = 0.
else
qty_open = pod_qty_ord - pod_qty_rcvd.

name = "".
find ad_mstr where ad_domain = global_domain and ad_addr = po_vend
no-lock no-error.
if available ad_mstr then name = ad_name.

find in_mstr where in_domain = global_domain and in_part = pod_part
no-lock no-error.

if available in_mstr then rctstat = in_rctpo_status.
if not available in_mstr then rctstat = "".

find pt_mstr where pt_domain = global_domain and pt_part = pod_part
no-lock no-error.

if available pt_mstr then desc1 = pt_desc1 + " " + pt_desc2.
if available pt_mstr then um = pt_um.

if first-of(po_vend) then
Put
pod_due_date a
name skip.


if page-size - line-counter < 3 then page.

display
pod_nbr
pod_line
pod_part
desc1
qty_open format "->>>>>9.9<<<<"
rctstat
pod_loc
po_buyer .

{mfrpexit.i}

end. /* pod_det */

/* REPORT TRAILER */
{mfrtrail.i}

end.

{wbrp04.i &frame-spec = a}
 

Namasiva

Member
Thanks for your help,

Based on your code i have done some changes in the my code itself,

now its working fine.
 
Top