cancel
Showing results for 
Search instead for 
Did you mean: 

How to derive value from another variable and use it to read master data?

Former Member
0 Kudos

Hi,

I have following case:

First I need to read the value from Cost Center -variable (ZIPCC) and then I need to use that value to determine the home currency of that cost center from the cost center master data table (field: OBJ_CURR).

I know to basic idea on how to do this, but don't seem to get the syntax correct. Could someone point me in the right direction?

So the objects in play are:

ZIPCC = Cost center selection variable (mandatory, single value)

ZIPCUR = Cost Center Currency variable (customer exit, single value)

0COSTCENTER

0OBJ_CURR = Field in cost center master data

Help will be greatly appreciated!

-m

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please try this and modify based on your requirement:

D1 Like /BIC/0OBJ_CURR.

WHEN 'ZIPCUR'.

if I_STEP = 2.

loop at i_t_var_range into lt where vnam = 'ZIPCC'.

Select single OBJ_CURR into D1 from /BI0/PCOSTCENTER where COSTCENTER = i_t_var_range-low.

clear l_s_range.

l_s_range-low = D1.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

append l_s_range to e_t_range.

endloop.

endif.

Regards,

Kams

Former Member
0 Kudos

Hi,

Thank you very much for your example I can see that this logic works! However I'm experiencing trouble in selecting the 0OBJ_CURR

This kind of declaration isn't working: "D1 Like /BIC/0OBJ_CURR."

And the same goes for the Selection:

"Select single OBJ_CURR into D1 from /BI0/PCOSTCENTER where COSTCENTER = i_t_var_range-low."

This is where my syntax also went wrong.

0OBJ_CURR is a unit, is there a special way to declare it and use it in the code?

(and 0CURRENCY is a reference unit for 0OBJ_CURR).

Do you have adivce on this?

-miikka

Former Member
0 Kudos

Hi,

Check the /BIO/PCOSTCENTER and see what is the field name for OBJ_CURR. You have to change it little bit based on your table structure. I gave you the logic.

Change:

D1 Like /BIC/PCOSTCENTER-OBJ_CURR or

D1 Type /BI0/OIOBJ_CURR

For

"Select single OBJ_CURR into D1 from /BI0/PCOSTCENTER where COSTCENTER = i_t_var_range-low."

Check the table /BI0/PCOSTCENTER and see what is the field name for 0OBJ_CURR and replace it in syntax.

Regards,

Kams

Former Member
0 Kudos

ok,

The problem solved!

Thanks a lot for your tips Kams!

The problem was in the master data, there were some duplicate records and I happened to test with one those duplicate rows...

Great work, points assigned.

-m

Edited by: Miikka Åkerman on Jun 8, 2009 6:49 PM

Answers (0)