on 10-06-2017 11:53 PM
Hello All,
I am trying to use SAPSetFormat using a HierarchyNode to create a Design Rule that styles the data of top node.
Below code is not working.
lResult7 = Application.Run("SAPSetFormat", "Style7", "DS_1", "Good", "HierarchyNode", "ZPROFCTR", "SW_PCA", "SW100")
lResult8 = Application.Run("SAPSetFormat", "Style8", "DS_1", "Good", "TUPLE", "HierarchyNode;ZPROFCTR;SW_PCA;SW100")
My hierarchy is on ZProfCtr where parent node is SW_PCA and SW100 is Profitcenter
Please help.
Regards,
MLPN
I figured it out.
The following SAPSetFormat syntax can be used for a hierarchy text node:
Dim sResult As String
sResult = Application.Run("SAPSetFormat", , "DS_1", "SAPExceptionLevel5", "HIERARCHYNODE", "/ERP/GL_ACCT;Z410111100;Text Node")
I figured out it is all much easier than I thought:
Just create Excel styles with the naming convention SAPHierarchyCell0 - SAPHierarchyCell7.
When they exist, they are automatically used by AfO! It can't be easier 🙂
Be aware:
To my understanding (I might be wrong):
If you just want an alternating hierarchy row style: Make sure no Excel styles exist in your style set with the naming convention SAPHierarchyCell0 - SAPHierarchyCell7 (delete them if they exist) and create hierarchy styles SAPHierarchyCell and SAPHierarchyCellOdd, just with Excel style functionality.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
What is the SAPSetFormat syntax for a hierarchy text node?
I tried the following with no success:
Dim lResult As Variant
lResult = Application.Run("SAPSetFormat", "Format_14", "DS_1", "SAPExceptionLevel5","HIERARCHYNODE", "/ERP/GL_ACCT;Z410111100;0HIER_NODE")
Debugging SAPListOfDesignRules gives me:
HierarchyNode(/ERP/GL_ACCT;+Z410111100(Text Node)) + Dimension(/ERP/GL_ACCT)
Dim lResult As Variant
lResult = Application.Run("SAPListOfDesignRules", "DS_1", "Format")
However, copying the exact string does not work either.
Help is much appreciated.
Regards,
Bart.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a hierarchy on product group (0D_NW_PRDGP) like on the screenshot below, the product category (0D_NW_PRDCT) T is a hierarchy node.
use the following makro to format it in the crosstab:
Sub SetFormat()
Dim sResult As String
sResult = Application.Run("SAPSetFormat", "Format1", "DS_1", "SAPExceptionLevel5", "HIERARCHYNODE", "0D_NW_PRDGP;T;0D_NW_PRDCT")
End Sub
It is helpful to set the format manually and then debug it with SAPListOfDesignRules to check the parameters used.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.