cancel
Showing results for 
Search instead for 
Did you mean: 

Substitution - BSEG-HKONT

Former Member
0 Kudos

Hello All,

Using the Txn Code OBBH i have created a simple Prerequisite for Company code PL00 at Call point 2

(Line Items) and also created a User Exit U9012 (Substitution)in the Object ZGGBS000.

Under the "GET_EXIT_TITLES"

EXITS-NAME = 'U9012'.

EXITS-PARAM = C_EXIT_PARAM_NONE.

EXITS-TITLE = 'Replace GL Account (5th & 6th Char to 01)'.

APPEND EXITS.

and in the FORM

FORM U9012.

move '01' to BSEG-HKONT+4(2). "The requirement is to replace the 5th and 6th char with 01

ENDFORM.

Later i regenerated the code of RGUGBR00 and i could see in GBTC2FIB the following code

IF COND = B_TRUE .

PERFORM U9012(ZGGBS000) IF FOUND .

G_SUBST_PERFORMED = B_TRUE.

ENDIF.

ENDFORM. " SUB_PL0001

After the initial steps i created a document thru FB01 with a Break-point set in ZGGBS000.

I could see that it is going through the UserExit and the GL Document number when entered as "1000RV99" gets modified to "10000199"(in the debug screen) but, when the actual document is created and posted account 1000RV99 is displayed.

Both the Validation and Substitution are activated and i am trying to modify a single field

(BSEG-HKONT) and am trying to pass the modified value back to FB01 screen.

Am i missing on any step? Any pointers would be of great help.

Thank you.

- Sravan

Accepted Solutions (0)

Answers (2)

Answers (2)

Erol_CAGLAR
Participant
0 Kudos

Hi, There is no need extra code here.

you can maintenance via sm30 GB01 table. After than write rule

Erol

Former Member
0 Kudos

Hi Sravan,

Please use this FI user exit will be maintained thru config.

Please use T/code : GGB1 -> Financial Accou>Header/Lineitem > Create a substitution Ex: ZTEXT>Define Steps and Perequisite

then in substitutions add your Routine (Ex.U1001) which has been added in ZGGBS000.

This will generate an user exit internally for your substituion rule.

You have to maintain ZGGBS000 via T/code : GCX2.

Please go thru the documentation :

Substitution object: Constant, table field, or exit

There are three methods for changing (substituting) the value in a table field if the Boolean condition has been fulfilled (or is empty). The selected method is displayed next to this field.

The substitution methods and the necessary entries in each case are:

Substitution with a constant value.

You enter the value that is to be transferred to the assigned recipient field. This value is also allowed to be blank.

Substitution with the value from a different table field.

You enter the name of the other field in the following form:

Table name-field name

This field has to be transferred to the substitution, that is it must be a field that is allowed to be used in the prerequisite for substitution.

You can also leave the input field blank. In this case the recipient field is initialized.

Substitution within a user exit.

You enter the name of the exit.

in your use exit:

You need to use c_exit_param_field in place of C_EXIT_PARAM_NONE.

Example : (I am using U1001 for Text)

----


  • FORM U1001 *

----


  • Reading Customer PO from Sales Order --> FI Billing Doc. *

----


FORM U1001 USING BKPF-BKTXT.

SELECT SINGLE * FROM VBAK WHERE VBELN EQ BKPF-XBLNR(10).

BKPF-BKTXT = VBAK-BSTNK.

ENDFORM. "

Need more help please let me know.

Lanka

Former Member
0 Kudos

I think you have a couple of problems. If you want to substitute a field, you do not use C_EXIT_PARAM_NONE. You need to use C_EXIT_PARAM_FIELD or C_EXIT_PARAM_CLASS. To use C_EXIT_PARAM_FIELD, the field BSEG-HKONT has to be on the list of available fields. By default, I do not think it is available.

I do not have my old code with me, but I think you should look at table GB01 with a table name (BCLTAB field) of BSEG and a field name (BCLFIELD) of HKONT. It is probably shown as BEXCLUDE = 'X'. This means it is NOT available for substitution. There is an OSS note on this topic. You can set it to ' ', allow substitution, and use C_EXIT_PARAM_CLASS. The classes (like GB002_009) are in table GB02.

The code would be more like...

form u901 using bool_data type gb002_009

changing b_result.

data: l_bseg like bseg.

clear l_bseg.

l_bseg = bool_data-bseg.

l_bseg-hkont = .......

Former Member
0 Kudos

Hi Slater,

Thanks for the posting.

I even tried the C_EXIT_FIELD in the ZGGBS000 and regenerated the RGUGBR00 and it generated the PERFORM.

When tested thru FB01 it ran into SYSTAX error.

Thank you.

- Sravan

Former Member
0 Kudos

Check out OSS note 42615. It explains about changing the entry in table GB01.

Because BSEG-HKONT is not available for substitution in standard SAP, this is considered a modification. Make sure that you and the client really want to do this and there is no other way to meet your requirement.

An ABAP program has to be written to set GB01-BEXCLUDE to ' ' for the one record entry (009 S BSEG HKONT). The substitution has to be defined with callup point '2'.

Norm

Lakshmant1
Active Contributor
0 Kudos

Hi Sravan,

I think you have changed the parameter to C_EXIT_FIELD without changing the parameter in the form routine.

To work properely for your requirement use the parameter C_EXIT_PARAM_CLASS and make sure you set the corrrect parameter in the form routine and set the flag B_RESULT to either B_TRUE or B_FALSE.

Thanks

Lakshman

Former Member
0 Kudos

Hi Norman,

The Note 42615 also states that

"You can currently release the following fields

for substitution:

BSEG-FIPOS, BSEG-HBKID, BSEG-MSCHL, BSEG-MANSP, BSEG-MADAT, BSEG-MANST,

BSEG-MABER, BSEG-RSTGR, BSEG-ZLSPR

Formally, this is a modification. Therefore, you can also change entries in the table via SAP transports with a release upgrade (refer to Note 0391309).

If you release fields other than the ones listed for substitution, then you must take responsibility for all the consequences!

<b>Important: At callup point 2 (BOOLCLASS = 009) NO fields must be released for substitution from the document header. Otherwise, the system generates a short dump (PERFORM_PARAMETER_TOO_SHORT).

</b>

In addition to accounts and amounts, the following fields, for example, are critical and must not be substituted:

GSBER: this could lead to inconsistencies with modules AM, CO and MM, since the business area is also used in these modules."

Do you think we can go ahead with BSEG-HKONT?

Thank you.

- Sravan

Former Member
0 Kudos

Hi Norman,

Based on your posting i have checked the Table GB01 and identified that for BSEG and field HKONT the BEXCLUDE='X'. So

I have written a small ABAP program to remove the 'X'.

Code:

Tables: GB01.

GB01-BOOLCLASS = '009'.

GB01-CLASSTYPE = 'S'.

GB01-BCLTAB = 'BSEG'.

GB01-BCLFIELD = 'HKONT'.

GB01-BEXCLUDE = ' '.

Modify GB01.

Later when checked the record in GB01 the BEXCLUDE field was ' '.

I then went into Object ZGGBS000 and under the "GET_EXIT_TITLES" created the entry

EXITS-NAME = 'U9012'.

EXITS-PARAM = C_EXIT_PARAM_CLASS.

EXITS-TITLE = 'Replace GL Account (5th & 6th Char to 01)'.

APPEND EXITS.

In the FORM

FORM U9012 USING BOOL_DATA type gb002_009 changing b_result.

(At this point i receive the error "gb002_009 is unknown").

I looked in the declaration

type-pools: GB002. and i could not see any Type definitons for Boolean classes '009' init.

As this is an Standard SAP Object how does the gb002_009 entry be made into this.

Would be great if you could let me know the steps on this.

Code:

DATA: I_BSEG like BSEG.

CLEAR I_BSEG.

I_BSEG = BOOL_DATA-BSEG.

I_BSEG-HKONT+4(2) = '01'.

Please correct me if i am wrong.

Thank you,

- Sravan