Field Posting Key in BAPI_ACC_DOCUMENT_POST ?
Hi
I need to post documents like FB01 , i'm already using BAPI_ACC_DOCUMENT_POST and it works so i can now create documents with the header and itmes positions , filling the tables header, accountreceivable items and currency items.
I already found the most of fields for execute the BAPI and create the documents, but i can not find three fields, some of one (BSCHL) the most important:
Posting Key (BSCHL)
Special G/L Indicator (NEWUM)
Calculate Tax Automatically (XMWST) .
I think but i'm not sure the Posting Key (BSCHL) is placed in the EXTENSION2 table, but this table ask for some STRUCTURE name and i don't know what should i place in this field or how fill this parameter table.
Does somebody can help me about where can i place these 3 fields in the BAPI or where can i find help documentation for do this ?
Regards
Frank
Frank,
you should use the Extension2 structure for passing the Posting Keys and you should implement the BADI for posting the documents with the Keys what you have supplied.
The Enhancement Spots are BADI_ACC_DOCUMENT and IF_EX_ACC_DOCUMENT.
I've used the BADI_ACC_DOCUMENT and now i'm able to post the documents using the keys which i've supplied to the BAPI.
Otherwise the BAPI is going to decide the posting keys based on tha amount .
Hope this will help you.
Thanks,
Adi.
Similar Messages
-
Posting Key in BAPI_ACC_DOCUMENT_POST
Hi,
I am using bapi 'BAPI_ACC_DOCUMENT_POST' to post 'Customer Document' in FB01. I was able to post the document but Posting Key in the document is not as desired. When I try to Post the document with out any Posting Key by default I am having Posting Key as '01'(Customer document) and '50'(GL account).
But I want bapi 'BAPI_ACC_DOCUMENT_POST' to post a document with Posting key '15'(Customer Document) and '40'(GL account).
In bapi I am using these tables along with header.
ACCOUNTGL- GL Account
ACCOUNTRECEIVABLE- Customer Document
I tried passing the posting key in ACCT_TYPE in table ACCOUNTGL and passing the the posting key using EXTENSION2 table but was not successful .
Can anyone let me know
How can I pass the Posting Key to the bapi 'BAPI_ACC_DOCUMENT_POST' for Customer Document and GL account?
OR
How can I use EXTENSION2 table to create an appropriate posting key?
please let me know.
Vikki,
In one of your thread you came across the same issue and you solved it. Can you please guide me how to achive appropriate posting key using EXTENSION2 table?
Thanks,
Vijay.Hi,
Just follow these steps:
1. Fill in your EXTENSION table like this
first 3 character represent item number
next 2 character represent posting key
CLEAR: gt_extension.
gt_extension(3) = sy-index(3).
gt_extension+3(2) = 'New Posting Key'.
APPEND gt_extension.
2. Create an FM similar to SAMPLE_INTERFACE_RWBAPI01 and put the following codes:
IF NOT extension IS INITIAL.
LOOP AT extension.
READ TABLE it_accit WITH KEY posnr = extension(3).
IF sy-subrc IS INITIAL.
it_accit-bschl = extension+3(2).
MODIFY it_accit INDEX sy-tabix.
ENDIF.
ENDLOOP.
ENDIF.
3.
- Go to TCode "FIBF".
- Go to Settings -> Products -> ... of a customer
- Create a new entry and check the box to activate the product
Product = <any name>
Text = <description>
RFC = blank
Check the activation box
- Go to Settings -> Process Modules -> ... of a customer
- Create a new entry by specifying the name of the function module name and product name created earlier.
Process = RWBAPI01
Ctr = blank
Appl = blank
FM = <FM created>
Product = <name of product created earlier>
Hope this helps,
Leonard Chomi. -
Assignment field is not getting populated in KSB1 for posting key 50
Hi All,
We are uploading entries thru excel in SAP.
For posting key 50 assignment field is not getting populated in KSB1.
But for posting key 40 it is getting populated correctly.
All setting (FSG, posting key details) are same for both the keys.
No substitution defined in SAP.
There is no issue for FBL3N for both the posting keys, only issue with KSB1.
Any idea what could be the reason for this?
Thank you.
AkashKSB1 is CCtr report..
if it is revenue normally it will be treated as statistical posting in CCtr accounting- for the cost element when it is defined as revenue element.. - check Cost elements - whether it is Cost and cost reducing or revenue element--
possibility this can be one of the reason.
check and confirm -
Difference between field staus group for posting key and GL account
Hi all,
can anyone tell me what is the difference of usage for field status group in posting key and GL account as i notice the fileds are the same. during data entry, system will check both field status or how?
thanks.Hi
Both are to control the field status of the line item.
But, the FSG of the Posting Key and the GL FSG status should not clash like below.
Take 'Assignment' field as example :
Posting key FS - Suppress & GL FS - Required - will give you error message at the time of posting
Posting key FS - Required & GL FS - Suppress - will give you error message at the time of posting
Otherthan the above, all other combination works
VVR -
Posting Key Field Status changes - unable to generate Transport request
Dear All,
I did posting key field status change from suppress to optional ( P.Key 24).
However I am unable to generate a transport request.
Please share your inputs
Thanks
SanjaiHiii sanjai Babu... your client would have set automatic recording of changes in scc4... or the request would be created and yo woulnt have left the page after saving soo it might have been saved... hope it helps...
Regards
Abhay -
Hi ,
i am using BAPI_ACC_DOCUMENT_POST to post accounting document. This accounting document is used to post amount from reconcilation account to bank GL account.the table parameter am using is ACCOUNTGL (in the function module)Now i want to give posting keys to the function module parameter. can anyone please guide me how to give posting keys?
Edited by: Santhosh Kumar Cheekoti on Dec 18, 2008 7:48 AMHi,
As pointed out in one of the previous post, posting key will be decided by the BAPI depending on the sign of the amount. Have a look at bthe following code:-
DATA: doc_header LIKE BAPIACHE09,
criteria LIKE BAPIACKEC9 OCCURS 0 WITH HEADER LINE,
doc_item LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
doc_ar LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
doc_values LIKE BAPIACCR09 OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
extension1 like BAPIACEXTC occurs 0 with header line,
obj_type LIKE bapiache08-obj_type,
obj_key LIKE bapiache02-obj_key,
obj_sys LIKE bapiache02-obj_sys,
docnum LIKE bkpf-belnr.
*DATA:
* ITEMNO_ACC POSNR_ACC
* FIELDNAME FIELDNAME
* CHARACTER ACPI_RKE_CRIGEN
* Fill Document Header
doc_header-bus_act = 'RFBU'.
doc_header-bus_act = 'RMRP'.
*doc_header-bus_act = 'SD00'.
doc_header-username = sy-uname.
doc_header-header_txt = 'TEST BOC BAPI POSTING'.
doc_header-comp_code = 'IN10'.
doc_header-compo_acc = 'FICA'.
doc_header-doc_date = '20060127'.
doc_header-pstng_date = sy-datlo.
doc_header-doc_type = 'SA'.
** Fill Line 1 of Document Item
*doc_item-itemno_acc = '1'.
*doc_item-gl_account = '0000500001'.
*doc_item-pstng_date = sy-datum.
*doc_item-item_text = 'TEST POSTING DEBIT ITEM'.
*doc_item-costcenter = ''.
*doc_item-quantity = '1'.
*doc_item-base_uom = 'ST'.
*APPEND doc_item.
*CLEAR doc_item.
** Fill Line 2 of Document Item
*doc_item-itemno_acc = '2'.
*doc_item-customer = '0000000016'.
*doc_item-gl_account = '0000000016'.
*doc_item-pstng_date = sy-datlo.
*doc_item-item_text = 'TEST POSTING CREDIT ITEM'.
*APPEND doc_item.
*CLEAR doc_item.
doc_ar-itemno_acc = '1'.
doc_ar-gl_account = '0000500001'.
doc_ar-pstng_date = sy-datum.
doc_ar-item_text = 'TEST POSTING DEBIT ITEM'.
doc_ar-costcenter = ''.
doc_ar-quantity = '1'.
doc_ar-base_uom = 'ST'.
APPEND doc_ar.
CLEAR doc_ar.
* Fill Line 2 of Document Item
doc_ar-itemno_acc = '2'.
doc_ar-customer = '0000000016'.
doc_ar-gl_account = '0000000016'.
doc_ar-pstng_date = sy-datlo.
doc_ar-item_text = 'TEST POSTING CREDIT ITEM'.
doc_ar-stat_con = ' '.
doc_ar-costcenter = '0000201681'.
APPEND doc_ar.
CLEAR doc_ar.
* Fill Line 1 of Document Value.
doc_values-itemno_acc = '1'.
doc_values-currency_iso = 'INR'.
doc_values-amt_doccur = '200.00'.
doc_values-currency = 'INR'.
doc_values-CURR_TYPE = '00'. "Doc currency
APPEND doc_values.
CLEAR doc_values.
* Fill Line 2 of Document Value
doc_values-itemno_acc = '2'.
doc_values-currency_iso = 'INR'.
doc_values-amt_doccur = '200.00-'.
doc_values-currency = 'INR'.
doc_values-curr_type = '00'. "Doc currency
APPEND doc_values.
CLEAR doc_values.
* Add tax code in extension1 table.
extension1-field1 = 'BAPI CALL'.
APPEND EXTENSION1.
* Fill CRITERIA for CO-PA
*refresh criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'ARTNR'.
*criteria-CHARACTER = '000000000001312251'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'WERKS'.
*criteria-CHARACTER = 'IN91'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'KNDNR'.
*criteria-CHARACTER = '0000000016'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'FKART'.
*criteria-CHARACTER = 'ZIN2'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'KAUFN'.
*criteria-CHARACTER = '0000000633'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'KDPOS'.
*criteria-CHARACTER = '000010'.
*Append criteria.
*criteria-ITEMNO_ACC = '1'.
*criteria-FIELDNAME = 'VKGRP'.
*criteria-CHARACTER = '009'.
**Append criteria.
* All tables filled - now call BAPI.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
EXPORTING
documentheader = doc_header
IMPORTING
OBJ_TYPE = doc_header-obj_type
OBJ_KEY = doc_header-obj_key
OBJ_SYS = doc_header-obj_sys
TABLES
* criteria = criteria
accountgl = doc_item
ACCOUNTRECEIVABLE = doc_ar
currencyamount = doc_values
return = return
EXTENSION1 = EXTENSION1.
LOOP AT return WHERE type = 'E'.
EXIT.
ENDLOOP.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = doc_header
IMPORTING
OBJ_TYPE = doc_header-obj_type
OBJ_KEY = doc_header-obj_key
OBJ_SYS = doc_header-obj_sys
TABLES
* criteria = criteria
accountgl = doc_item
currencyamount = doc_values
return = return
EXTENSION1 = EXTENSION1.
LOOP AT return WHERE type = 'E'.
EXIT.
ENDLOOP.
IF sy-subrc EQ 0.
WRITE: / 'BAPI call failed - debug and fix!'.
ELSE.
CLEAR return.
REFRESH return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
IMPORTING
return = return.
WRITE: / 'BAPI call worked!!'.
WRITE: / doc_header-obj_key, ' posted'.
ENDIF.
Regards
Raju Chitale
Edited by: Raju Chitale on Dec 18, 2008 8:31 AM -
Custom fields in Field status variant and Posting keys
Hi,
We have defined some custom fields in BSEG table for which we wish to control the field status through Field status groups and Posting keys as well.
Has some one addressed this requirement before? Please provide me some inputs on this.
Regards,
SwapnilHello Chakardhar,
Since the same fields for document entry are required for several G/L accounts, you define the status of fields for a group of G/L accounts.
You create the definition under a field status group. Enter the key of the group in the master record of the G/L account. Field status groups are cross-company code, that is, they do not depend on the company code but on the field status variant. In the standard system, a separate variant for field status groups exists for each company code. The name of the variant is the same as the company code. Every company code is assigned to the variant with the same name. You can work in several company codes with identical field status groups as long as these company codes are assigned to the same field status variants. You define the field status for each individual posting key.
Hope I ahd been able to hep you out. Please assign points and let me know if you need anything specific.
Rgds
Manish -
Field BSEG-ZLSPR in a posting key 50
Hello,
I have a doubt,
Is it possible to display the lock field (BSEG-ZLSPR) as a posting key 50? And after post are able to change?
Thanks.Hello again,
The problem I have is in a substitution i changed the posting key 50 to 31 (bseg-bschl = '31') and block the payment(BSEG-ZLSPR = 'Y '), but when i see the document I get the screen off the posting key 50 and the field payment block doesn't appear. I need that the field payment block appear to change it in the future.
Thanks. -
Posting key X Field status group
Hello,
How is it possible to define Field status group depending on Posting key.
Field status group is assinged to GL account.
However I can see that when I E.g. post to a customer account - when using different posting keys there are different field status variants in FB01.
I cannot find this is set up in SPRO.
Many thanks in advance,
JanHi,
Field status can be determined through Posting key also. In OB41, click on any posting key and in the next screen Field status tab is available.
This can be used to configure Field status of document line item posting key wise.
Regards,
Gangadhar -
Rules for posting key 21 and acct ### set incorrectly for "OIEXGNUM" field
Does anyone know how to resolve this error? I am trying to post a vendor credit memo in FB65 for testing purposes.
FIRST CHECK THE POSTING KEY 21 FIELD STATUS AND ACCOUNT FSG
MAY BE THAT FIELD MAINTAIN DIFFRENTLY(LIKE ONE IS SUPRESSED AND IN OTHER REQUIRED) -
Field Status Groups Vs Posting keys Field Status Groups
Hi, Seniors,
In my job posting Keys field status group fields I never used as required field some cases just I used only Special G/L transaction Indicators except this I kept all the fields as Optional. My doubt is How this fields can be used as independent priority If there is no important why dont we use only field status group fields like G001, G002, ..... why should we depend on Posting keys field status group Fields.
Thanks in Advance
Sarath babuHi Sarath,
If you do any chages in the FSG it will applicable to all G/L accounts which are using the same FSG. But if change posting keys FSG then it will applicable only to that particular posting key it wont effect rest of the G/L's. But you should takecare of the below things.
I. A field which is suppressed at the posting key level shouldnt be required in the
field status group specified in the General Ledger Account.
II. A field which is suppressed in the field status group under General Ledger
Account shouldnt be specify as required in the posting key level.
III. Posting keys are defined by Account type wise.
Rams.N
If this is helpful assign me points -
posing key can do all the functions of field status variant..............so what is the purpose of defining field status variant.............?
Hello Chakardhar,
Since the same fields for document entry are required for several G/L accounts, you define the status of fields for a group of G/L accounts.
You create the definition under a field status group. Enter the key of the group in the master record of the G/L account. Field status groups are cross-company code, that is, they do not depend on the company code but on the field status variant. In the standard system, a separate variant for field status groups exists for each company code. The name of the variant is the same as the company code. Every company code is assigned to the variant with the same name. You can work in several company codes with identical field status groups as long as these company codes are assigned to the same field status variants. You define the field status for each individual posting key.
Hope I ahd been able to hep you out. Please assign points and let me know if you need anything specific.
Rgds
Manish -
Profit centre field not visible while using Posting Key 15
Hi,
While using Tcode F-28 and Posting Key 15 profit cente field is not visible. I have checked following configuration. In OBC4 for Reconciliation account - additional account assignment - here the profit centre field is optional. Likewise I have checked OB41 for Posting key 15 - Profit centre field is optional.
Is there any other configuration to be done inorder to make the profit centre field visible.
Many thanks in advance
Regards
NarayananDear,
SAP Standard System cannot provide PRCTR field for the screen for customer/vendor line
item although it is available if the line item is a G/L account. As a
general rule, the system assumes PRCTR to be filled by document split or
by running SAPF180 and AR/AP transfer depending on NewGL PCA or
classic PCA usage.
It was and still is not possible to enter PRCTR on vendor/
customer items.
One of the workarounds using the standard tools is to use field-to-
field substitution. You can enter the profit center in dummy field,
for example XREF1, and substitute the value entered in XREF1 into
PRCTR field.
I hope this can help You.
Mauri -
Profit Center as mandatory field for Posting keys 01, 11, 31, etc.
Hello,
Currently I am in a project in which we have implemente New GL; my client is asking me to activate the Profit Center field for posting keys 01, 11, 21 and 31, so they can post in example documents with posting key 31 (vendor) vs posting key 01 (client). I modified the accounts field status in order for the Profit Center to be mandatory. I modified, as well, posting keys 01, 11, 21 and 31 field status' in orden for the profit center to be mandatory as well. Regardless of this, the profit center just doesn't appear when I post a document in example through tx F-02.
Does anyone knows how to make this field appear for the posting keay I mentioned? Is it possible? or is this a system limitation?
Thanks in advance for your help.
Regards,
HPHello,
I figured out how to make the Profit Center field modifiable on the Client and Vendor postitions.
Thanks to everyone for their replies.
Regards,
Paul -
Profit center field for posting key 06
Hi!
I have configured as profit centre is an optional field for GL account field status group & posting keys field status group.
But for posting key 06, system is not showing the profit centre for transaction code FB01 or F-28 or F-02 .
I checked for coding block also, but for other posting keys, system is showing profit centre, but not for this.
if i have to change coding block , how to assign coding block to transaction codes?
regs,
rameshThere can't be a profit center on sub-ledger (customer/vendor) items. Check out the following thread.
Profit Center for Vendor/Customer line item in F-02
In new GL, you specify profit center on the GL line items in entry view and then via document splitting characteristic settings, you can see the profit center on receivables/payables reconciliation account in the entry view.
Maybe you are looking for
-
IOS8 completely messes up old "family sharing" method of sharing an itunes account
Instead of my wife and I's five devices working very well together ...sharing a 200gb storage plan, sharing safari tabs through iCloud, ect. Our devices have been completely hacked apart by this new family sharing setup. It's also going to cost us m
-
"gdmessage" does not work in 7.1.3
It seems that the "gdmessage" does not work properly in version 7.1.3. I attach a simple example consisting of a GUI with two buttons: - Quit - gdmessage The callback for the "gdmessage" button execute the following command: gdmessage(T,"MainWin",1);
-
Pdf file error.this path is not valid
I have a pdf file of 100 mb.when i copied it to my Lumia 720,its not getting opened and the error msg "this path is not valid" is shown.how can i open this file in my phone?plz help me out.thank you.
-
Hi everyone, I just purchased a lumia 1520 black this weekend. However, I keep having problems with the time and date setting. Whether I use the automatic setting or not, the time keeps resetting a couple times a day to some time on the 20th of july
-
Constructing a buffer to hold bytes going to socket
I'm a newbie and struggling with a project to construct a multi-threaded Web server that enables a browser-client to access an HTML file. I've constructed a 1K buffer, but if I want to examine various file transfer rates with different file sizes, I