Hi I hve created a program which will deliver the CSV file for the item planning data.
my item number is having 00 as prefix but when i open the csv file, i am geting the out put as below.
the item numbers showing without the two zeros as per the sample below
Item_Number
UOM
Order_Qty
Re_order_point
P/M
Safety_Stock
Mini_Order
Pur_Lead_Time
BG
p
BG
p
BG
p
BG
p
The item mumber should be display as 008802
008803
008804
008808
Please find below my codes
*********************************************************************************
/* added for desktop version */
{mfdtitle.i "2+ "}
/* end desktop add */
define variable line like pt_prod_line no-undo.
define variable line1 like pt_prod_line no-undo.
define variable part like pt_part no-undo.
define variable part1 like pt_part no-undo.
define variable type like pt_part_type no-undo.
define variable type1 like pt_part_type no-undo.
define variable buyer like pt_buyer no-undo.
define variable buyer1 like pt_buyer no-undo.
define variable vend like pt_vend no-undo.
define variable vend1 like pt_vend no-undo.
define variable pldesc like pl_desc no-undo.
DEFINE VARIABLE outfile AS CHARACTER NO-UNDO.
def stream x.
assign outfile = "" .
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A
FORM
RECT-FRAME AT ROW 1.4 COLUMN 1.25
RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL
SKIP(.1)
line colon 15
line1 label {t001.i} colon 49 skip
part colon 15
part1 label {t001.i} colon 49 skip
type colon 15
type1 label {t001.i} colon 49 skip
buyer colon 15
buyer1 label {t001.i} colon 49 skip
vend colon 15
vend1 label {t001.i} colon 49 skip
SKIP(.4)
WITH FRAME a SIDE-LABELS WIDTH 80 ATTR-SPACE.
/* added for desktop version */
setframelabels(FRAME a:HANDLE).
/* REPORT BLOCK */
{wbrp01.i}
repeat :
if part1 = hi_char then part1 = "".
if line1 = hi_char then line1 = "".
if type1 = hi_char then type1 = "".
if buyer1 = hi_char then buyer1 = "".
if vend1 = hi_char then vend1 = "".
if c-application-mode <> 'web' then
update line line1 part part1 type
type1 buyer buyer1 vend vend1 with frame a.
{wbrp06.i &command = update &fields = "line line1 part part1 type
type1 buyer buyer1 vend vend1" &frm = "a"}
if (c-application-mode <> 'web') or
(c-application-mode = 'web' and
(c-web-request begins 'data')) then do:
bcdparm = "".
{mfquoter.i line }
{mfquoter.i line1 }
{mfquoter.i part }
{mfquoter.i part1 }
{mfquoter.i type }
{mfquoter.i type1 }
{mfquoter.i buyer }
{mfquoter.i buyer1 }
{mfquoter.i vend }
{mfquoter.i vend1 }
if part1 = "" then part1 = hi_char.
if line1 = "" then line1 = hi_char.
if type1 = "" then type1 = hi_char.
if buyer1 = "" then buyer1 = hi_char.
if vend1 = "" then vend1 = hi_char.
end.
{gpselout.i &printType = "printer"
&printWidth = 352
&pagedFlag = " "
&stream = " "
&appendToFile = " "
&streamedOutdisplayToTerminal = " "
&withBatchOption = "yes"
&displayStatementType = 1
&withCancelMessage = "yes"
&pageBottomMargin = 4
&withEmail = "yes"
&withWinprint = "yes"
&defineVariables = "yes"}
{mfrpchk.i}
outfile = "/extdata/desktop/dtlive/Board/Item_Planning_Data.csv".
output stream x to value( outfile).
put stream x
"Item_Number" ","
"UOM" ","
"Order_Qty" ","
"Re_order_point" ","
"P/M" ","
"Safety_Stock" ","
"Mini_Order" ","
"Pur_Lead_Time" ","
skip.
for each pt_mstr where (pt_part >= part and pt_part <= part1)
and (pt_prod_line >= line and pt_prod_line <= line1)
and (pt_part_type >= type and pt_part_type <= type1)
and (pt_buyer >= buyer and pt_buyer <= buyer1)
and (pt_vend >= vend and pt_vend <= vend1)
no-lock use-index pt_prod_part break by pt_prod_line
by pt_part :
put stream x unformatted
string (pt_part) ","
string (pt_um) ","
string (pt_ord_qty) ","
string (pt_rop) ","
string (pt_pm_code) ","
string (pt_sfty_stk) ","
string (pt_ord_min) ","
string (pt_pur_lead)
skip.
end. /* FOR EACH pt_mstr */
{mfrtrail.i}
end. /* REPEAT */
output stream x close.
{wbrp04.i &frame-spec = a}
********************************************************************************************************
Please help me out to resolve this issue
my item number is having 00 as prefix but when i open the csv file, i am geting the out put as below.
the item numbers showing without the two zeros as per the sample below
Item_Number
UOM
Order_Qty
Re_order_point
P/M
Safety_Stock
Mini_Order
Pur_Lead_Time
8802
40
0
0
0
0
8803
40
0
0
0
0
8804
40
0
0
0
0
8808
0
0
0
0
0
The item mumber should be display as 008802
008803
008804
008808
Please find below my codes
*********************************************************************************
/* added for desktop version */
{mfdtitle.i "2+ "}
/* end desktop add */
define variable line like pt_prod_line no-undo.
define variable line1 like pt_prod_line no-undo.
define variable part like pt_part no-undo.
define variable part1 like pt_part no-undo.
define variable type like pt_part_type no-undo.
define variable type1 like pt_part_type no-undo.
define variable buyer like pt_buyer no-undo.
define variable buyer1 like pt_buyer no-undo.
define variable vend like pt_vend no-undo.
define variable vend1 like pt_vend no-undo.
define variable pldesc like pl_desc no-undo.
DEFINE VARIABLE outfile AS CHARACTER NO-UNDO.
def stream x.
assign outfile = "" .
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A
FORM
RECT-FRAME AT ROW 1.4 COLUMN 1.25
RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL
SKIP(.1)
line colon 15
line1 label {t001.i} colon 49 skip
part colon 15
part1 label {t001.i} colon 49 skip
type colon 15
type1 label {t001.i} colon 49 skip
buyer colon 15
buyer1 label {t001.i} colon 49 skip
vend colon 15
vend1 label {t001.i} colon 49 skip
SKIP(.4)
WITH FRAME a SIDE-LABELS WIDTH 80 ATTR-SPACE.
/* added for desktop version */
setframelabels(FRAME a:HANDLE).
/* REPORT BLOCK */
{wbrp01.i}
repeat :
if part1 = hi_char then part1 = "".
if line1 = hi_char then line1 = "".
if type1 = hi_char then type1 = "".
if buyer1 = hi_char then buyer1 = "".
if vend1 = hi_char then vend1 = "".
if c-application-mode <> 'web' then
update line line1 part part1 type
type1 buyer buyer1 vend vend1 with frame a.
{wbrp06.i &command = update &fields = "line line1 part part1 type
type1 buyer buyer1 vend vend1" &frm = "a"}
if (c-application-mode <> 'web') or
(c-application-mode = 'web' and
(c-web-request begins 'data')) then do:
bcdparm = "".
{mfquoter.i line }
{mfquoter.i line1 }
{mfquoter.i part }
{mfquoter.i part1 }
{mfquoter.i type }
{mfquoter.i type1 }
{mfquoter.i buyer }
{mfquoter.i buyer1 }
{mfquoter.i vend }
{mfquoter.i vend1 }
if part1 = "" then part1 = hi_char.
if line1 = "" then line1 = hi_char.
if type1 = "" then type1 = hi_char.
if buyer1 = "" then buyer1 = hi_char.
if vend1 = "" then vend1 = hi_char.
end.
{gpselout.i &printType = "printer"
&printWidth = 352
&pagedFlag = " "
&stream = " "
&appendToFile = " "
&streamedOutdisplayToTerminal = " "
&withBatchOption = "yes"
&displayStatementType = 1
&withCancelMessage = "yes"
&pageBottomMargin = 4
&withEmail = "yes"
&withWinprint = "yes"
&defineVariables = "yes"}
{mfrpchk.i}
outfile = "/extdata/desktop/dtlive/Board/Item_Planning_Data.csv".
output stream x to value( outfile).
put stream x
"Item_Number" ","
"UOM" ","
"Order_Qty" ","
"Re_order_point" ","
"P/M" ","
"Safety_Stock" ","
"Mini_Order" ","
"Pur_Lead_Time" ","
skip.
for each pt_mstr where (pt_part >= part and pt_part <= part1)
and (pt_prod_line >= line and pt_prod_line <= line1)
and (pt_part_type >= type and pt_part_type <= type1)
and (pt_buyer >= buyer and pt_buyer <= buyer1)
and (pt_vend >= vend and pt_vend <= vend1)
no-lock use-index pt_prod_part break by pt_prod_line
by pt_part :
put stream x unformatted
string (pt_part) ","
string (pt_um) ","
string (pt_ord_qty) ","
string (pt_rop) ","
string (pt_pm_code) ","
string (pt_sfty_stk) ","
string (pt_ord_min) ","
string (pt_pur_lead)
skip.
end. /* FOR EACH pt_mstr */
{mfrtrail.i}
end. /* REPEAT */
output stream x close.
{wbrp04.i &frame-spec = a}
********************************************************************************************************
Please help me out to resolve this issue