Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for SAP NetWeaver
Viewing all articles
Browse latest Browse all 5414

FOR usage in WHEN statements

$
0
0

Dear Experts,

 

I write to you to know if there's any restriction regarding the usage of FOR loops inside WHEN statements. I require to use two FOR loops but I'm getting an error stating "UJK_VALIDATION_EXCEPTION:Invalid when/endwhen: Line #13" (To simplify the case, Line13 equals the first line of the example below).

 

The funny thing is that the script logic works just fine with a single FOR statement, but when I add the second one (marked in red in the following example) I get the error stated above.

 

*FOR %BU% = %BUs%

 

*WHEN BUS_UNIT

*IS %BU%

 

*WHEN ACCOUNT

*IS F_DISTR1

 

*FOR %CC% = 100, 200, 300

 

*REC(FACTOR = ([ACCOUNT].[TOTAL_PL],[BUS_UNIT].[800],[COSTCENTER].[%CC%]), COSTCENTER = %BU%101, ACCOUNT = 8000101)

 

*NEXT

 

*FOR %CC% = 400, 500, 600

 

*REC(FACTOR = ([ACCOUNT].[TOTAL_PL],[BUS_UNIT].[800],[COSTCENTER].[%CC%]), COSTCENTER = %BU%202, ACCOUNT = 8000202)

 

*NEXT

 

*ENDWHEN

 

*ENDWHEN

 

*NEXT

 

*ENDWHEN

 

F_DISTR1 is a distribution driver in every destination business unit. The idea of the script is to allocate all te expenses in business unit 800 into destination BusinessUnits, CostCenters and Accounts. I get the error where the first FOR loop is stated in the example (first line).

 

Is there anything wrong with the syntax?

 

Using BPC 10.1 NW SP4

 

Thank you all for your help!

 

Best regards,

Joaquin.


Viewing all articles
Browse latest Browse all 5414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>