‎2007 Oct 24 11:54 PM
Hi,
I wrote a batch program to transfer GL data from text file to SAP. It uses FB01.
Everything works fine except for some GL accounts that do not need cost center input. When such account inserted my program has an error
saying that there is no field 'COBL-KOSTL' in the form.
To fix the problem my program has to access substitution rule and either insert or not incert line: PERFORM bdc_field USING 'COBL-KOSTL' itab-kostl. "Cost center
Question: how to access substitution rules from ABAP program? Or may be I have to access basic set generated by substitution? Or may be any other way?
Thank you,
Vitaly
‎2007 Oct 25 12:54 AM
Hi Vitaly ,
You can access to substitution rules but the problem you have is something with the customizing i think . Some accounts don't need cost centers. You have to change your screen sequence sometimes depending on the accounts.
Hope this helps ,
Regards .
Message was edited by:
Caglar Ozkor
‎2007 Oct 25 11:51 PM
This is the point. Some accounts don't need cost centers and those accounts could be fount when I manually run transaction GS02 and specify basic set name.
I have substitution ID (ZSUBFI) and basic set name (ZSUB_BANKGL_1001).
In table GB922, under substitution ID ZSUBFI there is set of constants for certain fields in BSEG table.
Shall I search BSEG table for those values and consider it the rule to find out GL accounts (HKONT) that do not need cost center?
Thank you,
Vitaly
‎2007 Oct 26 3:05 AM
No, they are not criteria for selection.
Btw, why don't u directly read the substituted HKONT from the set name (ZSUB_BANKGL_1001).
In GS922 look for HKONT against BSEG. If there is a form exit they are using then it would be placed against the field 'ProcessingForm' and I believe that is the case here too.
Regards
Nishant
‎2007 Oct 26 4:45 PM
How to read set? When I tried to open it as table it failed. I searched the forum and found nothing.
Thank you.
‎2007 Oct 25 3:12 AM
Hi,
These tables might help you.
GB03 Validation/Substitution User
GB03T Validation/Substitution Application Area T
GB31 Validation/Substitution Callup Points
GB31T Validation/Substitution Callup Point Text
GB907 Rule: Usage of Rules in Substitutions
GB92 Substitutions
GB921 Substitution Conditions
GB921T Substitution: Text Table for Substitution
GB922 Substitution Constants
GB925 Usage of Substitutions
GB92T Texts for Substitutions
I have not checked the details of which table to use exactly but I am sure it would help you in some sense.
Regards
Nishant
‎2007 Oct 26 12:06 AM
Hi,
it is not best idea to write BDC on FB01 as you need to check lot many parameter such as cost center assignment, profit center ass. posting keys etc.
Why don't you use BAPI for this.
If it is going to be daily or routine activity I think BAPI is the way to go with.
Regards,
Atish
‎2007 Oct 26 5:17 PM
What are you substituting. I don't think you're supposed to substitute anything with financial implications (like cost centers).
Rob
‎2007 Oct 28 10:54 AM
Can you clarify the problem? Are you getting a message indicating there is no field 'COBL-KOSTL' on the coding block screen in FB01?... if this is the case, it's configuration you need to understand as it would indicate that your BDC code is trying to feed in a cost centre to an account but the field is not available on the popup (typically because th GL account is something like a balance sheet account that does not affect CO).
Usually I have found that looking at the account group on the GL account master is frequently the way to determine what is going to appear in the coding block - but chat to the functional team / users first as they can explain the local rules.
Jonathan
‎2007 Nov 05 4:07 PM
Hi Jonathan,
yes they have substitution rules that generate a list of GL accounts that should not receive Cost Center information. This list is in basic set named ZSUB_BANKGL_1001. My original question was how to access basic set from abap program. Or how to access substitutional rules from abap program.
Thank you.