‎2007 Jan 04 6:44 PM
Hello......
I have a requirement to post FI docs through FB01...
i m planning ot use BAPI_ACC_GL_POSTING_POST..but the problem is i have some fields to post like quantity etc., which are not present in BAPI structure
( BAPIACGL08 ) and also our custom fields ( PPC,carrier,title code etc.,)..
so do u think its better to use BDC recording? or have to create a custom BAPI...
which one will be suitable?...
thanks...
‎2007 Jan 04 6:57 PM
if BAPI is not supporting ur requirement, then u have to do it using BDC...do a recording using SHDB and write a BDC program.
‎2007 Jan 04 6:58 PM
‎2007 Jan 04 9:10 PM
Aday,
You should use the BAPI instead of a BDC. If you need to fill in additional fields that are not present in BAPIACGL08, you should use a USEREXIT.
To do this, you will have to fill out the EXTENSION1 table with your extra fields.
For example:
*Build extension data for BAPI
wa_extension1-field1(3) = 2. " Line Item Number
wa_extension1-field1+7(10) = '0000007415'. " LOB - zzlob
wa_extension1-field1+17(3) = 'NE '. " Region - zzregio
wa_extension1-field1+30(3) = '110'. " Reinsurance Type - zzreint
APPEND wa_extension1 TO extension1.
CLEAR wa_extension1.
You will then have to place code into the include ZXACCU15 (which is in function module EXIT_SAPLACC4_001) that will move the data you have in your EXTENSION1 table into the T_ACCIT internal table.
Here is an example:
*----------------------------------------------------------------------*
* INCLUDE ZXACCU15 *
*----------------------------------------------------------------------*
DATA: extension_itab TYPE STANDARD TABLE OF bapiextc,
wa_extension LIKE LINE OF extension_itab.
LOOP AT extension INTO wa_extension.
READ TABLE t_accit WITH KEY posnr = wa_extension(3).
IF sy-subrc IS INITIAL.
t_accit-fkber = wa_extension-field1+3(4).
t_accit-zzlob = wa_extension-field1+7(10).
t_accit-zzregio = wa_extension-field1+17(3).
t_accit-prctr = wa_extension-field1+20(10).
t_accit-zzreint = wa_extension-field1+30(3).
t_accit-zzaemy = wa_extension-field1+33(4).
t_accit-zzryear = wa_extension-field1+37(4).
t_accit-zzpct = wa_extension-field1+41(1).
t_accit-zzreinc = wa_extension-field1+42(11).
t_accit-zzasseti = wa_extension-field1+53(1).
t_accit-rmvct = wa_extension-field1+54(3).
t_accit-empfb = wa_extension-field1+57(10).
MODIFY t_accit INDEX sy-tabix.
ENDIF.
ENDLOOP.
Your additional fields needed should be in the structure ACCIT.
The process can be somewhat confusing. Just let me know if any of this does not make any sense!
-Aaron
‎2007 Jan 04 10:32 PM
Aaron;
thanks for the information....
I have few questions...
1.how r u handling the line items( if there are multiple )..
READ TABLE t_accit WITH KEY posnr = wa_extension(3).
i didnt understand what the above statement is doing..
2. <b>can we Park/hold the document before posting...coz our end users want to reveiw them before posting.</b>
3. so i have to append my custom fields to structure ACCIT.
so by passing the values to ACCIT structure through userexit will be enough.. or do i have write any more code to populate the custom fields...??
thanks in advance...
‎2007 Jan 05 1:46 PM
Aday,
I will try and answer your questions:
1.
READ TABLE t_accit WITH KEY posnr = wa_extension(3).t_accit is an internal table that contains the line items that were passed in the BAPI. So if you are passing 5 line items to the BAPI, there will be 5 records in t_accit.
So when you have a line item that needs to have your custom fields filled in, move that line item number to your extension table.
Like this:
wa_extension1-field1(3) = 2. " Line Item Number So with the above READ statement, you are reading the t_accit table by the Line Item you populated in your extension. That way you are modifying the correct Line item with your custom fields.
2. You might be able to use a different function module if you want to park the document: <b>BAPI_INCOMINGINVOICE_PARK</b>
Not sure if this would work for you though, have a look!
Otherwise you could maybe use FM <b>BAPI_ACC_GL_POSTING_CHECK</b> to check the posting first and then generate an error message for the user if there was a problem.
3. Yes, you will need to have your custom fields on ACCIT.
The only code you need to write is the code when calling the BAPI and the code in the include ZXACCU15. Let me know if you need any other clarification!
-Aaron
‎2007 Jul 16 3:17 AM
Hi Aaron,
Just want to ask, after adding the customized fields in the structure ACCIT, where does the data being kept? must i append the fields also in a specified transparent table?
thanks
‎2007 Jan 05 2:29 PM
Hi,
Iam also doing exactly the same. So,instead of Bapi, in this senior, i went for BDC and iam Succesful.
So, i suggest you to go for BDC,
If you need i can provide the code also.
Thanks
Manju
Reward points useful
‎2007 Jan 05 2:38 PM
BDC's do work and get the job done in most cases. But if the screens change durring an upgrade, which happens a lot, you will have to record the BDC over again. If you have a lot of BDC, this can be a pain.
I would recommend using a BAPI if possible.
‎2007 Jan 05 7:05 PM
hi..
thanks for your replies..
Aaron , thanks for explanation...i will try the func modules...
manju,yes i would like to see the code...can you please send it my e-mail
aday201@yahoo.com
yes if i use BDC ,there will be a problem while upgrade which we r goin to do soon in the year end...
once again thanks...
i will keep the thread open ,,,for further questions...
Thank you..