Hi
I try to dump the Alternate Unit of Measures in a file.
I created the following program.
but the output is not correct.
For instance item number 017299 gives following output.
017299;22+03+11;Contec;OK;1;1;.001;1;10;5;6;1000;1;1;001;
For this item the alternate UM DU is not available but it display as 1.
this happened for most of the items.
Can you look what i did wrong in my script
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{mfdtitle.i "XX a"}
def var file as cha no-undo form "x(20)" init "altum.xls".
def var dir as cha no-undo form "x(20)"
init "./".
def var t1_part like um_part.
def var t1_umum like um_um.
def var t1_umaltum like um_alt_um.
def var t1_umconvdu like um_conv init "".
def var t1_umconvcs like um_conv init "".
def var t1_umconvpc like um_conv init "".
def var t1_umconvkg like um_conv init "".
def var t1_umconvlt like um_conv init "".
def var t1_umconvhi like um_conv init "".
def var t1_umconvti like um_conv init "".
def var t1_umconvpl like um_conv init "".
def var t1_umconvst like um_conv init "".
def var t1_umconvsu like um_conv init "".
def stream x.
def temp-table t1_altum no-undo
field t1_part like pt_part
field t1_umum like um_um
field t1_umaltum like um_alt_um
field t1_umconvdu like um_conv
field t1_umconvcs like um_conv
field t1_umconvpc like um_conv
field t1_umconvkg like um_conv
field t1_umconvlt like um_conv
field t1_umconvhi like um_conv
field t1_umconvti like um_conv
field t1_umconvpl like um_conv
field t1_umconvst like um_conv
field t1_umconvsu like um_conv.
form "Download Alternate Product UM data in file to user directory
filename : " file no-label skip
with frame a width 80 side-labels.
display file with frame a.
assign dir = "./".
assign bcdparm = "".
{mfselbpr.i printer 80}
{mfphead2.i}
pause 0 before-hide.
output stream x to value(dir + file).
put stream x
"Product;Desc1;Desc2;DU;"
"CS;PC;KG;LT;HI;TI;PL;ST;SU;"
skip.
for each pt_mstr where pt_domain = global_domain
no-lock:
for each um_mstr where um_domain = global_domain
and um_part = pt_part
and um_um = pt_um
no-lock
break by um_part by um_alt_um:
if um_alt_um = "DU"
then assign t1_umconvdu = um_conv.
if um_alt_um = "CS"
then assign t1_umconvcs = um_conv.
if um_alt_um = "PC"
then assign t1_umconvpc = um_conv.
if um_alt_um = "KG"
then assign t1_umconvkg = um_conv.
if um_alt_um = "LT"
then assign t1_umconvlt = um_conv.
if um_alt_um = "HI"
then assign t1_umconvhi = um_conv.
if um_alt_um = "TI"
then assign t1_umconvti = um_conv.
if um_alt_um = "PL"
then assign t1_umconvpl = um_conv.
if um_alt_um = "ST"
then assign t1_umconvst = um_conv.
if um_alt_um = "SU"
then assign t1_umconvsu = um_conv.
if last-of (um_part) then
put stream x unformatted
um_part ";"
pt_desc1 ";"
pt_desc2 ";"
pt_status ";"
string(t1_umconvdu) ";"
/* t1_umconvdu ";" */
t1_umconvcs ";"
t1_umconvpc ";"
t1_umconvkg ";"
t1_umconvlt ";"
t1_umconvhi ";"
t1_umconvti ";"
t1_umconvpl ";"
t1_umconvst ";"
t1_umconvsu ";"
um_domain ";"
skip.
end.
end.
output stream x close.
pause before-hide.
{mftrl080.i}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks for your Help.
I try to dump the Alternate Unit of Measures in a file.
I created the following program.
but the output is not correct.
For instance item number 017299 gives following output.
017299;22+03+11;Contec;OK;1;1;.001;1;10;5;6;1000;1;1;001;
For this item the alternate UM DU is not available but it display as 1.
this happened for most of the items.
Can you look what i did wrong in my script
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{mfdtitle.i "XX a"}
def var file as cha no-undo form "x(20)" init "altum.xls".
def var dir as cha no-undo form "x(20)"
init "./".
def var t1_part like um_part.
def var t1_umum like um_um.
def var t1_umaltum like um_alt_um.
def var t1_umconvdu like um_conv init "".
def var t1_umconvcs like um_conv init "".
def var t1_umconvpc like um_conv init "".
def var t1_umconvkg like um_conv init "".
def var t1_umconvlt like um_conv init "".
def var t1_umconvhi like um_conv init "".
def var t1_umconvti like um_conv init "".
def var t1_umconvpl like um_conv init "".
def var t1_umconvst like um_conv init "".
def var t1_umconvsu like um_conv init "".
def stream x.
def temp-table t1_altum no-undo
field t1_part like pt_part
field t1_umum like um_um
field t1_umaltum like um_alt_um
field t1_umconvdu like um_conv
field t1_umconvcs like um_conv
field t1_umconvpc like um_conv
field t1_umconvkg like um_conv
field t1_umconvlt like um_conv
field t1_umconvhi like um_conv
field t1_umconvti like um_conv
field t1_umconvpl like um_conv
field t1_umconvst like um_conv
field t1_umconvsu like um_conv.
form "Download Alternate Product UM data in file to user directory
filename : " file no-label skip
with frame a width 80 side-labels.
display file with frame a.
assign dir = "./".
assign bcdparm = "".
{mfselbpr.i printer 80}
{mfphead2.i}
pause 0 before-hide.
output stream x to value(dir + file).
put stream x
"Product;Desc1;Desc2;DU;"
"CS;PC;KG;LT;HI;TI;PL;ST;SU;"
skip.
for each pt_mstr where pt_domain = global_domain
no-lock:
for each um_mstr where um_domain = global_domain
and um_part = pt_part
and um_um = pt_um
no-lock
break by um_part by um_alt_um:
if um_alt_um = "DU"
then assign t1_umconvdu = um_conv.
if um_alt_um = "CS"
then assign t1_umconvcs = um_conv.
if um_alt_um = "PC"
then assign t1_umconvpc = um_conv.
if um_alt_um = "KG"
then assign t1_umconvkg = um_conv.
if um_alt_um = "LT"
then assign t1_umconvlt = um_conv.
if um_alt_um = "HI"
then assign t1_umconvhi = um_conv.
if um_alt_um = "TI"
then assign t1_umconvti = um_conv.
if um_alt_um = "PL"
then assign t1_umconvpl = um_conv.
if um_alt_um = "ST"
then assign t1_umconvst = um_conv.
if um_alt_um = "SU"
then assign t1_umconvsu = um_conv.
if last-of (um_part) then
put stream x unformatted
um_part ";"
pt_desc1 ";"
pt_desc2 ";"
pt_status ";"
string(t1_umconvdu) ";"
/* t1_umconvdu ";" */
t1_umconvcs ";"
t1_umconvpc ";"
t1_umconvkg ";"
t1_umconvlt ";"
t1_umconvhi ";"
t1_umconvti ";"
t1_umconvpl ";"
t1_umconvst ";"
t1_umconvsu ";"
um_domain ";"
skip.
end.
end.
output stream x close.
pause before-hide.
{mftrl080.i}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks for your Help.