cancel
Showing results for 
Search instead for 
Did you mean: 

LOOKUP statement in Script logic

Former Member
0 Kudos

Hi All,

I had a requirement to use a lookup value as ID to post the value in that particular member.

So i looked up the transaction data like 3 and used that in TMVL function TMVL(LOOKUP(ABC), 2012.DEC) to store that value in a particular month.

Validation is successful but while running the logic it throws error since looked up value is not considered as an integer.

My Logic will look like below,

LOOKUP

...

ABC

ENDLOOKUP

*WHEN ACCOUNT

*IS A1000

*REC(EXPRESSION=[ACCOUNT].[A2000],TIME=TMVL(LOOKUP(ABC),2012.DEC)

*ENDWHEN

Is there any work around or any other script logic statements to execute this kind of logic where we need to check the use the transaction data?

Where are we can use Lookup value?

Thanks in advance,

Ramanathan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member210696
Active Contributor
0 Kudos

I think i you use *lookup, the looked up value is probably considered as an integer only, because that's why one would be able to use the lookup instruction to fetch the currency exchange rate from RATE application and use that rate in any of the main applications.

Check if your *REC statement is correct? Should it not read as below -

*REC(EXPRESSION=%VALU%,ACCOUNT=A2000,TIME=TMVL(LOOKUP(ABC),2012.DEC))

Above instruction means that it will fetch the value of the scoped record (Account =  A1000, TIme = 2012.DEC probably) and post it to this record (Account=A2000, TIme = 2013.MAR, if ABC=3)

Not sure if this is what you want. Check if above thing works. If not, post the detail formula log of package status.

Hope it helps!!

Former Member
0 Kudos

Hi Ashish,

Thanks for the reply.

My requirement is  same as mentioned in logic,  Account A2000 value has to be copied to A1000 in that specific Time.

When i replace that Lookup(ABC) with 5. Logic works fine.

I am getting only below error. Nothing much details.

RUN_LOGIC:Invalid TMVL return value

Failed

Thanks & Regards,

Ramanathan

former_member210696
Active Contributor
0 Kudos

Hi Ramanathan,

It's the problem with the TMVL statement and not the LOOKUP instruction. At the place of offeset, you can probably use only an integer value and not a variable. I also tested this in my system, I ensured that the variable coming from LOOKUP statement is an integer, still it is giving the same error.

So, I guess, since we can't pass the variable in TMVL (my assuption based on results that I got) for offset, you will have to think of something else.

Hope it helps!!

former_member186498
Active Contributor
0 Kudos

Hi Ramanathan,

I never tried with a variabile but seeing this thread it should possible http://scn.sap.com/thread/1770921, if so you must be sure that the result of the Lookup is an integer.

Kind regards

     Roberto