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 Back-Dating Posting Date?

Former Member
0 Likes
1,939

Hi Forums,

I have a requirement to pass a date in the past for some GL postings, I have found that even if I pass a posting date that is in the past the BAPI will overwrite it with sy-datum.

Anyone ever had this same issue and what did yo do to get around it?

thanks!

5 REPLIES 5
Read only

Former Member
1,413

hi

in my opinon, this BAPI hasn't such limitation....

maybe this posting date is changed by some FI-substitution ?

(check this in GGB1 transaction)

regards,darek

Read only

0 Likes
1,413

Darak,

what do you mean by FI Substitution?

I am passing the Posting date to the header of the document as so:

Should this not give me the posting date that I want, even when this is done it will put in today's date for posting date.

that said, Document date will be change to what is entered by user



  gv_posting_date = p_pstdt.
  gv_doc_header-doc_date = gv_posting_date.
  gv_doc_header-comp_code = pcard_post_rec-zlsapco.
  gv_doc_header-username = sy-uname.
  gv_doc_header-doc_type = doctype.  "'YP'.

Read only

0 Likes
1,413

hi,

1)

if you want set posting date you need following line:


  gv_doc_header-PSTNG_DATE = gv_posting_date.

2) FI subsitution it is kind of customisation which may overwrite some data

passed to this BAPI,

example:

"for document type YP set posting date to sy-datum"

regards, darek

Read only

0 Likes
1,413

thanks Darak,

Sorry I posted the wrong piece of code but I am setting the posting date to gv_posting_date.



  gv_doc_header2-doc_date = gv_posting_date.
  gv_doc_header2-pstng_date = gv_posting_date.
  gv_doc_header2-header_txt = lv_hdrtxt.
  gv_doc_header2-fisc_year = gv_curr_year.
  gv_doc_header2-trans_date = gv_posting_date.

Read only

0 Likes
1,413

Hello all,

the header was being overwritten by the posting date in the DETAIL items... once I changed this to be the same as the header it back dated in the GL