‎2010 Jul 07 5:09 PM
Hi,
I have a problem in the Coding Block of a FI invoice Document posting. In our project, we have implemented substitutions to derive SBL;SEGMENT field in the line item of a GL Account.
I have created a program and in that i'm using BAPI_ACC_DOCUMENT_POST for posting the Accounting Document. During this BAPI call, it is not deriving the values of SBL and SEGMENT.
But, when i'm posting through transaction FB01; the substitutions are getting triggered and finally values are being derived.
Can anyone help on this as to why these values were not derived when it is being called through BAPI_ACC_DOCUMENT_POST. For COBL; is it really possible to post through this BAPI or something more has to be done.
Very urjunt !!! Please
Awaiting your valuable answers.
Thanks
Rohith
‎2011 Sep 08 12:00 AM
Hi Rohith,
to populate correctly the profit. Segment you should fill in the information used in derivation inside the BAPI CRITERIA table structure.
In the below example the profit. Segment is derived from Sales Org. (VKORG) and Distribution Channel (VTWEG).
Fill CRITERIA for CO-PA (Profitability Segment)
REFRESH lt_criteria.
wa_criteria-itemno_acc = lv_itemno_acc.
wa_criteria-fieldname = 'VKORG'.
wa_criteria-character = '1080'.
APPEND wa_criteria TO lt_criteria.
wa_criteria-itemno_acc = lv_itemno_acc.
wa_criteria-fieldname = 'VTWEG'.
wa_criteria-character = '01'.
APPEND wa_criteria TO lt_criteria.
If you need further information, please post your doubts here.
Regards,
Antonio
Edited by: indetony on Sep 9, 2011 12:46 AM