Sandy Blondino
3rd November 2014, 21:06
Hello,
I have a question about writing a session using the DAL for bpmdm001.

I'm writing a session to input data from PeopleSoft into the employee and people tables in LN. I've used the tccom001 DAL and the tccom130 DAL to input data, but I cannot get the bpmdm001 DAL to work.

Has anyone had any luck using the bpmdm001 DAL?
Do you think I would have better luck trying to insert a record by using the AFS method?

Any help is appreciated.
Thanks,
Sandy

bhushanchanda
3rd November 2014, 21:24
Hi,

What problems are you facing with bpmdm001 DAL? Pointing some out might help. Have used quite time back. Didn't had any issue.

Sandy Blondino
3rd November 2014, 21:36
Hello,
I don't get an error, but the record is just not there in the bpmdm001 table. The data to be inserted is stored in the tccgs001 table.

Here is the code snippet:
error.found = dal.new.object("bpmdm001")
if error.found then
error.mess = "Could not insert record"
error.mess = dal.error.file
return
endif

dal.set.field("bpmdm001.emno", tccgs001.emno) | employee id code
dal.set.field("bpmdm001.cadr", temp.addr.code) | address code from
dal.set.field("bpmdm001.sexe", bpmdm.sexe.not.appl) | 3 - gender
dal.set.field("bpmdm001.emtp", bpmdm.emtp.internal) | 1 - employee type
dal.set.field("bpmdm001.msty", tccom.mestype.na) | 10 - messenger pe
| convert hwem from string to float
temp.hwem = lval(tccgs001.hwem)
dal.set.field("bpmdm001.hwem", temp.hwem)
domain tcmcs.str2 str.monthno, str.dayno
domain tcmcs.str4 str.yearno
STRING str.date(8,1)
str.date(1,1;8) = tccgs001.sdte
str.monthno = str.date(1,1;2)
str.dayno = str.date(3,1;2)
str.yearno = str.date(5,1;4)
domain tcmcs.str8 temp.sdte
temp.sdte = str.monthno & str.dayno & str.yearno
| convert string to long
long.sdte = lval(temp.sdte)
dal.set.field("bpmdm001.sdte", long.sdte)
if error.found then
error.mess = dal.error.file
else
commit.transaction()
endif

bhushanchanda
3rd November 2014, 22:21
Hi,

Please add dal.save.object("bpmdm001") before commit.
I guess you missed it.


long ret
error.found = dal.new.object("bpmdm001")
if error.found then
error.mess = "Could not insert record"
error.mess = dal.error.file
return
endif

dal.set.field("bpmdm001.emno", tccgs001.emno) | employee id code
dal.set.field("bpmdm001.cadr", temp.addr.code) | address code from
dal.set.field("bpmdm001.sexe", bpmdm.sexe.not.appl) | 3 - gender
dal.set.field("bpmdm001.emtp", bpmdm.emtp.internal) | 1 - employee type
dal.set.field("bpmdm001.msty", tccom.mestype.na) | 10 - messenger pe
| convert hwem from string to float
temp.hwem = lval(tccgs001.hwem)
dal.set.field("bpmdm001.hwem", temp.hwem)
domain tcmcs.str2 str.monthno, str.dayno
domain tcmcs.str4 str.yearno
STRING str.date(8,1)
str.date(1,1;8) = tccgs001.sdte
str.monthno = str.date(1,1;2)
str.dayno = str.date(3,1;2)
str.yearno = str.date(5,1;4)
domain tcmcs.str8 temp.sdte
temp.sdte = str.monthno & str.dayno & str.yearno
| convert string to long
long.sdte = lval(temp.sdte)
dal.set.field("bpmdm001.sdte", long.sdte)
ret = dal.save.object("bpmdm001")
if ret = 0 then
commit.transaction()
endif

endif

Sandy Blondino
6th November 2014, 16:12
That was it. I did just forget to add that statement.

Thanks for your help,
Sandy