Skip to Content

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

Regarding Bapi

Hi all,

I m Using Bapi BAPI_ACC_DOCUMENT_POST it is working in quality

*

**************************************************************

  • START-OF-SELECTION

**************************************************************

ENDFORM. " BDCDATA

FORM CALL_NEWDOC.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

DOCUMENTHEADER = HEADER

  • CUSTOMERCPD =

  • CONTRACTHEADER =

IMPORTING

OBJ_TYPE = HEADER1

  • OBJ_KEY =

  • OBJ_SYS =

TABLES

ACCOUNTGL = ACCOUNTGL

  • ACCOUNTRECEIVABLE =

  • ACCOUNTPAYABLE =

  • ACCOUNTTAX =

CURRENCYAMOUNT = CURRENCY_AMOUNT

  • CRITERIA =

  • VALUEFIELD =

  • EXTENSION1 =

RETURN = RETURN

  • PAYMENTCARD =

  • CONTRACTITEM =

  • EXTENSION2 =

  • REALESTATE =

.

DATA: BELNR LIKE BSEG-BELNR.

IF RETURN-TYPE NA 'EA'.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

  • IMPORTING

  • RETURN = RETURN.

BELNR = RETURN-MESSAGE_V2+0(10).

WRITE:/ 'Document Generated',BELNR.

ELSE.

WRITE:/ RETURN-MESSAGE.

ENDIF.

DATA: BUZEI LIKE BSEG-BUZEI.

LOOP AT ITAB.

BUZEI = SY-TABIX.

UPDATE BSEG SET BUPLA = ITAB-BUPLA

WHERE BELNR = BELNR AND BUKRS = ITAB-BUKRS AND BUZEI = BUZEI.

  • IF SY-SUBRC = 0.

  • WRITE:/ ' UPDATE'.

  • ENDIF.

CLEAR BUZEI.

ENDLOOP.

REFRESH:HEADER,ACCOUNTGL,CURRENCY_AMOUNT.

ENDFORM.

Please,Reply its argent.......

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