Skip to Content
0
Jan 05, 2017 at 11:43 PM

SL Question BPC 10,1 for NW

149 Views

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.