The following may help you to update the F00165 using the EDI key. You'll need to create a GT554311Z1 or similar object using the EDI keys. Later on, you'll probably need a function to change the F00165 key, so that it corresponds to the actual order and can be viewed from the application.
<font class="small">Code:</font><hr /><pre> #include <jde.h>
#define b554311z_c
#include <b554311z.h>
/JDEBFRTN (ID) JDEBFWINAPI InsertF4311Z1GenericText (LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD554311Z1 lpDS)
{
/************************************************************************
* Variable declarations
************************************************************************/
JDEDB_RESULT idJDBReturn = JDEDB_PASSED;
//int nSeqNumber = 0;
/************************************************************************
* Declare structures
************************************************************************/
DSGT554311Z dsGT554311ZKey;
/************************************************************************
* Declare pointers
************************************************************************/
HUSER hUser = (HUSER)NULL;
/************************************************************************
* Main Processing
************************************************************************/
jdeStrcpy (lpDS->szErrorMessageID, _J(" "));
memset ((void *)(&dsGT554311ZKey), (int)(_J('\0')), sizeof(dsGT554311ZKey));
jdeStrncpy (dsGT554311ZKey.szEdiUserId, lpDS->szEdiUserId,
DIM (dsGT554311ZKey.szEdiUserId) -1);
jdeStrncpy (dsGT554311ZKey.szEdiBatchNumber, lpDS->szEdiBatchNumber,
DIM (dsGT554311ZKey.szEdiBatchNumber) -1);
jdeStrncpy (dsGT554311ZKey.szEdiTransactNumber, lpDS->szEdiTransactNumber,
DIM (dsGT554311ZKey.szEdiTransactNumber) -1);
MathCopy (&dsGT554311ZKey.mnEdiLineNumber, &lpDS->mnEdiLineNumber);
//lpDS->nMediaObjectSequenceNumber = nSeqNumber+1;
idJDBReturn = ModifyGenericText(_J("GT554311Z"), 0, &dsGT554311ZKey, lpDS->szCDATAElementData);
</pre><hr />