Character prepended to value in Fetch.Single,Select/Fetch.Next

Alex Gray

Member
Hi,

I was hoping maybe someone can advise on this weird issue.
Firstly sorry if it is a newb question but I was unable to find anything related to my issue.

I am creating a NER function to update a record in a custom table.
This part is all successful, data updated, and in the correct format

5501.Update [Index 3: StockCode, Serial Number]
BF szDSIStockCode [Z55LITM] = TK DSI Stock Code [Z55LITM]
BF szDSISerialNumber [Z55LOTN] = TK DSI Serial Number [Z55LOTN]
BF jdDSIExpiryDate [Z55EPRY] -> TK DSI Expiry Date [Z55EPRY]
BF szDSIWarehouse [Z55MCU] -> TK DSI Warehouse [Z55MCU]

I then attempt to retrieve this updated record to return data back from NER and here the issue starts.
BF szDSIWarehouse [Z55MCU] somehow ends up with extra characters prepended to the return. (Original value "6002")
The data type has no rules, formatting applied to it, just 12 char String value.

Test in patwell return something similar to Patwell return val.png

Debugging in VS
VS return value.png

On top of that, the date BF jdDSIExpiryDate [Z55EPRY] is returned blank for some reason.
Would anybody be able to advise on possible cause or direction in which I should dig to solve this mystery?

F5501.Select [Index 3: StockCode, Serial Number]
BF szDSIStockCode [Z55LITM] = TK DSI Stock Code [Z55LITM]
BF szDSISerialNumber [Z55LOTN] = TK DSI Serial Number [Z55LOTN]
F5501.FetchNext [Index 3: StockCode, Serial Number]
BF szDSIStockCode [Z55LITM] <- TK DSI Stock Code [Z55LITM]
BF szDSISerialNumber [Z55LOTN] <- TK DSI Serial Number [Z55LOTN]
BF cDSIFlag [Z55FLAG] <- TK DSI Flag [Z55FLAG]
BF jdDSIExpiryDate [Z55EPRY] <- TK DSI Expiry Date [Z55EPRY]
BF szDSIWarehouse [Z55MCU] <- TK DSI Warehouse [Z55MCU]
BF szDSITransactionTime [Z55TIME] <- TK DSI Transaction Time [Z55TIME]


Thanks ahead for your time
 

Kim Schmidt

Well Known Member
This looks like what happens when a business function's data structure is updated without rebuilding the data structure, the NER, and the objects that are calling it. It's like something in the DS pushed everything down by two characters (assuming you're not using a double-byte character set).
 

Alex Gray

Member
Thank you Kim.
I think I found the issue thanks to your advice.

Looks like the length of One string type DD item in the table is different from the header file.
Not sure how that happened must have been before my time.
In my case header file value is 10 chars and DD item is 12. The return value from the table overflows into other values by 2 characters.
My date field (jdDSIExpiryDate ) and (szDSIWarehouse) follow right after and data is now invalid for them.

Thanks again
 
Top