‎2008 Nov 27 10:31 AM
Hi experts, I'm trying to update bseg-sgtxt fields with number of document (bkpf-belnr) by saving in FB60 transaction. I'm implenting a BTE by fibf transaction and my custom function is:
FUNCTION ZSAMPLE_INTERFACE_00001030.
*"--------------------------------------------------------------------
*"*"Interfaccia locale:
*" IMPORTING
*" VALUE(I_BKDF) LIKE BKDF STRUCTURE BKDF
*" VALUE(I_UF05A) LIKE UF05A STRUCTURE UF05A
*" VALUE(I_XVBUP) LIKE OFIWA-XVBUP DEFAULT 'X'
*" TABLES
*" T_AUSZ1 STRUCTURE AUSZ1 OPTIONAL
*" T_AUSZ2 STRUCTURE AUSZ2 OPTIONAL
*" T_AUSZ3 STRUCTURE AUSZ_CLR OPTIONAL
*" T_BKP1 STRUCTURE BKP1
*" T_BKPF STRUCTURE BKPF
*" T_BSEC STRUCTURE BSEC
*" T_BSED STRUCTURE BSED
*" T_BSEG STRUCTURE BSEG
*" T_BSET STRUCTURE BSET
*" T_BSEU STRUCTURE BSEU
*"--------------------------------------------------------------------
loop at t_bseg.
concatenate 'protocollo n.:' T_BKPF-BELNR into t_bseg-sgtxt.
Modify t_bseg.
endloop.
ENDFUNCTION.I can see in debug mode value of T_BKPF-BELNR with next number of document and I see the text "protocollo n.:0000030010" in every t_bseg-sgtxt fileld of position document, where '0000030010' is next number of document assigned by system to T_BKPF-BELNR field.
Document is registered correctly but texts in positions are not update.
If I display new document with fb03 transaction, sgtxt fields are blanks.
Where is the problem ?
Thanks.
‎2008 Nov 27 12:51 PM
‎2008 Nov 27 12:57 PM
hi,
use transporting in modify statement for that particular field you want to modify.
‎2008 Nov 27 1:08 PM
Hi
Use modify with index.
loop at t_bseg.
concatenate 'protocollo n.:' T_BKPF-BELNR into t_bseg-sgtxt.
Modify t_bseg tabix sy-index.
endloop.
Regards
Neha
‎2008 Nov 27 2:31 PM
>
> Use modify with index.
>
> loop at t_bseg.
> concatenate 'protocollo n.:' T_BKPF-BELNR into t_bseg-sgtxt.
> Modify t_bseg tabix sy-index.
> endloop.
Need to learn [ABAP System Fields|http://help.sap.com/saphelp_nw04/helpdata/en/7b/fb96c8882811d295a90000e8353423/frameset.htm]
‎2008 Nov 27 1:22 PM
Hi Luca
the problem is you're using the wrong BTE.
The BTE 00001030 is to update your own custom tables: it's usually used to insert the document number into Z-table.
It's useless to try to change the data there, because the system'll restore the original data.
If you want to change some FI data, u need to use the BTE (process) 00001120, the code should be like this:
LOOP AT T_BSEG.
T_BSEGSUB-TABIX = SY-TABIX.
T_BSEGSUB-SGTXT = .......
APPEND T_BSEGSUB.
ENDLOOP.Max
‎2008 Nov 27 2:19 PM
I max, thank you, now I can write a text in position line of my document. But with BTE (process) 00001120 I cannot get next document number assigned by system. In debug mode I can see t_besg-belnr='$1', T_BKPFSUB-belnr=' ' t_bkpf-belnr='$1' and t_bsegsub-belnr=' '.
‎2008 Nov 27 2:29 PM
Hi
So I believe u can't do it by BTE.
The BTE 00001030 (the first one you've tried to use) has the account document number, but it's called after calling the fm POST_DOCUMENT so it's useless to try to change the data there ( u could try to use the field-symbols).
I think u need to insert a Temporary text and replace it after posting the FI document.
Max
‎2009 Feb 24 2:21 AM
‎2009 Jun 30 1:22 PM