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

former_member249594
Participant
0 Likes
660

Hi Experts,

I want to create FI Doc through BAPI BAPI_ACC_DOCUMENT_POST. but I do not know how to get the below fields for import parameters DOCUMENTHEADER:

OBJ_TYPE

OBJ_KEY

BUS_ACT

I try to use the function module GET_NEXT_FI_DOCUMENT_NUMBER to get above fields but it do not work, Because OBJ_KEY is the FI doc number, How I can get the FI doc number before calling the BAPI. I try to use the function module NUMBER_GET_NEXT to get next doc number but it seems that it is not a good idea, Would you please give me an example for this issus?? Thanks very much and you will be rewarded if it is helpful.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
540

Joe,

Please leave all the three header fields of the blank :

I think the fields are OBJ_TYPE, OBJ_KEY, and OBJ_SYS. This should be left blank if your are posting an accounting document which has an internal numbering range.

You can probably use ''RFBU' as your BUS_ACT.

Hope it helps.

3 REPLIES 3
Read only

Former Member
0 Likes
541

Joe,

Please leave all the three header fields of the blank :

I think the fields are OBJ_TYPE, OBJ_KEY, and OBJ_SYS. This should be left blank if your are posting an accounting document which has an internal numbering range.

You can probably use ''RFBU' as your BUS_ACT.

Hope it helps.

Read only

Former Member
0 Likes
540

Here's a snippet of code from a place we have used it, which agrees with the post above... our FI document numbers are internally assigned.

Jonathan

* Document header
*
* Sender ID - We don't have an external ref, so let SAP set these
*
  ls_fi_doc_header = is_fi_doc_header.

  ls_fi_doc_header-obj_type   = space.
  ls_fi_doc_header-obj_key    = space.
  ls_fi_doc_header-obj_sys    = space.        "blank for same as current
*
* Fill in some known knowns :-)
*
  ls_fi_doc_header-comp_code  = gc_bukrs.     "Our Company code
  ls_fi_doc_header-username   = sy-uname.     "Current user
  ls_fi_doc_header-bus_act    = gc_glvor_fi_posting. "RFBU

  if ls_fi_doc_header-pstng_date is initial.
    ls_fi_doc_header-pstng_date = sy-datum.   "Post today
  endif.

  if ls_fi_doc_header-doc_date is initial.
    ls_fi_doc_header-doc_date   = sy-datum.   "Assume today
  endif.
*" etc etc

Read only

0 Likes
540

Hi Srihari Hebbar and Jonathan Coleman , the problem had been solved and the issued was closed. Thanks for your kindness.

Joe