Q: In QC Order the DocEntry field is empty
R: With Beas 9.0 we inserted the docentry field. If the customer made an update from older Beas version and the update script was not working correct, Beas don't fill all docentry fields.
R: Other reason: You use Beas 9.2 PL 4 or older and insert new samples manually
A: With follow script you can fill the Document number in QC order
(BEAS_QSFTHAUPT.DOCENTRY and all other tables as BEAS_QSFTPOS, BEAS_QSFTMESSUNG)
// New docentry-field in QC-Order
destroy=lds
declare=lds=ue_datastorevalues
lds.updatetable=BEAS_QSFTHAUPT
lds=select "CHARGE_ID","KND_ID","BELNR_ID","DocEntry" from "BEAS_QSFTHAUPT" where ifnull("DocEntry",0)=0
select isnull(max("DocEntry"),0)+1 into :ll_docentry from "BEAS_QSFTHAUPT"
for ll_loop=1 to <lds.rowcount>
lds.setrow=<ll_loop>
lds.docentry=<ll_docentry>
setvar=ll_docentry=%numadd(ll_docentry,1)
next
lds.update
sql=update "BEAS_QSFTMESSUNG" set "DocEntry"="BEAS_QSFTHAUPT"."DocEntry" from "BEAS_QSFTHAUPT" where "BEAS_QSFTHAUPT"."CHARGE_ID"="BEAS_QSFTMESSUNG"."CHARGE_ID" and "BEAS_QSFTHAUPT"."KND_ID"='' and "BEAS_QSFTHAUPT"."BELNR_ID"="BEAS_QSFTMESSUNG"."BELNR_ID" and Coalesce("BEAS_QSFTMESSUNG"."DocEntry",0)=0
sql=update "BEAS_QSFTPOS" set "DocEntry"="BEAS_QSFTHAUPT"."DocEntry" from "BEAS_QSFTHAUPT" where "BEAS_QSFTHAUPT"."CHARGE_ID"="BEAS_QSFTPOS"."CHARGE_ID" and "BEAS_QSFTHAUPT"."KND_ID"='' AND "BEAS_QSFTPOS"."BELNR_ID"="BEAS_QSFTHAUPT"."BELNR_ID" and Coalesce("BEAS_QSFTPOS"."DocEntry",0)=0
sql=update "BEAS_QSFTMESSUNG" set "PRUEFKZ"='O' where Coalesce("PRUEFKZ",'')='';