Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

POSTING_INTERFACE_DOCUMENT for FBS!

Hi,

I've written a program to simulate transaction FBS1 using

FUNCTION 'POSTING_INTERFACE_DOCUMENT', it goes through with sy-subrc set 0, but I cannot see the document number in T_BLNTAB, the code is below, I think I have all the right Parameters.

DATA: i_msgid LIKE sy-msgid,

i_msgno LIKE sy-msgno,

i_msgty LIKE sy-msgty,

i_msgv1 LIKE sy-msgv1,

i_msgv2 LIKE sy-msgv2,

i_msgv3 LIKE sy-msgv3,

i_msgv4 LIKE sy-msgv4,

i_subrc LIKE sy-subrc.

DATA: ftpost LIKE ftpost OCCURS 0 WITH HEADER LINE,

fttax LIKE fttax OCCURS 1 WITH HEADER LINE,

blntab LIKE blntab OCCURS 1 WITH HEADER LINE.

  • blntab-BELNR =

*blntab-BUKRS = 2000.

*blntab-GJAHR =

  • Header Information first

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-BLDAT'.

ftpost-fval = '310506'.

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-BLART'.

ftpost-fval = 'SA'.

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-BUKRS' .

ftpost-fval = '2000' .

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-BUDAT' .

ftpost-fval = '310506' .

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-WAERS' .

ftpost-fval = 'GBP' .

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-XBLNR ' .

ftpost-fval = 'ACCRUAL POST' .

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-STGRD' .

ftpost-fval = '05' .

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'BKPF-STODT' .

ftpost-fval = '010606'.

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'FS006-DOCID' .

ftpost-fval = '*'.

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'RF05A-NEWBS' .

ftpost-fval = '40'.

ftpost-stype ='K'.

ftpost-count = 1.

ftpost-fnam = 'RF05A-NEWKO' .

ftpost-fval = '476000'.

*Line Items Now

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'BSEG-WRBTR' .

ftpost-fval = '5000' .

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'BSEG-MWSKZ' .

ftpost-fval = 'v0' .

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'BSEG-SGTXT' .

ftpost-fval = 'pallet of photo paper' .

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'BDC_SUBSCR' .

ftpost-fval = 'SAPLKACB' .

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'DKACB-FMORE' .

ftpost-fval = 'X'.

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'COBL-KOSTL' .

ftpost-fval = '2-1000 '.

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'COBL-FIPOS ' .

ftpost-fval = ''.

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'BSEG-DMBE2' .

ftpost-fval = '70.42' .

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'RF05A-NEWBS' .

ftpost-fval = '40' .

ftpost-stype ='P'.

ftpost-count = 1.

ftpost-fnam = 'RF05A-NEWKO' .

ftpost-fval = '417000'.

  • Item no. 2

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'BSEG-WRBTR' .

ftpost-fval = '500' .

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'BSEG-MWSKZ' .

ftpost-fval = 'V0'.

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'BSEG-SGTXT' .

ftpost-fval = 'marketing assistants'.

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'DKACB-FMORE' .

ftpost-fval = 'X'.

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'COBL-AUFNR' .

ftpost-fval = ' 400157 '.

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'BSEG-DMBE2' .

ftpost-fval = '7.04'.

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'RF05A-NEWBS' .

ftpost-fval = '50' .

ftpost-stype ='P'.

ftpost-count = 2.

ftpost-fnam = 'RF05A-NEWKO' .

ftpost-fval = '89000' .

  • Next Line

ftpost-stype ='P'.

ftpost-count = 3.

ftpost-fnam = 'BSEG-WRBTR' .

ftpost-fval = '5500'.

ftpost-stype ='P'.

ftpost-count = 3.

ftpost-fnam = 'BSEG-MWSKZ' .

ftpost-fval = 'V0' .

ftpost-stype ='P'.

ftpost-count = 3.

ftpost-fnam = 'BSEG-SGTXT' .

ftpost-fval = 'accrual posting bala' .

*Next Line

ftpost-stype ='P'.

ftpost-count = 4.

ftpost-fnam = 'BSEG-WRBTR' .

ftpost-fval = '5500'.

ftpost-stype ='P'.

ftpost-count = 4.

ftpost-fnam = 'BSEG-MWSKZ' .

ftpost-fval = 'V0' .

ftpost-stype ='P'.

ftpost-count = 4.

ftpost-fnam = 'BSEG-SGTXT' .

ftpost-fval = 'accrual posting bala' .

ftpost-stype ='P'.

ftpost-count = 4.

ftpost-fnam = 'COBL-GSBER ' .

ftpost-fval = '1000' .

CALL FUNCTION 'POSTING_INTERFACE_DOCUMENT'

EXPORTING

i_tcode = 'FBS1'

  • I_SGFUNCT = ' '

  • I_NO_AUTH = ' '

IMPORTING

e_msgid = i_msgid

e_msgno = i_msgno

e_msgty = i_msgty

e_msgv1 = i_msgv1

e_msgv2 = i_msgv2

e_msgv3 = i_msgv3

e_msgv4 = i_msgv4

e_subrc = i_subrc

TABLES

t_blntab = blntab

t_ftpost = ftpost

t_fttax = fttax

EXCEPTIONS

account_missing = 1

company_code_missing = 2

posting_key_invalid = 3

posting_key_missing = 4

record_type_invalid = 5

transaction_code_invalid = 6

amount_format_error = 7

too_many_line_items = 8

OTHERS = 9.

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Any ideas anyone?

Many Thanks Sims

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question