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_CHECK

Former Member
0 Likes
4,639

Dear experts,

We need help in one of the BAPI's BAPI_ACC_DOCUMENT_CHECK to post document.

BAPI working successfully if company code at header and item level is same but if items are from different company codes then we received error saying "Required fieldsOBJ_TYPE, OBJ_KEY, OBJ_SYS are blank.".

When searched forums on this, we found these fields are not mandatory however we receive the error message.

Also, found many threads on this but didnt get a proper link as to how can we proceed to resolve this issue.

Can you please help us if any data we entered is incorrect or we are missing with some functional configuration.

Thanks for your time.

1 ACCEPTED SOLUTION
Read only

eduardo_hinojosa
Active Contributor
0 Likes
4,136

Hi

See SAP Note 306504 - Collective note: BAPIs for the AC interface, about these fields.

Regards

Eduardo

12 REPLIES 12
Read only

eduardo_hinojosa
Active Contributor
0 Likes
4,137

Hi

See SAP Note 306504 - Collective note: BAPIs for the AC interface, about these fields.

Regards

Eduardo

Read only

0 Likes
4,136

Thanks Eduardo. We did checked this note earlier but didnt found helpful to resolve our issue.

Read only

Former Member
0 Likes
4,136

Hi

You have different company code between item and header for the same document?

Max

Read only

0 Likes
4,136

Hi Park,

If item-company code NE header-company code then you need to pass profit center in item level this is based on configuration it will work.

BAPI_ACC_DOCUMENT_CHECK is for to check all the itmes are correct or not . Not to post the document

Bettter to use BAPI_ACC_DOCUMENT_POST to post the documents .

Read only

0 Likes
4,136

Yes, Max.

Read only

0 Likes
4,136

Hi Devireddy,

Before posting we check the data and if no errors we pass the same data to FM "BAPI_ACC_DOCUMENT_POST".

We are also entering the Profit Center and Cost Center values for each line item.

Thanks.

Read only

0 Likes
4,136

Uhm

I've never posted document having a different company code between header and item...can you give us the class and number message?

Max

Read only

0 Likes
4,136

More thoughts we would like to share, If Header & items are of same Company Code the same BAPI is working good however an

error is encountered for cross Company Codes.

Message Class for the errors messages are --

TYPE: E, ID : RW, NUMBER: 602, Message: Required field was not trnasferred DOCUMENTHEADER - OBJ_TYPE

message id : RW, message No. 602 and Message : Required field was not trnasferred DOCUMENTHEADER - OBJ_TYPETYPE: E, ID : RW, NUMBER: 602, Message: Required field was not trnasferred DOCUMENTHEADER - OBJ_TYPE

erroe message, message id : RW, message No. 602 and Message : Required field was not trnasferred DOCUMENTHEADER - OBJ_TYPE

Gunasekhar -

We are not sure what values we need to provide for OBJ_TYPE Sender identification, OBJ_KEY Reference number of the source document, OBJ_SYS Logical system of the source document.

We tried creating a dummy entry at TTYP but things got worse and received a dump.

Dummy values we entered -

OBJ_TYPE - ZBKKPF

OBJ_KEY - $

OBJ_SYS - QU-NAM

Read only

0 Likes
4,136

Any thoughts?

Read only

0 Likes
4,136

Try to check the routine check_and_fill_acc_document, here you should see the following code:

 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.

The routine reference_create_prelim should be called and those fields should be filled

Max

Read only

Former Member
0 Likes
4,136

Import parameter "DOCUMENTHEADER" is mandatory and it has fields AWTYP - Reference Transaction, OBJ_KEY - Reference Key, OBJ_SYS - Logical system of source document.

Parameters for the transfer of document header data.

The following fields must be filled:

OBJ_TYPE Sender identification

OBJ_KEY Reference number of the source document

OBJ_SYS Logical system of the source document

COMP_CODE Company code

PSTNG_DATE Posting date

BUS_ACT Business transaction

USERNAME Document creator

Fill these fields and try again.

Read only

Former Member
0 Likes
4,136

Hi Park  Anderson,

I want to add two more fields through extension1 in Bapi_acc_documnet_check. Can anyone explain me what I should do?? and also explain me what is documentheader importing parameter. What are the necessary fields I have to fill in that? thanks in advance.