CREATE PROCEDURE [dbo].[usp_RPM_CustomDocumentAttributes]
                @SOPNumber CHAR(50),
                @SOPType SMALLINT,
                @LineItemSeq INT,
                @ComponentSeq INT,
                @CustomerNumber CHAR(50),
                @ShiptoAddressCode CHAR(50),
                @Date DATETIME,
                @LocationCode CHAR(50),
                @CurrencyID CHAR(50)
AS
BEGIN
/*
	Initialization
*/
CREATE TABLE #TempTable (
    NameCol VARCHAR(255) PRIMARY KEY,
    ValueCol VARCHAR(255)
);

/*
SELECT @CustomerNumber = CUSTNMBR, @AddressCode = PRSTADCD
  FROM SOP10100 HD
 WHERE HD.SOPTYPE = @SOPType AND HD.SOPNUMBE = @SOPNumber;

SELECT * FROM SOP10200 LN
 WHERE LN.SOPTYPE = @SOPType AND LN.SOPNUMBE = @SOPNumber AND LN.LNITMSEQ = @LineItemSeq AND LN.CMPNTSEQ = @ComponentSeq;
*/

/*
 *---------------------------------------------------------
 *
 *	User customizations should be added below this block
 * 
 *	Ex:
 *	INSERT INTO #TempTable (NameCol, ValueCol)
 *	   SELECT 'Doc Attribute Name', SomeColumnName
 *	     FROM dbo.RM00101
 *	    WHERE CUSTNMBR = @InputValue1
 *---------------------------------------------------------
*/


/*
 *---------------------------------------------------------
 *
 *	Return results and clean up
 * 
 *---------------------------------------------------------
*/
SELECT * FROM #TempTable
DROP TABLE #TempTable
END

