‎2010 Mar 29 8:25 PM
Hi,
I am trying to post a document using BAPI "BAPI_ACC_DOCUMENT_POST". But when I was testing this BAPI I got the error that required field for the "Reference document number is missing". We are using the same BAPI in couple of our custom programs and there we are not passing the reference document number in the header data there and it's working fine. So can you please let me know what I am doing wrong here, as per the requirement we don;t have to pass the reference document number.
Thanks,
Rajat
‎2010 Mar 30 1:46 PM
Hi,
If you are not maintaing any reference document number. You can pass some dummy value for all the documents. (Any alpha numeric)
which will solve ur problem.
--Naresh.
‎2010 Mar 29 8:32 PM
What is the exact error message you get (Including number and ID)?
Rob
‎2010 Mar 29 8:34 PM
Hi Rob,
I am getting this message "RW 602 Required Field was not transferred in Parameter"
Thanks,
Rajat
‎2010 Mar 29 8:44 PM
Some FI document types require a reference number; others don't.
So change the document type to one that doesn't require a reference document.
Rob
‎2010 Mar 30 1:29 PM
Hi Rob,
Basically I need to put a value in for this field "OBJ_KEY Reference number of source document". Do you know any document type that doesn't require reference document number.
Thanks,
Rajat
‎2010 Mar 30 1:36 PM
Hi Rob,
Basically we need to use document type "KR" for vendor invoice...can you suggest me any other BAPI which i can try ?
Your help is much appreciated.
Thanks,
Rajat
‎2010 Mar 30 1:38 PM
Hi
In header u need to pass fields
BUS_ACT = 'RFBU'.
HEADER_TXT = "Any Text".
COMP_CODE = "Company Code'.
DOC_DATE = SY-DATUM.
PSTNG_DATE = SY-DATUM.
FISC_YEAR = SY-DATUM+0(4).
FIS_PERIOD = SY-DATUM+4(2).
DOC_TYPE = "Doc type" (eg SA).
REF_DOC_NO = Referance number must like sales order or serivce order or any value.
This is just referance it will store in field xblnr.
Regards,
Raghu.
‎2010 Mar 30 1:43 PM
Hi Raghu,
The whole problem is we don't want to have a reference document number.
‎2010 Mar 30 1:46 PM
Hi,
If you are not maintaing any reference document number. You can pass some dummy value for all the documents. (Any alpha numeric)
which will solve ur problem.
--Naresh.
‎2010 Mar 30 3:34 PM
Hi Naresh,
Thanks for the reply.... when I put a dummy number in the field I got the following error message:
Error in document: RFBU 111111111111ABCDEGHD RXXCLNT200
FI/CO interface: Object type RFBU not defined
Can you please advise on this.
Thanks,
Rajat
‎2010 Mar 30 8:43 PM
‎2010 Mar 31 5:29 AM
What is the value you have passed in DOCUMENTHEADER-REF_DOC_NO?
Regards
Vinod
‎2010 Mar 31 7:17 AM
Hello Rajat,
Dont pass any values to obj_type, obj_key and obj_sys variables. What document you are tring to post by using this BAPI.
--Naresh.
Edited by: naresh durki on Mar 31, 2010 8:20 AM
‎2010 Mar 31 8:37 PM
Hi Naresh,
We are trying to post a vendor Invoice. I created a test program and calling the BAPI in there and following is the coe for the same:
DATA: WA_DOCUMENT_HEADER LIKE BAPIACHE09,
LW_ACCOUNTGL LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,
LW_CURRENCYAMOUNT LIKE BAPIACCR09 OCCURS 0 WITH HEADER LINE,
COMPANYCODEID LIKE BAPI0002_2-COMP_CODE,
POSTING_DATE LIKE BAPI0002_4-POSTING_DATE,
EFISCAL_YEAR LIKE BAPI0002_4-FISCAL_YEAR,
EFISCAL_PERIOD LIKE BAPI0002_4-FISCAL_PERIOD,
RETURN LIKE BAPIRETURN1,
T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: C_RFBU(04) VALUE 'RFBU',
L_POSTING_SUCCESS_MESSAGE TYPE SYMSGNO.
*POSTING_DATE = Sy-DATUM.
COMPANYCODEID = C_BUKRS.
WA_DOCUMENT_HEADER-BUS_ACT = C_RFBU.
WA_DOCUMENT_HEADER-USERNAME = SY-UNAME.
WA_DOCUMENT_HEADER-HEADER_TXT = 'test posting'.
WA_DOCUMENT_HEADER-COMP_CODE = 'XX'.
WA_DOCUMENT_HEADER-DOC_DATE = SY-DATUM.
WA_DOCUMENT_HEADER-PSTNG_DATE = SY-DATUM.
WA_DOCUMENT_HEADER-FISC_YEAR = '2010'.
WA_DOCUMENT_HEADER-FIS_PERIOD = '1'.
WA_DOCUMENT_HEADER-DOC_TYPE = 'JE'.
LW_ACCOUNTGL-ITEMNO_ACC = '1'.
LW_ACCOUNTGL-GL_ACCOUNT = '500000'.
LW_ACCOUNTGL-FUNC_AREA = '5'.
LW_ACCOUNTGL-FUND = 'ZZ00002'.
LW_ACCOUNTGL-COSTCENTER = '991023456'.
LW_ACCOUNTGL-BUS_AREA = 'U'.
APPEND LW_ACCOUNTGL.
LW_CURRENCYAMOUNT-ITEMNO_ACC = '1'.
LW_CURRENCYAMOUNT-CURRENCY = 'USD'.
LW_CURRENCYAMOUNT-AMT_DOCCUR = '100'.
APPEND LW_CURRENCYAMOUNT. CLEAR LW_CURRENCYAMOUNT.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = WA_DOCUMENT_HEADER
TABLES
ACCOUNTGL = LW_ACCOUNTGL
CURRENCYAMOUNT = LW_CURRENCYAMOUNT
* EXTENSION1 =
RETURN = T_RETURN.
Edited by: rajatg on Mar 31, 2010 9:38 PM
‎2010 Mar 31 8:39 PM
and now when I checked the Return table it has the following error messages:
4 E F5 507 G/L account 500000 is not defined in chart of accounts XX
5 E FH 004 Account 500000 does not exist in chart of accounts XX
6 E FI 311 No commitment item entered in item 00000 UC 500000
7 W GRANTMGMT 517 GL account/cost element 500000/ has not been set up for updating in grants
______________________________
I also checked tcode FS00 and found that this G/L account is there.
Please advise...
Thanks,
Rajat
‎2010 Mar 31 8:51 PM
Rajat - your original question seems to have been answered. Please assign po1nts to the helpful answers and close this thread. You can start a new thread with the new question, but my advice is to search the forum before asking it.
Rob
‎2010 Mar 31 8:58 PM
Ok Rob.. I will do that. I did a search and couldn;t find tha appropriate answer. I will open a new thread and will clsoe this one.
Thaks,
Rajat
‎2010 Mar 31 9:47 PM
Rajat - I notice that you marked this as solved by giving full po1nts to the answer that said basically "use a dummy reference document"; however, in the code you post above, you are in fact using a different document type instead.
A couple of points:
People do search the forum looking for posts that are solved to answer their own questions. If you don't take care when assigning po1nts, then users who search will not get as much out of this thread as they could.
You say you are creating a vendor invoice, but the document type you actually use looks like a journal entry document type. I doubt if your users are going to approve of this.
Rob
‎2010 Mar 30 1:47 PM
HI
Referance number will depend on the Doc_type u pass.
For some doc_type this field is mandatory. Check u r configuration for the
document type u r passing.
Regards,
Raghu.
‎2010 Mar 30 2:03 PM
Hi, try to post the same info that u r passing to the BAPI, using tcode F-02 and check if u receive the same message.
Otherwise, the FI consultant should have to change the parametrization of that doc class.
Regards