cancel
Showing results for 
Search instead for 
Did you mean: 

help for an FMS

vasileiosfasolis
Active Contributor
0 Kudos

Hello to all

i am interested for a help in an FMS

a customer has created a groupcode in bp master data with code 116

i have created an fms which is used for feeling the Accounts Receivable field automatically.

the FMS created byme is the following

SELECT code FROM dbo.[@MAP_OCRD] WHERE CODE=$[OCRD.GROUPCODE]

i have created the above table with info Code and Name

Code is the same code with groupcode from ocrd table

and Name is the GL Account

the new groupcode will have a new code value but wants to have the same gl account with an othwer code from the above table

for example

10030.00.00.0000
10330.01.00.0000
10430.01.02.0000
10150.00.00.0000
10650.01.01.0000
11630.00.00.0000

i tried to use the same fms but while adding the value 30.00.00.0000 in the above table it is not alloed

do you have any idea how to manage it?

i also tried this

DECLARE @GLACCOUNT NVARCHAR(50)

DECLARE @GROUPCODE1 NVARCHAR(20)

SET @GLACCOUNT='30.00.00.0000'

SET @GROUPCODE1=(SELECT GROUPCODE FROM OCRD WHERE CARDCODE=$[OINV.CARDCODE])

IF (@GROUPCODE1='100')

BEGIN

SELECT code FROM dbo.[@MAP_OCRD] WHERE CODE=$[OCRD.GROUPCODE]

END

ELSE

BEGIN

SELECT @GLACCOUNT

END

but it does not work

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

Try this:

SELECT t.Name FROM dbo.[@MAP_OCRD] t WHERE t.CODE=$[OCRD.GROUPCODE]

vasileiosfasolis
Active Contributor
0 Kudos

Hi Istvan!

the problem is i cannot add new code on @MAP_OCRD with the same value in Name

my fms is working perfect.

i try to add one more line in the above table with values 116 30.00.00.0000

the value 30.00.00.0000 already exists and i cannot add it

Former Member
0 Kudos

Hi Vasileios

The CODE and NAME fields in SAP must both be unique, with other words the name cannot be repeated. My suggestion is to add another User Defined Field to your @MAP_OCRD table and call it GLAcc for example. In the Code and Name columns, add the customer group code. So 116 in Code and 116 in Name fields, then the 30.00.00.0000 in the U_GLAcc field. Change your query to return [U_GLAcc] and it will work.

Kind regards

Peter Juby

vasileiosfasolis
Active Contributor
0 Kudos

Peter

the table is used. is it possible to modifie it now?or it will make any incostistency in data if it is modified?

Former Member
0 Kudos

Hi Vasileios

When you say used, I assume you are referring to it already being populated? Has it been linked to any other functions other than the filling of the Accounts Receivable/ Payable account? If not, then it should be safe to make the changes.

Add the user defined field first, then edit the table values and copy the Name values to the U_GLAcc field before copying the Code field over the Name field.

Kind regards

Peter Juby

vasileiosfasolis
Active Contributor
0 Kudos

Peter

it works perfect!

thanks a lot sir!

Former Member
0 Kudos

Hi Vasileios

Only a pleasure!

Kind regards

Peter Juby

Answers (0)