cancel
Showing results for 
Search instead for 
Did you mean: 

about bapi 'RFIDPT_ACC_DOCUMENT_POST_ADJ' to create Document Number

Former Member
0 Kudos

hi experts:

I use the bapi 'RFIDPT_ACC_DOCUMENT_POST_ADJ' or 'BAPI_ACC_DOCUMENT_POST' to create Document Number,I enter the po_number,but in

po's history,I can not see the Document Number.

and when I use t-code f-48 to create Document Number,in po's history,I can see the Document Number.

my question is,why I can not see the Document Number in po's history.

the code :

REPORT z1807fiaccountingtest001.

DATA:n1(10) TYPE n,

n2(10) TYPE n.

DATA: e_bukrs TYPE bukrs,

e_belnr TYPE belnr_d,

e_gjahr TYPE gjahr.

DATA:v(1) TYPE c.

DATA:

xacchd LIKE acchd OCCURS 1 WITH HEADER LINE,

xaccit LIKE accit OCCURS 10 WITH HEADER LINE,

yaccit LIKE accit OCCURS 10 WITH HEADER LINE,

xacccr LIKE acccr OCCURS 10 WITH HEADER LINE.

DATA: wa_return TYPE message_struct,

t_return LIKE message_struct OCCURS 10 WITH HEADER LINE,

return LIKE bapiret2 OCCURS 1 WITH HEADER LINE,

l_subrc TYPE sysubrc.

xacchd-bktxt = 'BAPI TEST'.

xacchd-awtyp = 'BKPF '.

xacchd-glvor = 'RFBU'.

xacchd-tcode = 'FBA7'.

APPEND xacchd.

CLEAR:xacchd.

****贷方

xaccit-posnr = 1.

xaccit-bukrs = '8088'.

xaccit-xref1 = '1000000001'."将单号存入'参照

xaccit-blart = 'KZ'. "凭证类型

xaccit-bldat = sy-datum."凭证中的凭证日期

xaccit-budat = sy-datum."凭证中的记账日期

xaccit-bschl = '50'."记账码

xaccit-fipos = '1001000'.

xaccit-vorgn = 'RFBU'. "总帐事务类型

xaccit-shkzg = 'H'.

xaccit-koart = 'K'. "帐户类型A资产D客户K供应商M物料S总分类帐科目

xaccit-sgtxt = 'test1'.

xaccit-hkont = '0001000005'. "总分类帐帐目

xaccit-lifnr = '0006001511'."供应商或债权人的帐号

xaccit-zfbdt = sy-datum. "基准日期

xaccit-rmvct = 'Z00'. "事务类型

APPEND:xaccit.

CLEAR:xaccit.

xacccr-posnr = 1.

xacccr-curtp = '00'.

xacccr-waers = 'RMB'.

xacccr-wrbtr = - 5.

APPEND xacccr.

CLEAR:xacccr.

****借方

xaccit-posnr = 2.

xaccit-bukrs = '8088'.

xaccit-blart = 'KZ'. "凭证类型

xaccit-bldat = sy-datum."凭证中的凭证日期

xaccit-budat = sy-datum."凭证中的记账日期

xaccit-bschl = '29'. "记帐代码

xaccit-shkzg = 'S'. "借方s/贷方h标识

xaccit-koart = 'K'. "帐户类型

xaccit-umskz = 'A'.

xaccit-fipos = '9900000'.

xaccit-nebtr = 5. "净收付金额

xaccit-vorgn = 'AZBU'. "总帐事务类型

xaccit-lifnr = '0006001511'."供应商或债权人的帐号

xaccit-ebeln = '4500000896'. "订单号

xaccit-ebelp = '00010'. "订单行项目号

xaccit-sgtxt = 'test'. "项目文本

xaccit-zfbdt = sy-datum. "用于到期日计算的基准日期

APPEND:xaccit.

CLEAR:xaccit.

xacccr-posnr = 2.

xacccr-curtp = '00'.

xacccr-waers = 'RMB'.

xacccr-wrbtr = 5.

APPEND xacccr.

CLEAR:xacccr.

CALL FUNCTION 'RFIDPT_ACC_DOCUMENT_POST_ADJ'

  • EXPORTING

  • I_COMP = ' '

  • I_COMP_CHECK = ' '

  • I_FREE_TABLE = 'X'

  • I_TEST = ' '

IMPORTING

e_bukrs = e_bukrs

e_belnr = e_belnr

e_gjahr = e_gjahr

TABLES

t_acchd = xacchd

t_accit = xaccit

t_acccr = xacccr

  • T_ACCTX =

t_return = t_return

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Wei,

Remember.whenever you use BAPI to do transaction, after you input all the data into BAPI,you have to commit the bapi.

for example..

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader =

  • CUSTOMERCPD =

  • CONTRACTHEADER =

  • IMPORTING

  • OBJ_TYPE =

  • OBJ_KEY =

  • OBJ_SYS =

tables

  • ACCOUNTGL =

  • ACCOUNTRECEIVABLE =

  • ACCOUNTPAYABLE =

  • ACCOUNTTAX =

currencyamount =

  • CRITERIA =

  • VALUEFIELD =

  • EXTENSION1 =

return =

  • PAYMENTCARD =

  • CONTRACTITEM =

  • EXTENSION2 =

  • REALESTATE =

.

Based on return table values,if type = 'S' you have to execute this BAPI.Otherwise the transaction won't commit.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

WAIT = 'X'

  • IMPORTING

  • RETURN =

.

Try this.

Best Regards,

Mohan.

Answers (0)