cancel
Showing results for 
Search instead for 
Did you mean: 

Substitution is not working for prerequisite sales office& GL account

Former Member
0 Kudos

Dear Experts,

we have a requirement that if the sales office is 'x' and GL account is 'y' then substitute the cost center with 'z' while doing the billing. So i have defined the substitution in OKC9 as

prerequisite

COBL-HKONT = 'y' AND VBAK-VKBUR = 'x'

substitutions

Cost Center            Constant value     'z'

Profit. segment        Constant value    0000000000

but when I am checking the Accounting entry after billing it is not substituting the cost center with 'z' eventhough condition is fulfilled. also checked it has the sales office 'x' and GL account 'y' only.

If I change the condition to

prerequisite

COBL-HKONT = 'y'

substitutions

Cost Center            Constant value     'z'

Profit. segment        Constant value    0000000000

means if i exclude the sales office from the condition it is working fine.

Pl help me where i am doing  mistake.

Your inputs will be appreciated.

Regards,

Raja lucky

Accepted Solutions (1)

Accepted Solutions (1)

ajaycwa1981
Active Contributor
0 Kudos

Hi

I doubt this will work/. Use the exit option in OKC9 and try.. that should work

br, Ajay M

Former Member
0 Kudos

Hi Ajay,

Thanks for your suggestion. how to use this exit can you guide pl...

Regards,

Raja lucky

Former Member
0 Kudos

It
depends on if this is the first time a user exit is used in your installation
or not. In my case we already have program ZRGGBS00 created. A developer needs
to do this. See this thread for reference to create ZRGGBS00.

http://scn.sap.com/message/8695837

After
that I do the following...

1)
Define the user exit in ZRGGBS00 so it will show up in OKC9 as an option.  In my example I define exit “970” as a new
subroutine in ZRGGBS00. (abaper)

DATA:   c_exit_param_none(4TYPE c                  VALUE '0000' ,

exits-name = 'U970'.

exits-param = c_exit_param_none.

exits-title = text-117. " Define
description of user exit as seen in OKC9


APPEND exits.

2) Define the subroutine in ZRGGBS00 (Abaper)

FORM u970.

  “ user exit logic for your changes

  “ Note: tables you can use here are seen in
OKC9 prerequisite definition

  1. ENDFORM" U970

3) Create your substitution step in OKC9 (Analyst)

  A) define
your prerequisites

  B) Define
the substitution to use your exit ‘970’

ajaycwa1981
Active Contributor
0 Kudos

Hi

1. Ask your abaper to write the Logic in the exit ZRGGBS000 (Copy of RGGBS000)

He should give you the form no that he used, like U900, etc.. The logic to initialize PSG as 0000000 and derive the reqd KOSTL mut be written in the exit

2. You write a subst in OKC9 - Choose the Field to be replaced COBL-KOSTL and the method to substitute as exit

3. Subst to look like this

Prerequiste - COBL-BUKRS = XXXX AND Doc Type = YY

FIeld to be subst: KOSTL and specify the exit no U900 (as given by abaper)

br, Ajay M

Former Member
0 Kudos

One more thing for warnings about substitutions. 

1) Transport moves all steps in the substitution.  WARNING: if others are in the middle of concurrent changes their changes will move to production when you transport your changes.  Make sure to coordinate with your team.  You create transport by highlighting substitution line in OKC9 so cursor is in correct location, then go to menu- substitution- transport.

2) After the substitution is created the SAP code has to be generated.  This will have to be done in every client.  Make sure to do it immediately after moving changes to production (or any client after transport). 

You can generate by again selecting the cursor to the substitution then go to menur-substitution-simulate.  There is also a program to generate the code but I think it is easier to simulate.  Report RGUGBR01will also generate the code.  Search for how to run it if you want to use this, but I suggest just doing a simulation.

Former Member
0 Kudos

Hi Ajay,

Thanks for your inputs. Pl let me know is this substitution not possible without ABAPer help.

Regards,

Raja lucky

Former Member
0 Kudos

Hi Joel,

Thanks for your advise but I have done this substitution in sand box and in the same client only I am testing which is not working.

Regards,

Raja lucky

Answers (0)