Update F4211 using End DOC master BSFN for P42101

Princee

Member
Hello ,
We have a requirement to modify the master BSFN " F4211 End DOC " to update F4211 before commitments , for the application P42101 based on few validations.
also need to validate few other file values and also need to update few custom files based on new sales order , could you please let me know,

1. I see P42101 is calling the BSFN " Sales Order Application Controller - External " and not F4211 End Doc .


  • If the BSFN " Sales Order Application Controller - External " internally calling F4211 End Doc ?
  • If we will modify F4211 End Doc , it will be considered for P42101 and update F4211 ?
  • Do we need to update the cache ( what are the cache) and it will update F4211 after end Doc commitments ?
  • If anyone done any such modification in F4211 End Doc for P42101 ? could you provide some more details
  • what are teh cache need to be updated ? do you have any sample code ? pls. share

Thanks
 
Yes. F4211FSEndDoc (as well as all the other sales order MBF function calls) is/are called from P42101 - simply debug the B4200310/B4200311 and you will see this. All sales order entry/edit processes (with a few exceptions for line edits) ultimately call the sales order MBF. P42101's controller BSFNs are simply an additional abstraction layer between the APPL and the sales order MBF function calls. Any custom processes you have to create/edit sales orders should also use the sales order MBFs.

As far as updating jdeCache? That all depends on what you are trying to do and when you are trying to do it... it all depends on what modification you are trying to make.

We have modified the sales order MBF quite extensively but as far as providing details or sample code that would be applicable to you... again that really all depends on what you are trying to do. The only suggestion I have is to put all of your custom logic in sub-routines and then simply call the sub-routine from within the pristine code (don't put large blocks of modified code in the pristine code... the pristine code as bad enough as it is with massive blocks of code, magic numbers, indentions, etc.). In addition to simply being good coding practice it makes it a lot easier to retrofit for ESUs/Upgrades.

Code:
/**************************************************************************
 *  Business Function:  F4211FSEditLine
 *
 *        Description:  F4211 FS Edit Line
 *
 *         Parameters:
 *           LPBHVRCOM           lpBhvrCom    Business Function Communications
 *           LPVOID              lpVoid       Void Parameter - DO NOT USE!
 *           LPDSD4200310F       lpDS         Parameter Data Structure Pointer
 *
 *************************************************************************/
JDEBFRTN(ID) JDEBFWINAPI F4211FSEditLine (LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD4200310F lpDS)
{
/*===========================================================================
 * Acme Mod Begin
 *===========================================================================*/
	ID	idAcmeReturn = ER_SUCCESS;


	idAcmeReturn = I4200310_F4211FSEditLine(lpBhvrCom, lpVoid, lpDS);

	I4200310_AcmeCompleteItemLocSetupOnTransOrder(lpBhvrCom, lpVoid, lpDS);

	if(I4200310_AcmeCalcAltQty(lpBhvrCom, lpVoid, lpDS) == ER_ERROR)					/* ATI#536 */
		idAcmeReturn = ER_ERROR;

	if(I4200310_AcmeProcessCommitsEdit(lpBhvrCom, lpVoid, lpDS) == ER_ERROR)		/* ATI#1297 */
		idAcmeReturn = ER_ERROR;

	if(I4200310_AcmeELValidateDates(lpBhvrCom, lpVoid, lpDS) == ER_ERROR)			/* ATI#598 */
		idAcmeReturn = ER_ERROR;

	I4200310_AcmePostEditLine(lpBhvrCom, lpVoid, lpDS, idAcmeReturn);					/* ATI#597 */

	return idAcmeReturn;
/*===========================================================================
 * Acme Mod End
 *===========================================================================*/
}

...<end of src file>

/**************************************************************************
 *   Function:  I4200310_AcmeProcessCommitsEdit
 *
 *      Notes:  ATI#1297
 *
 *    Returns:
 *
 * Parameters:
 **************************************************************************/
static ID I4200310_AcmeProcessCommitsEdit(LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD4200310F lpDS)
{
	ID									idReturn = ER_SUCCESS;
	HUSER								hUser = (HUSER)NULL;
	D4200310_ACME_CACHE_UI11EXT	ui11Ext={0};
	BOOL								bFound=FALSE;
	DSD5642090A						dsProcCommit={0};
	CALLMAP							cmProcSoMbfCommit[] = {{IDERRmnQtyOrdered_52, IDERRERRMAP_mnQuantityOrdered_8}};	/* ATI#1653 */


	/********** Get User Handle **********/
	if( (idReturn = acmeInitBhvr(lpBhvrCom, lpVoid, &hUser, (JCHAR *)NULL, JDEDB_COMMIT_AUTO)) != ER_SUCCESS )
		goto FunctionCleanUp;


	/********* Get Extenstion Cache Record **********/
	if(!acmeIsMathZero(&lpDS->mnCMLineNo))
	{
		idReturn = I4200310_AcmeCacheUI11Ext_Get(lpBhvrCom, lpVoid, hUser, 
			&lpDS->mnCMJobNo, &lpDS->mnCMLineNo, &ui11Ext, &bFound);

		if(idReturn == ER_ERROR)
			goto FunctionCleanUp;
	}


	/**** Pass ptrs to previous table records *****/
	if(bFound)
	{
		if(!ui11Ext.bPrevF4211Retrieved)
		{
			I4200310_AcmeCacheUI11Ext_RetrievePrevF4211(lpBhvrCom, lpVoid, hUser, 
				lpDS->cCMLineAction, &lpDS->mnCMJobNo, &lpDS->mnCMLineNo, 
				lpDS->szOrderCo, lpDS->szOrderType, &lpDS->mnOrderNo, &lpDS->mnLineNo);

			idReturn = I4200310_AcmeCacheUI11Ext_Get(lpBhvrCom, lpVoid, hUser, 
				&lpDS->mnCMJobNo, &lpDS->mnCMLineNo, &ui11Ext, &bFound);

			if(idReturn == ER_ERROR)
				goto FunctionCleanUp;
		}

		if(ui11Ext.bPrevF4211Retrieved)
			dsProcCommit.idPtrHndF4211 = jdeStoreDataPtr(hUser, &ui11Ext.dsPrevF4211);


		if(!ui11Ext.bPrevF554902DRetrieved && ui11Ext.bPrevF4211Retrieved)
		{
			I4200310_AcmeCacheUI11Ext_RetrievePrevF554902D(lpBhvrCom, lpVoid, hUser, &ui11Ext);
		}

		if(ui11Ext.bPrevF554902DRetrieved)
			dsProcCommit.idPtrHndF554902D = jdeStoreDataPtr(hUser, &ui11Ext.dsPrevF554902D);

		if((ui11Ext.bPrevF4211Retrieved && !dsProcCommit.idPtrHndF4211) ||
			(ui11Ext.bPrevF554902DRetrieved && !dsProcCommit.idPtrHndF554902D) )
		{
			jdeErrorSet(lpBhvrCom, lpVoid, (ID) 0, _J("4363"), (LPVOID) NULL); 
		}
	}



	/*** call so process commit ***/
	MathCopy(&dsProcCommit.mnJobnumberA,	&lpDS->mnCMJobNo);
	MathCopy(&dsProcCommit.mnLineNumberWF,	&lpDS->mnCMLineNo);
	MathCopy(&dsProcCommit.mnLineNumber,	&lpDS->mnLineNo);
	dsProcCommit.cActionCode					= lpDS->cCMLineAction;
	dsProcCommit.nCalledFrom					= E5642090_CALLEDFROM_F4211FSEDITLINE;

	idReturn = acmeCallObjectCM(AcmeProcessSOMBFCommitEditLine, lpBhvrCom, lpVoid, &dsProcCommit, cmProcSoMbfCommit);


FunctionCleanUp:

	/* free user */
	if(hUser)
		JDB_FreeBhvr(hUser);
		
	return idReturn;
}
 
Last edited:
Hello Brian ,
Good Morning. Thank You SO much for the details , this helped me to clarify lot of things.I understood ultimately P42101 calls F4211FSEndDoc ( B4200310 ) to commit F4211.

My requirement is to override the next status of a newly created sales order based on certain custom condition and for specific order types and then update few related custom/standard files.
Yes before updating the new next status , we need to validate the next status ,It must be defined as next status in order activity Rule .

Thanks
 
Hello Brian ,
My requirement is to override the next status of a newly created sales order based on certain custom condition and for specific order types and then update few related custom/standard files.

Just a suggestion, but instead of modifying Sales Order Entry (a huge undertaking, with painful consequences), perhaps you can create an alternative process that watches for new sales orders, checks to see if they match your specific conditions, and then bumps the next status appropriately.

I know that I would jump through nearly as many additional hoops as necessary before touching Sales Order Entry MBFs.
 
Thank You for your Suggestion Brandon.
Initially I had a plan to override the status outside the BSFN after the commitment is done.
Latter we had another requirement to use the same logic to override the status for EDI processed order too. so if we will do modification on
" F4211 End DOC " the EDI orders also will be taken care.


Thanks

 
Back
Top