cancel
Showing results for 
Search instead for 
Did you mean: 

Customer exit for cost center group based on cost center(user entry)???

Former Member
0 Kudos

Hi Gurus,

My requirement Is to display cost center group when the user keys in Cost center.

So i created a customer exit variable on cost center group.

This is the code in CMOD... though there is no error, it doesn't seem to work.

I have attached the file.

Cost center group variable- 'interval option'

Cost center variable- 'selection option'

Regards,

Amala

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sreekanth & Swapna ,

Thanks for the input. Will try the logic and let you know.

Regards,

Amala

former_member214415
Active Participant
0 Kudos

Hi Amala B,

Try this code:

data : wa TYPE rrrangeexit,

         WA1 TYPE /BIC/AZDSOCV00-/BIC/ZCOSTGRO.

   if i_step = 2.

     read table I_T_VAR_RANGE into wa with key vnam = 'ZCOSTVAR1'.

     select SINGLE /BIC/ZCOSTGRO from /BIC/AZDSOCV00 INTO WA1  WHERE  /BIC/ZCOSTEL = WA-LOW.

L_S_RANGE-LOW = WA1.

L_S_RANGE-SIGN = 'I'.

L_S_RANGE-OPT = 'EQ'.

       APPEND L_S_RANGE TO E_T_RANGE.

     ENDIF.

Thanks,

Swapna Jain

Former Member
0 Kudos

Hi Swapna,

Thanks for the code.

In the code, i replaced

/BIC/AZDSOCV00 with name of my DSo which stores Cost center and Cost center group relationship

/BIC/ZCOSTGRO with cost center group info object

ZCOSTVAR1 with Cost center variable (which is user entry)

/BIC/ZCOSTEL with cost center info object.


But where should i put the cost center group variable???

Because the cost center group should be displayed based on cost center.

So 'ZCOSTVAR1' should be the key and i should pass it to other variable 'ZVCOSTGRO'???


How to do it???


Regards,

Amala

ssurampally
Active Contributor
0 Kudos

you are writing the entire code for ZVCOSTGRO,

When 'ZVCOSTGRO'.

if i_step  = 2.

then you all your code,

what ever you are passing to l_s_range-low will be the value for ZVCOSTGRO processed in the customer exit by reading the Cost center user input value and from there it's group relation ship.




former_member214415
Active Participant
0 Kudos

Hi Amala B,

Anyhow it is nicely explained by sreekanth. Hey I forgot one thing, keep variable for cost center group at first(when 'zcostgroup') of this code because this code is written for cost center group variable so l_s_range-low will be the value for cost center group. Hope you understood.

Thank you,

Swapna jain

Former Member
0 Kudos

Hi Swapna,

Still not working

chanda
Contributor
0 Kudos

Hi Amala,

firstly how do you know what is the cost center group when a cost center is entered?

You code does not show any select statement fetching cost center group. hope it is missing.

You can debug to see if it is filling.

Can you just accept the cost center and get the relevant costcenter group from concerned table and process the query.

Also please note that 1_step = 2 does not bring you to the selection screen again.

try this while waiting for any better solution from the forum.

Regards,

Sudhir

Former Member
0 Kudos

Hi Sudhir,

In my modelling i maintain all the relevant data ie, cost center and its related cost center group...

But am not sure about the code...

I want some help on the coding part...

As i mentioned earlier, though there is no error.. it doesn't fetch any data.That's where i need some input...

Need help on the coding part.. on what should be the changes done on the code???

Former Member
0 Kudos

Hi Amala,

If i am correct that you are using the cost center group value is equal to the cost center group in you CMOD code. You haven't assigned any value to the Cost Center group.  You need to assigne value to L_S_RANGE-LOW = "(value)"

Please refer the customer exit code in google for more detail.

If you want to pass the cost center and want cost center value. Please provide any master data table or DSO which stored  the relationship with cost center and cost center group.

Like data

Cost center Cost center Group

C01            CG01

C02            CG02

Please provide inputs then i will provide the ABAP code.

Regards,

Chandresh

ssurampally
Active Contributor
0 Kudos

Hello, the code is wrong.

the first statement is correct, i.e. read table i_t_var_range ...... , here you are able to read the user input value of cost center,

from this cost center, you will have to get the Cost Center group, you said that you already maintained the relationship betweekn cost center and it's group, so then

select single cost center group from relation table into v_costgroup where cost center = ls_t_var_range-low

then you can assign the v_costgroup value to l_s_range-low. 

in Summary you will need 2 changes,  select single statement addition, then passing the retrieved value to l_s_range-low.

Former Member
0 Kudos

Hi Sreekanth,

Can u help me to where to exactly modify the code And what should be the code?

Former Member
0 Kudos

hi chandresh,

I store the relationship in DSO - ZDXXXXX

Now what i am trying to do is... User selection is based on cost center and i have to pick the Cost center element based on that.

Can u tell what is to be the code exactly?? if not what is the modification to be done?