cancel
Showing results for 
Search instead for 
Did you mean: 

Multiply or Add Characteristic Values.

Former Member
0 Kudos

Dear All

I want to multiply two characteristic values, Length and Breadth to get Square Inches.

I have used a procedure as below.

$SET_DEFAULT($SELF,SQUARE_INCHES,($SELF.Length$SELF.Breadth)), but I am getting Syntax error as below.

E28013 Error in parentheses: "(" without ")" to close

E28024 Syntax error in simple action/procedure

Can somebody help me in this.

Also, I need to add two characteristic values. You can take the example of the above and help me in writing syntax for adding also.

Thanks and Regards

Adithya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Amber,

Your links have been very helpful. However, I tried changing the procedure as per your link as below.

$SET_DEFAULT ($SELF, SQUARE_INCHES, ($SELF.LENGTH * $SELF.BREADTH)), but still I am getting the same error with below error details. I am not able to rectify my syntax with the below  error diagnosis.

Can you please help me out in this.

Diagnosis

The syntax check found errors in the condition. Please note that, as a rule, keys (names of characteristics, classes, tables, and functions) containing hyphens can only be used in dependencies if preceded with the expression SKEY and entered in quote marks, for example:

                   SKEY 'EXT-COLOR'

Also, changes to master data that are made in parallel to object dependency maintenance are not always recognized due to buffering of data.

System Response

The cursor marks the place where the error occurs. You may have a list of detailed causes of errors to choose from.

Procedure

Check your entry and correct the error. You have the following options for analyzing and correcting the error:

  • If you cannot see immediately what is wrong, choose Details to see a detailed message. The cursor marks the error in your source code and, if required, you can also look at the long text of the detailed message for further information. If the detailed message does not apply to your error, you can repeat this check function, selecting a different detailed message.
  • If changes to master data that are made in parallel to object dependency maintenance are not recognized, start the maintenance function again.
  • For actions or procedures, check whether the object variable $SELF is entered for characteristics whose values you want to infer
  • You can still save your dependency if the syntax is incorrect. The status of the dependency is then set to locked, and the dependency cannot be used in configuration.

Regards

Adithya

Former Member
0 Kudos

Hello Adithya,

As Markus said , it seems that you are using character type. I was able to create characteristics with numeric without any syntax error.

$SET_DEFAULT ($SELF, AN_SQUARE, ($SELF.AN_LENGTH * $SELF.AN_WIDTH)).

Do you have the comma in the end ? as that can raise a syntax error. The one you mentioned above has comma ?

$SET_DEFAULT ($SELF, SQUARE_INCHES, ($SELF.LENGTH * $SELF.BREADTH)),

Please remove and confirm if all are numeric characteristics.

Thanks

Amber

Former Member
0 Kudos

Hi Amber

As Markus had mentioned, the problem was with the Datatype. I deleted the assignments and changed the datatype to Numeric. Now it is working completely fine.

However, I am not able to give decimal places, for example; 6 can be given but not 6.375.

It is giving the below error. I am not able to change the template also.

Value "6.5" is incompatible with template "___,___,___,___,___"

Message no. C4002

Diagnosis

The value you entered does not correspond to the template defined for the characteristic format.

Procedure

Correct the value according to the template shown in the error message. For further information, press F1 to refer to the online help.

Kindly require your valuable inputs on this.

Thanks and Regards

Adithya

markus_deuter
Active Participant
0 Kudos

Former Member
0 Kudos

Thanks Markus

I was not aware of this and will try this tomorrow and let you know of the result.

Regards

Adithya

Former Member
0 Kudos

Sincere thanks to both Markus and Amber for sharing this piece of a feature of SAP.

Now I am using a 15, 3 template and the result is perfect.

Regards

Adithya

Answers (2)

Answers (2)

markus_deuter
Active Participant
0 Kudos

Perhaps u fail because your characteristics are type of character ?

Why not using transaction CU65/66/67 to create a function module ZCL_GET_AREA for this.

Then you can call the function module like this in the editor of object dependencies:

000010 FUNCTION ZCL_GET_AREA

000020 (LENGTH = $SELF.LENGTH,

000030 WIDTH = $SELF.WIDTH,

000040 AREA = $SELF.AREA)

Respect the definition of import/export of data for the function module to get a result.

So you can also fix unit correction, if WIDTH is like inch an LENGTH is given in milimeters.

Greetings from Germany

Markus

Former Member
0 Kudos

Hello Adithya,

Please create a procedure per the example in the following link.

http://help.sap.com/saphelp_47x200/helpdata/EN/92/58c2eb417011d189ec0000e81ddfac/content.htm

I dont see any multiple or add in the syntax. Also please review the following

http://help.sap.com/saphelp_47x200/helpdata/EN/0f/9b58b3752611d183670000e8a49aad/content.htm

Thanks

Amber