Skip to Content

Question: How to use Dim Property in Script Logic?

Hello Experts,

I have a script logic where I need to use a Dimension Value. My dimensions are:

Category, OP_SUPUESTOS, ZRELACIONCTACEBE, ZSTAGL, CUENTAS, PERIODO, BUILDING WICH ARE STATICS.

In addition I have Sociedad, Ceco, Cebe, Supnom, Moneda

The object of the script is to write values from Company Code (Sociedad ) 1010, to 1050, 1051 or 1052, depending a Value. Also the account changes between Company code 1010 to the 1050's CC.

I have almost all the code, just one detail:

With the next piece of code I get an error in TCODE UJKT:

*FOR %T% = 01.%YR%, 02.%YR%, 03.%YR%, 04.%YR%, 05.%YR%, 06.%YR%, 07.%YR%, 08.%YR%, 09.%YR%, 10.%YR%, 11.%YR%, 12.%YR%
											*FOR %NOM% = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PRAS, PVAC, SAR0, INFO
									*REC(EXPRESSION=%VALUE%==1050.00? ([SUPNOM].[%NOM%],[PERIODO].[12.2017]):0,CEBE = CECO.C1050, MONEDA = MXN, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = ([SUPNOM].[%NOM%]).[CUENTA]), PERIODO = %T%)
									*REC(EXPRESSION=%VALUE%==1051.00? ([SUPNOM].[%NOM%],[PERIODO].[12.%YR%]):0,CEBE = CECO.C1051, MONEDA = MXN, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = ([SUPNOM].[%NOM%]).[CUENTA]), PERIODO = %T%)
									*REC(EXPRESSION=%VALUE%==1052.00? ([SUPNOM].[%NOM%],[PERIODO].[12.%YR%]):0,CEBE = CECO.C1052, MONEDA = MXN, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = ([SUPNOM].[%NOM%]).[CUENTA]), PERIODO = %T%)
											*NEXT
											*NEXT


the instruction to rec in ([SUPNOM].[%NOM%]).CUENTA is not recognized by the sys.

my dimension SUPNOM HAS A VARIABLE %NOM% , this is TO CHANGE ACCORDING TO THE LIST. (in code).

CUENTA is a property of dimension supnom, but when i run the script in ujkt it seems that doesn't get the SUPNOM Property:

Here is a screenshot of Dimensioin SUPNOM:

I have tried different sintaxis without success:

([SUPNOM].[%NOM%]).CUENTA

([SUPNOM].[%NOM%]).[CUENTA]

AND OTHER COMBINATIONS.

What am I doing wrong in the sintaxis??

Thanks for the posts.

Regards.

supnom.png (23.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 21, 2017 at 06:46 PM

    Where do you read about the syntax like:

    ([SUPNOM].[%NOM%]).CUENTA???

    The only supported syntax is:

    SUPNOM.CUENTA

    It will use the current value of SUPNOM in the current record and will get the property value.

    In general the script is incorrect, but you need to clearly specify the calculation logic to get some help!

    Add comment
    10|10000 characters needed characters exceeded

    • The same code in more readable form:

      //Selección de año
      *SELECT(%YRS%, YEAR,"PERIODO", ID = %PERIODO_SET%)
      *SELECT(%MNTH12%, ID,"PERIODO",YEAR= %YRS% AND PERIOD = DEC)
      *SELECT(%YR%,YEAR, "PERIODO", ID = %MNTH12%)
      //Limitar SOCIEDAD Y CECOS
      *SELECT(%SOCIEDAD%, ID ,SOCIEDAD, ID =1010, 1020, 1030 )
      *SELECT(%CECOS%, ID ,CECO, COMP_CODE =%SOCIEDAD% AND CNOM= "H")
      *SELECT(%NOMS%,ID, SUPNOM, ID = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PREMIO A, PVAC, SAR0, INFO, INGR, INCENTIVO FI, AYUDA R, VALES GAS)
      *SELECT(%NOMS1%,ID, SUPNOM, ID = GRATIF, COMS, CEXT, IMSS, INOM, DFES, TEXT)
      
      *XDIM_MEMBERSET CATEGORIA = Presupuesto
      *XDIM_MEMBERSET OP_SUPUESTOS = NA_SUP
      *XDIM_MEMBERSET ZRELACIONCTACEBE = NA_ZREL
      *XDIM_MEMBERSET ZSTAGL = NA_ES
      *XDIM_MEMBERSET CUENTAS = 0000611010
      *XDIM_MEMBERSET HOTEL= %HOTEL_SET%
      *XDIM_MEMBERSET PERIODO=%PERIODO_SET%
      *XDIM_MEMBERSET SOCIEDAD=%SOCIEDAD%
      *XDIM_MEMBERSET CECO=%CECOS%
      
      // SUPUESTOS DE NÓMINA CON MONEDA NA Y ESTÁN SOLAMENTE EN EL MES DE DICIEMBRE
      *WHEN SUPNOM
      *IS %NOMS%
          *WHEN PERIODO 
          *IS 12.%YR%
              *WHEN MONEDA
              *IS NA_MONEDA
                  *FOR %T%= 01.%YR%, 02.%YR%, 03.%YR%, 04.%YR%, 05.%YR%, 06.%YR%, 07.%YR%, 08.%YR%, 09.%YR%, 10.%YR%, 11.%YR%, 12.%YR%
                      *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1050.00? %VALUE%:0,CEBE = CECO.C1050, MONEDA = MXN, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
                      *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1051, MONEDA = MXN, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
                      *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1052, MONEDA = MXN, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
                  *NEXT
              *ENDWHEN    
          *ENDWHEN
      *IS %NOMS1%
              *WHEN MONEDA //Supuestos en todos los meses con moneda MXN
              *IS MXN
                      *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1050.00? %VALUE%:0,CEBE = CECO.C1050, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
                      *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1051.00? %VALUE%:0,CEBE = CECO.C1051, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
                      *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1052.00? %VALUE%:0,CEBE = CECO.C1052, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
              *ENDWHEN
      *ENDWHEN