Chinaunix首页 | 论坛 | 博客
  • 博客访问: 100206
  • 博文数量: 55
  • 博客积分: 530
  • 博客等级: 中士
  • 技术积分: 460
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-02 11:21
个人简介

大龄ABAP自由顾问

文章分类

全部博文(55)

文章存档

2016年(1)

2015年(4)

2014年(14)

2013年(2)

2012年(3)

2011年(31)

我的朋友

分类: 项目管理

2011-08-12 15:52:10

Hi,
is there a bapi allowing to create an incoming invoice an saving it as completed?.

i don´t need to park it.

i´d like to save the document as completed.

(i did try with BAPI_INCOMINGINVOICE_PARK but what i got was a parked document and what i need is a document saved as completed).

it is as if you cliked "Saved as completed" button of transaction MIR7.

Best regards.

-----------------------------------------------------------------------------------

To all people interested this is how i solved the question:


CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
  EXPORTING
    headerdata       = x_in_header
  IMPORTING
    invoicedocnumber = lc_belnr
    fiscalyear       = lc_gjahr
  TABLES
    itemdata         = i_in_item
    return           = i_return.
 
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = 'X'.
 
  CALL FUNCTION 'MRM_INVOICE_READ'
    EXPORTING
      i_belnr = lc_belnr
      i_gjahr = lc_gjahr
    IMPORTING
      e_rbkpv = s_rbkpv
    TABLES
      t_drseg = tab_drseg
      t_rbselbest = l_t_selbest
      t_rbsellifs = l_t_sellifs
      t_rbselfrbr = l_t_selfrbr
      t_rbselwerk = l_t_selwerk
      t_rbselerfb = l_t_selerfb.
 
 PERFORM drseg_complete(SAPLMR1M) USING     s_rbkpv
                                            'V'
                                            space
                                  CHANGING  tab_drseg[].
 
* As the next routine checks ok-code not initial i have to
* pass a value to the ok-code
DATA: c_okqu(17)   TYPE c VALUE '(SAPLMR1M)OK-CODE'.
FIELD-SYMBOLS: TYPE ANY.
ASSIGN (c_okqu) TO .
= 'COMP'.
 
 
DATA: ok-code(20).
DATA:      l_trtyp     LIKE t169-trtyp value 'V'.
CONSTANTS: l_okcode    LIKE  ok-code VALUE 'COMP'.
 
 
PERFORM document_park(SAPLMR1M) USING s_rbkpv
                             tab_drseg[]
                             l_t_selbest[]
                             l_t_selfrbr[]
                             l_t_sellifs[]
                             l_t_selwerk[]
                             l_t_selerfb[]
                             l_trtyp          "akt_typ
                             l_okcode.       "fcocomp.
 

Note that the key here was the two routines drseg_complete and document_park

阅读(9648) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~