Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_ACC_DOCUMENT_POST FOR F-29

Former Member
0 Likes
3,877

Hi All,

I am using bapi BAPI_ACC_DOCUMENT_POST its asking OBJECT TYPE AND OBJECT KEY which parameters I have to enter ?

Please guide me.

Thanks in advance .

Regards,

Suresh Babu

21 REPLIES 21
Read only

former_member188827
Active Contributor
0 Likes
3,185

Read documentation of BAPI"BAPI_ACC_DOCUMENT_POST".It gives details regarding each and every parameter.Most of the BAPIs are very well documented,so if you go through the documentation,you will get answers of most of your queries .

Read only

0 Likes
3,185

Hi ,

I gon through that document but I am getting errors as

required field obj_type was not tranfered in parameter DOCUMENT HEADER

required field obj_key was not tranfered in parameter DOCUMENT HEADER

required field obj_sys was not tranfered in parameter DOCUMENT HEADER

Please guide me.

Regards,

Suresh

Read only

0 Likes
3,185

As suggested by Suhas,post a document via F-29 and then go to se11 and check values in fieds AWTYP,AWKEY and AWSYS.

If you have gone through the documentation,then you must have read that :The following fields must be filled:

o OBJ_TYPE Sender identification

o OBJ_KEY Reference number of source document

o OBJ_SYS Logical system of source document

are required fields in document header.you need to populate these fields with appropriate values.

Read only

0 Likes
3,185

Hi,

Thank you for giving reply.

I tried but its giving errors as

ERROR IN DOCUMENT BKPF 9700000003ZSUR2010 SPDLNCLNT800

INCORRECT ENTRY IN FIELD OBJECT_TYPE BKPF

Please guide me.

Regards,

Suresh

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,185

Hello,

You shouldn't be checking BKPF-AWTYP, rather check BKPF-GLVOR as mentioned in my previous post.

BR,

Suhas

Read only

0 Likes
3,185

Hi Suha,

I checked based on your guidline only what I did will elabrate to you.

I posted 50000 Rs amount in customer account by using tcode f-29 .

Later I checked bkpf table based on that now I am trying to post through BAPI but its giving error message like this.

Regards,

Suresh

Read only

0 Likes
3,185

Hi,

I think you should use BKPFF as the value to OBJ_TYPE. This SDN Wiki may be helpful [FI Document Interface|http://wiki.sdn.sap.com/wiki/display/ABAP/BusinessTransactionEvent-RWBAPI01-ForAccountingDocument+Interface].

Regards

Vinod

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,185

>

> I posted 50000 Rs amount in customer account by using tcode f-29 .

>

> Later I checked bkpf table based on that now I am trying to post through BAPI but its giving error message like this.

Hello,

What is the value in the field BKPF-GLVOR for the resulting a/c'ing doc?

@Vinod: If i read the BAPI documentation, only the a/c'ing docs for the Business Transactions(BKPF-GLVOR) RFBU, RMRP, SD00 & RMWA can be posted. In your Wiki is see that you've passed 'RFBU' to BUS_ACT as well. So setting OBJ_TYPE = 'BKPFF' won't help if business transaction for F-29 is different.

Hope i'm clear.

BR,

Suhas

Read only

0 Likes
3,185

Hi Vinod,

Thank you for giving reply I tried with BKPFF getting same error.

Regards,

Suresh

Read only

0 Likes
3,185

Hi

@Suhas : I have created an entry through F-29. Value of BKPF-GLVOR is RFBU.

Edit : Currently my system is ECC 5.0. As mentioned in the Wiki, when I pass the values of OBJ_KEY system is giving error and not posting the Accounting document. But if I comment the part of assinging values to OBJ_KEY, OBJ_TYPE, OBJ_SYS, Accounting document is created successfully.

Do you know the reason behind this behaviour ?

Regards

Vinod

Edited by: Vinod Kumar on Sep 16, 2010 3:19 PM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,185

Hey Vinod,

Me on ECC6.0 & i see that these fields are "must be filled". What does the ECC5.0 documentation state ?

BR,

Suhas

Read only

0 Likes
3,185

Hi Suhas,

Documentation says these fields MUST BE filled. But the code I have mentioned in WiKi is working correctly in Production(ECC 5) Further, When I pass these values, Bapi returns an error.

Earlier I used the same code with values passed to these fields (with 4.7), It started giving errors after migrating to ECC5.0. As a trial and error method, I tried to call the bapi without these parameters and it worked (still confused how it is working correctly in Production)

Regards

Vinod

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,185

Hello,

Never faced this situation. Did you check any underlying config which might be missing in DEV system ?

BR,

Suhas

Read only

0 Likes
3,185

Hi Vinod,

Currently I am working on 4.7 version may be due to that its giving error.Please let me know.

Regards,

Suresh

Read only

0 Likes
3,185

Hi Suhas,

The code in LACC9F20 reads. Means even if I didn't pass values to these parameters, system determines it internally. Is this same in ECC 6.0 also. The first validation if BKPFF was not there in 4.7 which is new in ECC 5.0.

*FI Belegnummer als Referenz
  if document_header-obj_type = 'BKPFF'.
    perform append_msg_to_return
            using 'E'              "TYPE
                  'RW'             "ID
                  '628'            "NUMBER
                  'BKPFF'          "MESSAGE_ONE
                  'DOCUMENTHEADER' "MESSAGE_TWO
                  'DOCUMENTHEADER' "PARAMETER
                  1                "ROW
                  'OBJ_TYPE'.      "FIELD
  endif.
  if document_header-obj_type  is initial and
     document_header-obj_key   is initial and
     document_header-obj_sys   is initial and
     document_header-ac_doc_no is initial.
    loop at account_gl where not stat_con  is initial
                          or not ac_doc_no is initial.
      exit.
    endloop.
    if not sy-subrc is initial.
      perform reference_create_prelim
              changing document_header-obj_type
                       document_header-obj_key
                       document_header-obj_sys.

      document_header-bus_act = 'RFBU'.                "note1045412

    endif.
  endif.

form reference_create_prelim
     changing e_awtyp type awtyp
              e_awkey type awkey
              e_awsys type awsys.

  data: log_sys type logsys.

  e_awtyp = 'BKPFF'.
  e_awkey = '$'.
  call function 'OWN_LOGICAL_SYSTEM_GET'
    importing
      own_logical_system             = log_sys
    exceptions
      own_logical_system_not_defined = 1
      others                         = 2.
  if sy-subrc is initial.
    e_awsys = log_sys.
  endif.

Regards

Vinod

Read only

0 Likes
3,185

Hi Vinod and Suhas,

Thank you very much for giving reply.

I am unable to find the solution for this issue still I am getting error like in correct entry in the field obj_type : BKPF .Even I posted manully with f-29 its happening latter I check with bapi BAPI_ACC_DOCUMENT_CHECK there also I am getting same error.I am not getting why its happening.

Regards,

Suresh

Read only

0 Likes
3,185

Hi Vinod and Suhas,

Now we cahnged version to ECC 6.0 but here I am getting error as "enter a payment currency different to EUR".

Please guide me.

Regards,

Suresh

Edited by: sureshbabusure on Sep 20, 2010 9:25 AM

Edited by: sureshbabusure on Sep 20, 2010 9:26 AM

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,185

Hello Suresh,

Try posting with the same data in F-29, are you getting this error message ?

BR,

Suhas

Read only

0 Likes
3,185

Hi,

I checked by posting with F-29,its working fine.

Regards,

Suresh

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,185

Hello,

BAPI_ACC_DOCUMENT_POST can post documents for these business transactions (field BKPF-GLVOR): RFBU, SD00, RMRP & RMWA. As already mentioned the BAPI is well documented you should read it before using it.

Try posting a doc via F-29 & check the BKPF-GLVOR field of the resulting doc & revert back. I'm not able to post a doc via f-29, some config issues.

BR,

Suhas

Read only

Former Member
0 Likes
3,185

Thank you Vinod and Suhas Problem has been solved that is due to currency problem like company code having currency of EUR but customer is paying with currency USD.