mstockre
23rd April 2005, 03:34
We are writing script using AFS for entering sales orders. Some of the fields are from a file (dates, PO, qty). I was able to get the date format. But the PO format on tdsls4101m000 seems to want to get the best of me. Here is what I have, anyone have suggestions?
string eono(5)
domain tcmcs.str30 work.eono
|extract field from the file
eono = extract.field()
|then try to format the sucker
work.eono = sprintf$("%-*s",30,eono)
stpapi.put.field("tdsls4101m001", "tdsls040.eono", work.eono)
Thanks
Marianne Stockreef
stockrem@gtindustries.com
LittleJohn
23rd April 2005, 21:04
I had the same problem once.. I just assigned the result to another field and did a ....
work.eono = strip$(shiftl$(result))
Hope this helps
LittleJohn
mstockre
27th April 2005, 19:07
Thank you Little John for the suggestion. You know the Po still doesnt show up. Stubborn thing.
Marianne
mark_h
27th April 2005, 19:22
I do not know if this is any different than what has been suggested, but what I typically do is read from the file, convert to the actual domain, then put using the str$ function. In this case I would declare a field as tcorno, use val to convert the input string, then in the put.field I would use str$ with the actual domain. Not sure that is any different than actually doing what LittleJohn suggested.
Not sure if this is relevant, but I have had fields not work with insert or update. In one case I had to insert the record, then update the field in question after the update. In another case I just updated the table field directly when update would not work. Just a thought.
mstockre
27th April 2005, 19:28
You know it sure is worth a short for me to try. Thank you for your suggestion. I will let you know if it works.
Thanks,
Marianne