Application Development 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: 

BAPI_ACC_DOCUMENT_POST header data

Former Member
0 Kudos

Hello Friends,

I am trying to post customer document by BAPI_ACC_DOCUMENT_POST instead of F-02. For the field Bus_Act I fill 'RFBU'. First line contains the customer data and the second line contains account data. I have used this BAPI many times before without any errors but now when i tried for a new program on a new system it asks for the following header table fields:

OBJ_TYPE

OBJ_KEY

OBJ_SYS

Before I did not need to fill these.

Is there smt that I have to check in customizing?

Thanks in advance,

Ali

1 ACCEPTED SOLUTION

madhu_vadlamani
Active Contributor
0 Kudos

Hi,

As i know you have to fill these parameters if it is a non po invoice.

Regards,

Madhu.

5 REPLIES 5

madhu_vadlamani
Active Contributor
0 Kudos

Hi,

As i know you have to fill these parameters if it is a non po invoice.

Regards,

Madhu.

Clemenss
Active Contributor
0 Kudos

Hi Ali,

if you never supplied OBJ_* data, maybe someone else did for you

I know it is almost impossible to do a search on SCN before posting. Otherwise one might find things like [Vendor Invoice Posting using BAPI|http://wiki.sdn.sap.com/wiki/display/Snippets/VendorInvoicePostingusingBAPI].

Happy coding!

Clemens

Former Member
0 Kudos

Dear Clemens,

Thanks for your comment(!) I have actually gone through SDN and searched for this topic but no article was related to my question. As the last solution I had to create a post. Please be careful about your remarks and read questions carefully.

Regards,

Ali

Former Member
0 Kudos

Hi all,

I used this BAPI before, without providing any values for OBJ_TYPE, OBJ_KEY, OBJ_SYS and the BAPI still works.

If you look into its source code, you can see that, if we leave those fields blank, system will automatically populate their values:


  IF document_header-obj_type   = 'BKPFF' OR (
     document_header-obj_type  IS INITIAL AND
     document_header-obj_key   IS INITIAL AND
     document_header-obj_sys   IS INITIAL ).

      PERFORM reference_create_prelim
              CHANGING document_header-obj_type
                       document_header-obj_key
                       document_header-obj_sys.

      IF document_header-bus_act IS INITIAL.           "note1264422
        document_header-bus_act = 'RFBU'.              "note1045412
      ENDIF.                                           "note1264422
    CLEAR document_header-ac_doc_no.
  ENDIF.

The routine reference_create_prelim will assign default values


OBJ_TYPE = 'BKPFF'
OBJ_KEY = '$'
call fm OWN_LOGICAL_SYSTEM_GET to get value for OBJ_SYS

This issue seems strange to me as well.

Did you test the BAPI in SE37? Is it ok?

Thanks,

0 Kudos

I found the problem. The BAPI has no newer version on the current system I am working with. So the routine to fill in these three parameters do not exist.

Thx.

Ali