Skip to Content
0
Jul 05, 2011 at 06:20 AM

Problem in getting fiscal year from table BKPF while posting through F-37

56 Views

Hello,

In a scenario i have some receipt data in ztable. receipt no. cheque number and amount. Now i load the data from ztable into internal table it_post and the when i press button save , i post the entries through BDC for F-37 in background processing mode. The BDC is working fine and generating document numbers but i am not getting the fiscal year.

The code part is like this.

After BDC is run the messages are in messtab. So i do

LOOP AT messtab.

IF messtab-msgtyp EQ 'S'.

wa_post-belnr = messtab-msgv1.

MODIFY it_post FROM wa_post.

ENDIF.

Now when all the documents are generated. I do ->

LOOP AT it_post INTO wa_post WHERE belnr NE ' '.

SELECT SINGLE gjahr FROM bkpf INTO wa_post-gjahr WHERE bukrs = wa_post-bukrs

AND belnr = wa_post-belnr

AND budat = wa_post-budat.

IF sy-subrc = 0.

modify it_post FROM wa_post.

ENDIF.

ENDLOOP.

But by doing this i am not getting fiscal year properly. What is the problem? Am i missing anything?

Plz guide.

Edited by: Yayati6260 on Jul 5, 2011 8:20 AM