2010 Mar 23 6:46 AM
Hello!
I need your advice. I have task - Сlear field XREF2_HD in table BKPF when FI document is posting (FB01, for excemple).
I`m using BTE 1120 "Substitute header and items", belong you can see FM code which i use:
FUNCTION ZSAMPLE_PROCESS_00001120.
*"----
""Локальный интерфейс:
*" IMPORTING
*" VALUE(I_BKDF) TYPE BKDF OPTIONAL
*" TABLES
*" T_BKPF STRUCTURE BKPF
*" T_BSEG STRUCTURE BSEG
*" T_BKPFSUB STRUCTURE BKPF_SUBST
*" T_BSEGSUB STRUCTURE BSEG_SUBST
*" T_BSEC STRUCTURE BSEC OPTIONAL
*" CHANGING
*" REFERENCE(I_BKDFSUB) TYPE BKDF_SUBST OPTIONAL
*"----
BREAK-POINT.
LOOP AT T_BKPF.
T_BKPF-XREF2_HD = '!!!!'.
MODIFY T_BKPF INDEX SY-TABIX.
ENDLOOP.
ENDFUNCTION.
But after execute this FM, all changes in T_BKPF are rollbacked (it`s OK, becouse after execute T_BKPF is rewrited from local table L_BKPF).
I think, i should i change data in T_BKPFSUB table, but field XREF2_HD is`t included into BKPF_SUBST structure. So, i have two questons:
1. How i can add field XREF2_HD into BKPF_SUBST?
2. What can i do?
The best regreades, DrAlex
2010 Mar 23 9:57 AM
You are right, using a where-used option on OPEN_FI_PERFORM_00001120_P, display a MOVE-CORRESPONDING from BKPF_SUBST to XBKPF internal table.
It does not seem to exist any point to enhance this structure in standard, you may append fields to this structure that should update BKPF (creating append ZABKPF_SUBST) but that may cause inconsistencies in other database tables, you could try to use a substitution rule (OBBH) and not the BTE to fulfil your requirement.
Regards,
Raymond
2010 Mar 23 9:57 AM
You are right, using a where-used option on OPEN_FI_PERFORM_00001120_P, display a MOVE-CORRESPONDING from BKPF_SUBST to XBKPF internal table.
It does not seem to exist any point to enhance this structure in standard, you may append fields to this structure that should update BKPF (creating append ZABKPF_SUBST) but that may cause inconsistencies in other database tables, you could try to use a substitution rule (OBBH) and not the BTE to fulfil your requirement.
Regards,
Raymond
2010 Mar 23 10:53 AM
Hi, Raymond!
Thanks!
Yes, i checked variant about substetution with OBBH. But it doesn`t work in my case.
I have finded place "MOVE-CORRESPONDING from BKPF_SUBST to XBKPF" and what can i do? I`m sorry, i didnt catch
Do you mean i should enhice this FM (OPEN_FI_PERFORM_00001120_P)?
2010 Mar 23 12:53 PM
Go to SE11 and create an append to BKPF_SUBST, add your field, activate. Now you can fill the new field in the BTE and it will be updated in calling program via the MOVE-CORRESPONDING.
Alternative : In the BTE, export the value to memory, and create a substitution rule that will import this data (create a user-exit in substitution)
Regards,
Raymond
2010 Mar 24 4:59 AM
2010 Apr 27 4:06 PM
Hello Raymond,
I have one requirement where i need to change t_bkpf and t_bseg values for the BTE 1120 for FI Document posting.Now i have done all the required codings and customization for this BTE. AND i need my BTE to run for F110. But the BTE is not trigerred for F110 but it runs fine for FB01 and F-04 .
Please help if u have come across such issue before.
Thanks in advance.
Regards,
Abhishek.