Skip to Content

SL Question BPC 10,1 for NW

Hello Experts.

I am developing a script logic to copy data from one company to another. but I have some problems with the Logic.

The requirement is the next:

Company A has payroll but company B pays for it. I already have payroll Planned in company A so I need to move it to company B to Differents Company Code, Profit Ctr, Cost Ctr, Hotel Here is my Code:

//Scope 

*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 PERIODO= %PERIODO_SET% 

//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%'")

// SUPUESTOS DE NÓMINA CON MONEDA NA Y ESTÁN SOLAMENTE EN EL MES DE DICIEMBRE 


// Some of  SUPNOM (Benefits) are just in december, and doens't have currency so the user have to capture just once and I have to tranlate them to the other company in MXN. 


*WHEN MONEDA
  *IS NA_MONEDA
    *WHEN OP_RRHH
      *IS <>NA_RH
        *WHEN SOCIEDAD
         *IS 1040
          *WHEN HOTEL
            *IS "0000001040"
             *WHEN SUPNOM
              *IS CIAA
               *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

//Profitctr CEBE and CostCenter Ceco composition is for source 001040(company) + employee and for target in this case is 000504(companyB + last 2 of company A 40 in this case but since PUesto already has the 0 I skip it since it comes with CECP property ZL4CECO.

//
*SELECT (%CTA%, CUENTA, SUPNOM, [ID]=%NOM%)
*SELECT (%PUESTOS%, ZL4CECO, CECO,COMP_CODE=1040)
*FOR %PUESTO%=%PUESTOS%
*REC(EXPRESSION=%VALUE%==1050? ([SUPNOM].[%NOM%],[PERIODO].[12.%YR%]):0,CEBE="000504"%PUESTO%, MONEDA=MXN, CECO= "000504"%PUESTO%, HOTEL= 0000001050, SOCIEDAD= 1050, SUPNOM=NA_SUPRH, CUENTAS= %CTA%, PERIODO=%T%, CATEGORIA=Presupuesto)
*NEXT
 *NEXT
*NEXT
 *ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN 


//This SUPNOM are capture by month in currency MXN

*WHEN MONEDA
*IS MXN
*WHEN OP_RRHH
*IS <>NA_RH
*WHEN SOCIEDAD
*IS 1040
*WHEN HOTEL
*IS 0000001040
*WHEN SUPNOM
*IS CIAA
*FOR %NOM1% = GRATIF, COMS, CEXT, IMSS, INOM, DFES, TEXT
*SELECT (%CTA1%, CUENTA, SUPNOM, ID=%NOM1%)
*SELECT (%PUESTOS1%, ZL4CECO, CECO, COMP_CODE=1040)
*FOR %PUESTO1%= %PUESTOS1%
*REC(EXPRESSION=%VALUE%==1050? ([SUPNOM].[%NOM1%]):0, CEBE="000504"%PUESTO1%, CECO= "000504"%PUESTO1%, HOTEL= 0000001050, SOCIEDAD= 1050, SUPNOM=NA_SUPRH, CUENTAS= %CTA1%, CATEGORIA=Presupuesto)
*NEXT
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN

I run this script in TCODE ujkt and I get the error that "Component "" does not exist.

Any ideas.

Best regards. 
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 06, 2017 at 04:59 PM

    Also I see the main issue: You can't use SELECT inside FOR/NEXT - SELECT is executed only once!

    Add comment
    10|10000 characters needed characters exceeded

    • Still not 100% clear:

      "captured by the user on memer Company. (user capture 50, 51 or 52 depending on the employee. )" what member? what dimension?

      In general the required logic can be implemented in custom logic badi, not sure that script logic can do the job.

  • Jan 06, 2017 at 04:57 PM

    Concatenation:

    Not:

    CEBE="000504"%PUESTO1%,...

    But:

    CEBE=000504%PUESTO1%,...
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 06, 2017 at 07:41 AM

    Hi Sebastian,

    Unfortunately this question is from category: "Do my job instead of me"

    You have to simplify the script to some test case...

    Add comment
    10|10000 characters needed characters exceeded

    • Thank you again, I was doing more testing and I have 2 issues.

      1. My question is how to concatenate properties to with a prefix to a Dimension. I have search that in the forum but is not answered. I have the next piece of code, but is not lettingme do the concatenation:

      *SELECT (%PUESTOS1%, ZL4CECO, CECO, COMP_CODE=1040) // This selects last 4 digits of CostCenter when the company Code is the Source (1040). ZL4CECO is the ID of the property that cotains that last 4 Digits.
      
      
      *FOR %PUESTO1%= %PUESTOS1% // Since I have a bunch of las 4 digits I am using a loop to make it one by one the selection.
      
      
      *REC(EXPRESSION=%VALUE%==1050? ([SUPNOM].[%NOM1%]):0, CEBE="000504"%PUESTO1%, CECO= "000504"%PUESTO1%, HOTEL= 0000001050, SOCIEDAD= 1050, SUPNOM=NA_SUPRH, CUENTAS= %CTA1%, CATEGORIA=Presupuesto)
      //Here in the Rec I trying to  generatethe record in CEBE and CECO with the fixed text "000504"%PUESTO% Whis the value is in the select one by one. I have tried: "000504"%PUESTO%, 000504%PUESTO%, 000504&%PUESTO% but it doesn't work.

      2. I have another Select to select a property called CUENTA (Account) that is a real GL Account where the Benefit is supoused to store:

      I checked that all dimensions Members in Dimension SuPnom has the property CUENTA with a value. I have the next piece of code:

      *FOR %NOM1% = GRATIF, COMS, CEXT, IMSS, INOM, DFES, TEXT
      *SELECT (%CTA1%, CUENTA, SUPNOM, ID=%NOM1%)

      then in the *REC i have:

      *FOR %NOM% = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PRAS, PVAC, SAR0, INFO
      *SELECT (%CTA%, CUENTA, SUPNOM, ID=%NOM%)
      *SELECT (%PUESTO%, ZL4CECO, CECO, COMP_CODE=1040)
      *FOR %PUESTO%= %PUESTOS%
      *REC(EXPRESSION=%VALUE%==1050? ([SUPNOM].[%NOM%],[PERIODO].[12.%YR%]):0,CEBE=000504%PUESTO% MONEDA=MXN, CECO= 000504%PUESTO%, HOTEL= 0000001050, SOCIEDAD= 1050, SUPNOM=NA_SUPRH, CUENTAS= %CTA%, PERIODO=%T%)

      If you see in the Dimension CUENTAS=%CTA% my intention is to store the property value of SUPNOM for the Dimensions member that are in the for.

      I discovered by setting fixed CECO and CEBE that the error that the component "" does not exist was for the account. Seems that is not taking any value.

      By setting the account fixed I found out issue 1. Where it doens't let me concatenate the fixed value and with the variable %PUESTO%.

      Is something wrong in the select for %CTA%? is there a way to concatenate that variable with the fixed value?

      Best regards.