Application Development 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: 

BAPI_ACC_DOCUMENT_POST cannot post to posting key 25

siongchao_ng
Contributor
0 Kudos
150

Hi all,

How do I post to posting key 25?

I am checking for posting key = 25 then set the relevant gl account number.

However I got the wrong result in FB03. It is automatically set to posting key 40 instead.

Anyone have any idea??

gw_accountgl-bus_area = 'RFBU'.
    gw_accountgl-doc_type = 'ZP'.
    gw_accountgl-itemno_acc  = g_doc_count. "g_doc_line.
*    gw_accountgl-gl_account  = gw_post_rec-saknr.
*    gw_accountgl-vendor_no   = '1001941'.
    IF gw_post_rec-bschl = '25'.
*      gw_accountgl-gl_account  = space.
      IF gw_post_rec-gsber = 'RDF'.
        gw_accountgl-gl_account  = '561004'.
      ELSE.
        gw_accountgl-gl_account  = '561002'.

      ENDIF.
*      gw_accountgl-vendor_no   = '1001941'.

    ELSEIF gw_post_rec-bschl = '50'.
      IF gw_post_rec-gsber = 'RDF'.
        gw_accountgl-gl_account  = '561004'.
      ELSE.
        gw_accountgl-gl_account  = '561002'.
0 REPLIES 0