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

Reading an attribute value from master data

Former Member
0 Likes
1,071

Dear all,

My aggregation level is as follows:

city1 - city2 - price - km - planned price

also i have created a characteristic as distance id., which has attributes

Distance id: city1 - city2 - km.

so in my planing template, when i enter city1 and city2 i need to get km from master data.

How can i do that with planning functions? Is there any other suitable way to configure that?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Did you try to use ATRV function? That will read attribute values of a characteristic.

Raga

Former Member
0 Likes

Hi,

if ATRV does not help you, which I can think it will, you can also call a short and simple function module. You hand over city1 and city2, you return the km.

Regards,

Andreas

Answers (7)

Answers (7)

Former Member
0 Likes

Thanks, my client does not want to have distance anymore, it is sorted.

Former Member
0 Likes

Now it works without error, however does not return any value.

Thanks

Former Member
0 Likes

Dear Shafi,

i have defined my function module as follows:

DATA L_BAS_IST TYPE STRING .

DATA L_BIT_IST TYPE STRING .

DATA L_KM TYPE F .

CALL FUNCTION ZHVL_YBS_KM

EXPORTING

IV_BAS_IST = L_BAS_IST

IV_BIT_IST = L_BIT_IST

IMPORTING

IV_KM = L_KM .

My problem is to pass my variable L_KM to key figure ZKM. how can i pass these value to that kf?

Is there any way to debug that process?

Thanks..

jmq

Former Member
0 Likes

There are no values in variables L_BAS_IST & L_BIT_IST? How are you getting them? Without values how will the function module return any value?

To debug the FOX add BREAK-POINT as first statmenet after data declaration.

Former Member
0 Likes

HI John,

DATA L_BAS_IST TYPE CITY1 .

DATA L_BIT_IST TYPE CITY2 .

DATA L_KM TYPE F .

L_BAS_IST = OBJV().

L_BIT_IST = OBJV().

CALL FUNCTION ZHVL_YBS_KM

EXPORTING

IV_BAS_IST = L_BAS_IST

IV_BIT_IST = L_BIT_IST

IMPORTING

IV_KM = L_KM .

{L_BAS_IST,L_BIT_IST,KF} = {L_BAS_IST,L_BIT_IST,L_KM}.

this will solve your issue i guess.

Also make sure the customer exit works fine by debugging it seperately.

Regards.

Shafi.

Former Member
0 Likes

Thanks shafi,

that sounds ok to me, how can i call function module from planning function? Is it from fox formula part?

Thanks

Former Member
Former Member
0 Likes

Hi John,

You can call a Function Module from Fox as follows :

First make an entry for the function module in RSPLF_FDIR table.

then use the following snippet in the fox code.

CALL FUNCTION MYFUNMODULE

EXPORTING

parameter 1 = local variable 1

parameter 2 = local variable 2

......

IMPORTING

E_T_RANGE = local variable 3.

In the code the parameter 1, 2 .. are the parameters that u define in the function module, so that you can pass to and from the function module using import and export statements.

Regards.

Shafi.

Former Member
0 Likes

Hi ,

create a customer exit variable based on km.

write a customer exit that has city 1 and 2 as its import paramenters and km as export parameter.

inside the customer exit read distance id master data table with city 1 and city 2 and get km.

pass it to the export table.

in the planning function call this function module and pass the city values to it. using a local variable retrieve the km.

regards.

Shafi

Former Member
0 Likes

and please tell me what is atrv function?

is it one of the planning function type?

such as copy, revaluation etc?

Thanks,

jmq

Former Member
0 Likes

hi,

just to let you know,

distance id is not in my aggregation level, therefore i cannot use that as a planning function. can i use that in my function module?

Thanks.

Former Member
0 Likes

Planning function has to be built in another aggregation level which includes distance id then you can populate this using ATRV in FOX or reading master data table in function module (exit). Let the query be in already created aggregation level.

Former Member
0 Likes

Planning function has to be built in another aggregation level which includes distance id then you can populate this using ATRV in FOX or reading master data table in function module (exit). Let the query be in already created aggregation level.