phoenix_me
Member
I have a problem with BUFFERs, it seems like I don't understand the philosophy of buffers or I am doing something wrong.
What I like to do is to create temp table, then two buffers for this temp table. In this two buffers I would like to keep two different records and modify them.
Please look below how I was trying to do this.
/* temp table definition - Vendor table is DB table*/
DEFINE TEMP-TABLE ttVendorOrig LIKE Vendor
FIELD TypRek AS CHARACTER FORMAT "X(1)" INITIAL ""
INDEX TypRekordu IS UNIQUE TypRek.
/* First Buffer */
DEFINE BUFFER ttVendorOrig1 FOR ttVendorOrig.
DEFINE VARIABLE httVendorOrig1 AS HANDLE NO-UNDO.
httVendorOrig1 = TEMP-TABLE ttVendorOrig1EFAULT-BUFFER-HANDLE.
httVendorOrig1:BUFFER-CREATE.
httVendorOrig1:BUFFER-FIELD("TypRek"):BUFFER-VALUE = "B".
/* Secound Buffer */
DEFINE BUFFER ttVendorOrig2 FOR ttVendorOrig.
DEFINE VARIABLE httVendorOrig2 AS HANDLE NO-UNDO.
httVendorOrig2 = TEMP-TABLE ttVendorOrig2EFAULT-BUFFER-HANDLE.
httVendorOrig2:BUFFER-CREATE.
httVendorOrig2:BUFFER-FIELD("TypRek"):BUFFER-VALUE = "P".
/* At this point I should have two buffers
with two different Values for TypRek field,
so I am checking if my assumption is true */
OUTPUT TO VALUE('my_file.txt')
MESSAGE httVendorOrig1:BUFFER-FIELD("TypRek"):BUFFER-VALUE.
MESSAGE httVendorOrig2:BUFFER-FIELD("TypRek"):BUFFER-VALUE.
OUTPUT CLOSE.
Unfortunatelly BOTH TypRek having 'P' value, instead of having 'P' and 'B' - and I don't know why. I will be very appreciated if someone can explain it to me and give some hint to resolve it.
What I like to do is to create temp table, then two buffers for this temp table. In this two buffers I would like to keep two different records and modify them.
Please look below how I was trying to do this.
/* temp table definition - Vendor table is DB table*/
DEFINE TEMP-TABLE ttVendorOrig LIKE Vendor
FIELD TypRek AS CHARACTER FORMAT "X(1)" INITIAL ""
INDEX TypRekordu IS UNIQUE TypRek.
/* First Buffer */
DEFINE BUFFER ttVendorOrig1 FOR ttVendorOrig.
DEFINE VARIABLE httVendorOrig1 AS HANDLE NO-UNDO.
httVendorOrig1 = TEMP-TABLE ttVendorOrig1EFAULT-BUFFER-HANDLE.
httVendorOrig1:BUFFER-CREATE.
httVendorOrig1:BUFFER-FIELD("TypRek"):BUFFER-VALUE = "B".
/* Secound Buffer */
DEFINE BUFFER ttVendorOrig2 FOR ttVendorOrig.
DEFINE VARIABLE httVendorOrig2 AS HANDLE NO-UNDO.
httVendorOrig2 = TEMP-TABLE ttVendorOrig2EFAULT-BUFFER-HANDLE.
httVendorOrig2:BUFFER-CREATE.
httVendorOrig2:BUFFER-FIELD("TypRek"):BUFFER-VALUE = "P".
/* At this point I should have two buffers
with two different Values for TypRek field,
so I am checking if my assumption is true */
OUTPUT TO VALUE('my_file.txt')
MESSAGE httVendorOrig1:BUFFER-FIELD("TypRek"):BUFFER-VALUE.
MESSAGE httVendorOrig2:BUFFER-FIELD("TypRek"):BUFFER-VALUE.
OUTPUT CLOSE.
Unfortunatelly BOTH TypRek having 'P' value, instead of having 'P' and 'B' - and I don't know why. I will be very appreciated if someone can explain it to me and give some hint to resolve it.