on 06-25-2015 4:44 AM
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
Hi Sreekanth & Swapna ,
Thanks for the input. Will try the logic and let you know.
Regards,
Amala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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???
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
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.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.