Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Passing parameters to Logic script from DTS

I have problems to use a parameter in my logic file that I create using EvModifyPkg.

 PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when running logic.",1,{"Yes, check for work status settings before running logic","No, do not check work status settings"},{"1","0"})
PROMPT(TEXT,%FRWEEK%,"Select a Week to Copy from",,"")
PROMPT(TEXT,%TOWEEK%,"Select a list of Weeks to Copy to",,"")
TASK(Execute formulas,USER,%USER%)
TASK(Execute formulas,APPSET,%APPSET%)
TASK(Execute formulas,APP,%APP%)
TASK(Execute formulas,LOGICFILE,"%LOGICPATH%CopyWeeks.lgf")
TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION FRWEEK=%FRWEEK%")
TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION TOWEEK=%TOWEEK%")
TASK(Execute formulas,RUNMODE,1)
TASK(Execute formulas,LOGICMODE,1)
TASK(Execute formulas,CHECKLCK,%CHECKLCK%)

This is my DTS package code.

In my Logic file I have the following reference to %FRWEEK%

*XDIM_MEMBERSET TIMEW=%FRWEEK%

I keep getting the error Invalid member %FRWEEK%

Is there something I'm missing in my setup?

Former Member
replied

Hi Clas,

I believe this is a limitation with the TASK(Execute formulas,FORMULASCRIPT ) function where that you can only pass 1 variable from a prompt to a logic script.

I tested many variations and I wasn't able to get this working.

However I did come up with a viable and even better workaround:

In your DTSX MODIFYSCRIPT variable remove the PROMPTS and FORMULASCRIPT and add the following line:

PROMPT(COPYMOVE,%SELECTION%,TOSELECTION%,"Enter your selection",Time)
TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION TOWEEK=%TIME_TO_SET%")

Then in your logic script change it to the following:

*XDIM_MEMBERSET TIME=%TIME_SET%

*WHEN TIME
*IS *

*FOR %TM%=TOWEEK

*REC(FACTOR=1,TIME=%TM%)

*NEXT

*ENDWHEN

*COMMIT

The %TIME_TO_SET% variable isn't recognized in script logic but you can pass it as a variable within the FORMULASCRIPT task.

Give that a try,

John

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question