Skip to Content
avatar image
-1
Former Member

SAP BPC 10.1 Problem with script logic calculation

// Определение переменных выборки
*SELECT(%AuditJournal%,[ID], AUDITID, "ENABLEJRN = 'Y'")
*SELECT(%HeadDT%,[ID], ENTITY, "DT_HEAD = 'Y'")
*SELECT(%HeadEntity%,[ID], ENTITY, "HEAD = ''")
*SELECT(%NotHeadEntity%,[ID], ENTITY, "HEAD <>''")
*SELECT(%FlowJournal%,[ID], FLOW, "ENABLEJRN = 'Y'")
*SELECT(%SELECT_ACCOUNTTAX%,[ID], ACCOUNT, DIMLIST2 <>'')
*SELECT(%SELECT_ENTITY1%,[ID], ENTITY, DTAX = 'DTAX')
// *SELECT(%AUDIT%,"[ID]",AUDITID,"DATASRC_TYPE<>'A'")


*LOOKUP Consolidation
    *DIM ACCOUNTDT:FLOW = "F_NONE"
    *DIM ACCOUNTDT:AUDITID = "UPLOAD_DATA_FORM"
    *DIM ACCOUNTDT:MATURING = "M_NONE"
    *DIM ACCOUNTDT:CURRENCY_TRANS = "C_NONE"
    *DIM ACCOUNTDT:PARTNER = "I_NONE"
    *DIM ACCOUNTDT:CONS_GROUP = "G_NONE"
    *DIM ACCOUNTDT:CURRENCY = "LC"
    *DIM ACCOUNTDT:ENTITY = "TECH_T2RU"
    *DIM ACCOUNTDT:VERSION = "%VERSION_SET%"
    *DIM ACCOUNTDT:ACCOUNT = "64006510300000"
*ENDLOOKUP




*XDIM_MEMBERSET CURRENCY_TRANS = BAS(CUR)
*XDIM_MEMBERSET PERIOD = %PERIOD_SET%
*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET CONS_GROUP = %CONS_GROUP_SET%
*XDIM_MEMBERSET AUDITID = SA_DTA_DTL transfer
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET CURRENCY = LC
*XDIM_MEMBERSET ACCOUNT = 10001410900000,10001140305000,10001310610000,23102350600000
*XDIM_MEMBERSET FLOW =%FlowJournal%
*WHEN_REF_DATA=MASTER_DATA
		*WHEN ENTITY
			*IS %NotHeadEntity%
 *WHEN CONS_GROUP 
      *IS G_NONE 
  *WHEN AUDITID
    *IS SA_DTA_DTL transfer
    *REC(FACTOR = 0, AUDITID = Z_BUFFER) 
	*REC(FACTOR = 0, AUDITID = Z_BUFFER,ENTITY=ENTITY.HEAD)
    *REC(EXPRESSION = (%VALUE%*(-1)), AUDITID = Z_BUFFER) 
  *ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT




*XDIM_MEMBERSET CURRENCY_TRANS = BAS(CUR)
*XDIM_MEMBERSET PERIOD = %PERIOD_SET%
*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET CONS_GROUP = %CONS_GROUP_SET%
*XDIM_MEMBERSET AUDITID = %AUDITID_SET%
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET CURRENCY = LC,RUB
*XDIM_MEMBERSET ACCOUNT = BAS(24002390000000),10001410900000,10001140305000,10001310610000,64006510300000
*XDIM_MEMBERSET FLOW =%FlowJournal%


// добавить развилку для G_NONE и T2RU *WHEN CONS_GROUP *IS G_NONE *ENDWHEN
  *WHEN CONS_GROUP 
      *IS G_NONE 
   *WHEN AUDITID
     *IS %AUDITID_SET%
		*WHEN ENTITY
			*IS %NotHeadEntity%
	
	
*WHEN ACCOUNT
  *IS 10001410900000,10001140305000,10001310610000,23102350600000
  *REC(FACTOR = 0)
*ENDWHEN
    
    
      *WHEN ACCOUNT
          *IS BAS(24002390000000)// что именно надо заказчику с РЕ 10001310605000 
          *WHEN ACCOUNT
              *IS <> 23102350600000 , BAS(23102350300000)
        
                *REC(EXPRESSION = (%VALUE%*(LOOKUP(ACCOUNTDT))*(-1)), ACCOUNT = 23102350600000) 
                *REC(EXPRESSION = (%VALUE%*(LOOKUP(ACCOUNTDT))), ACCOUNT = 23102350600000, AUDITID = SA_DTA_DTL transfer) 
                *REC(EXPRESSION = (%VALUE%*(LOOKUP(ACCOUNTDT))), AUDITID = SA_DTA_DTL transfer, FLOW = 220, ACCOUNT = 10001310610000)
                *REC(EXPRESSION = (%VALUE%*(1-LOOKUP(ACCOUNTDT))), FLOW = 220, ACCOUNT = 10001310610000)
                *REC(EXPRESSION = (%VALUE%>0)?(%VALUE%*(LOOKUP(ACCOUNTDT))):0,FLOW = 114,ACCOUNT = 10001140305000,MATURING = M_NONE,SEGMENT = 1202010, CURRENCY_TRANS = C_NONE,PARTNER = I_NONE)
                *REC(EXPRESSION = (%VALUE%<0)?(%VALUE%*(LOOKUP(ACCOUNTDT))):0,FLOW = 114,ACCOUNT = 10001410900000,MATURING = M_NONE,SEGMENT = 1202010, CURRENCY_TRANS = C_NONE,PARTNER = I_NONE)
                *REC(EXPRESSION = (%VALUE%>0)?(%VALUE%*(-1)*(LOOKUP(ACCOUNTDT))):0,FLOW = 114,ACCOUNT = 10001140305000,MATURING = M_NONE,AUDITID = SA_DTA_DTL transfer,SEGMENT = 1202010, CURRENCY_TRANS = C_NONE,PARTNER = I_NONE)
                *REC(EXPRESSION = (%VALUE%<0)?(%VALUE%*(-1)*(LOOKUP(ACCOUNTDT))):0,FLOW = 114,ACCOUNT = 10001410900000,MATURING = M_NONE,AUDITID = SA_DTA_DTL transfer,SEGMENT = 1202010, CURRENCY_TRANS = C_NONE,PARTNER = I_NONE)
        


      *ENDWHEN
  *ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT




*XDIM_MEMBERSET CURRENCY_TRANS = BAS(CUR)
*XDIM_MEMBERSET PERIOD = %PERIOD_SET%
*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET CONS_GROUP = %CONS_GROUP_SET%
*XDIM_MEMBERSET AUDITID = Z_BUFFER,SA_DTA_DTL transfer
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET CURRENCY = LC
*XDIM_MEMBERSET ACCOUNT = 10001410900000,10001140305000,10001310610000,23102350600000
*XDIM_MEMBERSET FLOW =%FlowJournal%


*WHEN ENTITY
	*IS %NotHeadEntity%
  *WHEN CONS_GROUP 
      *IS G_NONE 
//     *REC(EXPRESSION = (%VALUE%*(-1)), AUDITID = Z_BUFFER)
    *REC(EXPRESSION = (%VALUE%*(-1)), AUDITID = Z_BUFFER, ENTITY=ENTITY.HEAD)
*ENDWHEN
*ENDWHEN
*COMMIT


*XDIM_MEMBERSET CURRENCY_TRANS = BAS(CUR)
*XDIM_MEMBERSET PERIOD = %PERIOD_SET%
*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET CONS_GROUP = %CONS_GROUP_SET%
*XDIM_MEMBERSET AUDITID = Z_BUFFER, SA_DTA_DTL transfer
*XDIM_MEMBERSET ENTITY = %HeadDT%
*XDIM_MEMBERSET CURRENCY = LC
*XDIM_MEMBERSET ACCOUNT = 10001410900000,10001140305000,10001310610000,23102350600000
*XDIM_MEMBERSET FLOW =%FlowJournal%


  *WHEN CONS_GROUP 
      *IS G_NONE 
  *WHEN AUDITID
    *IS Z_BUFFER,SA_DTA_DTL transfer
	 *WHEN ENTITY
    *IS %HeadDT%
	
    *REC(EXPRESSION=%VALUE%, AUDITID = SA_DTA_DTL transfer)
	
  *ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT


<br>
2312312312.jpg (181.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 28, 2017 at 07:56 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 28, 2017 at 09:28 AM

    we need in first step some statement like

    *REC (EXPRESSION = (%VALUE% <>EMPTY)?(%VALUE%)) : 0

    Add comment
    10|10000 characters needed characters exceeded