giovedì 18 giugno 2009

Testi per documenti contabili

Per poter creare e leggere dei testi associati ad un particolare documento contabile è possibile usare la seguente function specificando il numero documento, il tipo documento, la società e l'esercizio.

CALL FUNCTION 'FI_TEXTS_DOCUMENT'

EXPORTING

i_aktyp = 'H'

i_belnr = bkpf-belnr

i_blart = bkpf-blart

i_bukrs = bkpf-bukrs

* I_CHECK = ' '

i_dyncl = 'B'

i_gjahr = bkpf-bldat(4)

i_object = 'BELEG'

i_give_back_ids = 'X'

* I_CLEAR_XUPD = ' '

* IMPORTING

* E_UPDATE =

TABLES

t_tdid = gt_tdid

* T_ACCDN =

* EXCEPTIONS

* NO_TEXTS_FOUND = 1

* INCORRECT_OBJECT = 2

* OTHERS = 3

Questa function farà comparire una popup come quella sottostante:





In questa popup è possibile inserire i testi necessari da allegare al documento contabile.

Per poter rendere effettive le modifiche è necessario chiamare la seguente funzione:

CALL FUNCTION 'FI_TEXTS_DOCUMENT_UPDATE'

EXPORTING

i_bukrs = g_bkpf-bukrs

i_gjahr = g_bkpf-gjahr

i_belnr = g_bkpf-belnr

i_intern = 'X'

i_update_deferred = ' '

EXCEPTIONS

error_message = 9.



Infine per poter leggere i testi appena creati basta chiamare la funzione indicando come name la concatenazione di bukrs + belnr + gjhar. ATTENZIONE: la società deve contenere eventualmente i caratteri blank.



CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = '0001'

language = sy-langu

name = dat_call_bseg

object = 'BELEG'

* ARCHIVE_HANDLE = 0

* IMPORTING

* HEADER =

TABLES

lines = tb_testi

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.




Nessun commento:

Posta un commento