cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Logic script for copy Plan item from one version to another..

Former Member
0 Likes
177

Hi All,

I am trying to copy the plants based sale for planning into
a dummy plant, using a logic script as below,
Please find code below; Suggest the changes to get this execute.

*XDIM_MEMBERSET CATEGORY = 010

*XDIM_MEMBERSET ACCOUNT = ZNETQT_B

*XDIM_MEMBERSET INPUTCURRENCY = INR

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET PLAN_ITEM = 001

// *XDIM_MEMBERSET PLANT = %PLANT_SET%

//*XDIM_MEMBERSET PLANT = NATIONAL

*SELECT(%ACCSET%,"[ID]",PLANT,"[CALC]
= 'N'")

*XDIM_MEMBERSET PLANT
= %ACCSET%

*FOR %Q% =  PLANT

*WHEN PLAN_ITEM

                                *IS
001                 

*WHEN PLANT

       *IS *

                                *REC(FACTOR
= 1, PLANT = “NATIONAL”)

               

                *ENDWHEN       

                

*ENDWHEN

*NEXT

*COMMIT

Accepted Solutions (1)

Accepted Solutions (1)

Ankur_Jain1m8
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Manish,

What I understood from your reuirement is that you need to copy the data from all plants to a DUMMY plant.

I don't see a need of FOR loop in your script logic.

Please remove *FOR and *NEXT line from the code and try to run it.

Regards,

Ankur

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Likes

Hi Manish,

Please explain the calculation logic:

*SELECT(%ACCSET%,"[ID]",PLANT,"[CALC]= 'N'")

will select all base PLANT's, including NATIONAL!

*REC(FACTOR= 1, PLANT = “NATIONAL”)???

If you want to copy all plants except NATIONAL to NATIONAL then:

*SELECT(%ACCSET%,"[ID]",PLANT,"[CALC]='N' AND [ID]<>'NATIONAL'")

*XDIM_MEMBERSET CATEGORY = 010

*XDIM_MEMBERSET ACCOUNT = ZNETQT_B

*XDIM_MEMBERSET INPUTCURRENCY = INR

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET PLAN_ITEM = 001

*XDIM_MEMBERSET PLANT= %ACCSET%

*WHEN PLANT

*IS *

*REC(FACTOR=1, PLANT=“NATIONAL”)

*ENDWHEN     

Vadim

P.S. I have removed useless FOR/NEXT loop,  useless PLAN_ITEM loop and absolutely useless COMMIT