Skip to Content
0

FMS for sales order

Mar 16, 2017 at 01:49 PM

61

avatar image
Former Member

Hi all,

We placed FMS on all sales documents for picking warehouse based on the user ID. As we got to know the problem with sales order document it is only for non approved Sales Order instead of approved Sales Order.

we have two scenario of creating sales order,

1. sales order created by HO users.

2. Non HO users

If we open non approved sales order under the Non-HO user it is by default taking the warehouse based on user ID instead of HO user ID and vice versa.

Issue: Sales order opening in update mode if the warehouse for logged in user and warehouse for document mismatches.

The below FMS Query;

DECLARE @USR VARCHAR(100);

DECLARE @DFLT VARCHAR(100);

DECLARE @WHS VARCHAR (100);

SELECT @USR= (SELECT DFLTSGROUP FROM OUSR WHERE USERID=$[USER]); SELECT @DFLT= (SELECT DFLTWH FROM OITM WHERE ITEMCODE=$[RDR1.ITEMCODE]) ;

SELECT @WHS = (SELECT U_WHSCODE FROM [@WHS_MASTER] WHERE U_ITEMCODE=$[RDR1.ITEMCODE]);

IF @USR='HO'

BEGIN

IF @WHS<>''

BEGIN

SELECT U_WHSCODE FROM [@WHS_MASTER] WHERE U_ITEMCODE=$[RDR1.ITEMCODE]

END

ELSE IF (@DFLT<>'')

BEGIN

SELECT DFLTWH FROM OITM WHERE ITEMCODE=$[RDR1.ITEMCODE] ;

END

ELSE

BEGIN

SELECT D.[WAREHOUSE] FROM OUSR C LEFT OUTER JOIN OUDG D ON D.CODE=C.DFLTSGROUP WHERE C.USERID=$[USER];

END

END

ELSE

BEGIN

SELECT D.[WAREHOUSE] FROM OUSR C LEFT OUTER JOIN OUDG D ON D.CODE=C.DFLTSGROUP WHERE C.USERID=$[USER];

END

Is it possible to use FMS thru document mode (ADD,Update) If so please send me the query.

Thanks in advance.

Regards,

Anand

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers