$PBExportHeader$f_get_sccode.srf
global type f_get_sccode from function_object
end type

forward prototypes
global function integer f_get_sccode (long arg_scid, transaction arg_transaction, ref string arg_sccode, ref string arg_msg)
end prototypes

global function integer f_get_sccode (long arg_scid, transaction arg_transaction, ref string arg_sccode, ref string arg_msg);//====================================================================
// Function: f_get_sccode(arg_scid,arg_transaction,arg_sccode,arg_msg)
//--------------------------------------------------------------------
// Description: 取分部代号
//--------------------------------------------------------------------
// Arguments: 
//		value    	long       	arg_scid       		
//		value    	transaction	arg_transaction		
//		reference	string     	arg_sccode     		
//		reference	string     	arg_msg        		
//--------------------------------------------------------------------
// Returns:  integer
//--------------------------------------------------------------------
// Author:	yyx		Date: 2003.11.12
//--------------------------------------------------------------------
// Modify History: 
//	
//====================================================================
SELECT sccode
	INTO :arg_sccode
	FROM u_scdef
	Where scid = :arg_scid USING arg_transaction;
	
IF arg_transaction.SQLCode <> 0 THEN
	arg_msg = '取分部代号失败>>'+arg_transaction.SQLErrText
	RETURN 0
END IF

RETURN 1

end function

