Message type: E = Error
Message class:  SD_FREE_GOODS_MSG - Message class for Free Goods maintenance 
Message number: 004
Message text: Variable size key is required.
Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of messages in the SAP system have a message text, however this is frequently insufficient to comprehend or resolve the problem.
To make things easier, more detailed information is frequently added to describe the issue, how to fix it, and the necessary steps or configuration modifications.
Unfortunately, there isn't any extra information in this error notice.
First, use our AnswerBot below to get a possible cause and solution (requires a premium subscription).
Also, review the in-depth Common Questions & Answers listed below; you could discover a solution there or be able to connect with others who have faced similar challenges.
You can also try searching the SAP support portal (support.sap.com) but you need a special user ID to access it. It is possible that an SAP support note exists that provides additional details about the mistake or even steps for fixing it.
The SAP error message SD_FREE_GOODS_MSG004 with the description "Variable size key is required" typically occurs in the context of free goods processing in the Sales and Distribution (SD) module. This error indicates that the system is expecting a variable size key for the free goods calculation, but it is not provided or is incorrectly configured.
Cause: Missing Configuration: The free goods determination procedure may not be properly configured in the system. This includes missing or incorrect settings in the condition records for free goods. Incorrect Condition Type: The condition type used for free goods may not be set up to handle variable size keys. Data Inconsistencies: There may be inconsistencies in the master data or transaction data that prevent the system from determining the correct free goods. Missing Key Fields: The required key fields for the free goods calculation might not be filled in the sales document.
Solution: Check Free Goods Configuration: Go to the configuration settings for
 Get instant SAP help. Sign up for our Free Essentials Plan.
Get instant SAP help. Sign up for our Free Essentials Plan. 
SD_FREE_GOODS_MSG003 Free goods type is required.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
SD_FREE_GOODS_MSG002 Condition table is required.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
SD_FREE_GOODS_MSG005 Condition validity end date is required.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
SD_FREE_GOODS_MSG006 Condition validity start date is required.
Self-Explanatory Message Since SAP believes that this specific error message is 'self-explanatory,' no more information has been given.The majority of...
Click on this link to search all SAP messages.