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 Member
0 Likes
1,370

Dear all,

     When I made posting document using 'BAPI_ACC_DOCUMENT_POST', WBS element is incorrect for only withholding tax lines like the below figure.

     Actually, wbs should be A/D02 & B/D02 respectively.

     Your reply would be great help for me.

The coding using for posting document is:

CLEAR IT_ACCOUNTGL1.
       IT_ACCOUNTGL1-ITEMNO_ACC  = CN.
       IT_ACCOUNTGL1-GL_ACCOUNT  = GT_100-KSTAR.
       IT_ACCOUNTGL1-WBS_ELEMENT = GT_100-RECV_POSID.
       IT_ACCOUNTGL1-COSTCENTER  = GT_100-KOSTL.
       IT_ACCOUNTGL1-BUS_AREA    = GT_100-GSBER.
       APPEND IT_ACCOUNTGL1.

CLEAR IT_CURRENCYAMOUNT1.
       IT_CURRENCYAMOUNT1-ITEMNO_ACC   = CN.
       IT_CURRENCYAMOUNT1-CURR_TYPE    = '00'.
       IT_CURRENCYAMOUNT1-CURRENCY     = GT_100-OWAER.
       IT_CURRENCYAMOUNT1-AMT_DOCCUR   = LV_AMT.
       APPEND IT_CURRENCYAMOUNT1.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

        EXPORTING

          DOCUMENTHEADER = GD_DOCUMENTHEADER

        TABLES

          ACCOUNTGL      = IT_ACCOUNTGL1

          CURRENCYAMOUNT = IT_CURRENCYAMOUNT1

          RETURN         = IT_RETURN.

In the table IT_RETURN, shows the information that changed wbs element.

2WKI188T/D01-A-2100000 WBS belong to business area 9100 not 9200
0WBST/D01-A-210000091009200
3IKI163Business area 9200 changed to 9100
092009100

Thanks advance.

Regards,

Thi Tra

1 ACCEPTED SOLUTION
Read only

former_member209920
Active Participant
0 Likes
1,058

Hi

Please check that the corresponding PROFIT CENTER are posted correctly or not.

WBS_ELEMENT could come from PROFIT CENTER.

Regards,

ManuB

3 REPLIES 3
Read only

former_member209920
Active Participant
0 Likes
1,059

Hi

Please check that the corresponding PROFIT CENTER are posted correctly or not.

WBS_ELEMENT could come from PROFIT CENTER.

Regards,

ManuB

Read only

0 Likes
1,058

Dear ManuB,

                      The business area,profit center & cost center are changed automatically when wbs_element T/D01-2100000 is changed in posting document.(like the attached picture in original post)

                    

Thanks for your reply.

Regards,

Thi Tra

Read only

0 Likes
1,058

Dear ManuB,

          The above inconsistencies is caused by the substitution enhancement in our system. Thus, I made changes in it. After that, it works well & my problem also solved.

Thanks you.

Regards,

Tra.