2015 Feb 06 9:03 AM
Hi Experts,
I have a requirement to change Reference field value in Transaction code - FB02,So anyone can suggest me which is the better way to change the Reference field value in Transaction code - FB02 like BDC, BAPI or BADI.
Thanks .
2015 Feb 06 1:32 PM
Hello,
You can use following FM
CALL FUNCTION 'FI_DOCUMENT_CHANGE''
EXPORTING
I_AWTYP =
I_AWREF = GV_REF
I_AWORG = GV_ORG
I_KUNNR =
TABLES
T_ACCCHG = IT_ACCCHG
Pass value as:
I_AWTYP = BKPF-AWTYP
GV_REF = BKPF-AWKEY(10)
GV_ORG = BKPF-AWKEY+10
I_KUNNR = BSEG-KUNNR
Internal table it_accchg contains the field and the value to be changed as:
wa_accchg-fdname = 'XBLNR'
wa_accchg-oldval = Old value of XBLNR
wa_accchg-newval = New value of XBLNR
append wa_accchg to it_accchg.
2015 Feb 06 9:24 AM
Use search tools for either FB02/FB09 BDC or FM FI_ITEMS_MASS_CHANGE.
But also Look at Customizing for "Document Change Rules, Line Item" (OB32) and read KBA 1497601 - Document change rule defined in T-code OB32 does not work - field cannot be changed in T-code FB02.
Regards,
Raymond
2015 Feb 06 9:53 AM
Hi Raymond,
When we go for header button there in reference field value is edit mode there we can change but i need multiple document number to change.Can you give some idea.
Thanks,
2015 Feb 06 10:20 AM
2015 Feb 06 10:24 AM
But if i will run that function module then i am looking there parameter is s_bseg so how it will update for BKPF-XBLNR.
2015 Feb 06 12:09 PM
Look for samples at scn. Fill the values to change in the s_bseg structure, the list of fields in it_fldtab, and list of document items to change in it_buztab. Get errors back in errtab.
Regards,
Raymond
2015 Feb 06 1:32 PM
Hello,
You can use following FM
CALL FUNCTION 'FI_DOCUMENT_CHANGE''
EXPORTING
I_AWTYP =
I_AWREF = GV_REF
I_AWORG = GV_ORG
I_KUNNR =
TABLES
T_ACCCHG = IT_ACCCHG
Pass value as:
I_AWTYP = BKPF-AWTYP
GV_REF = BKPF-AWKEY(10)
GV_ORG = BKPF-AWKEY+10
I_KUNNR = BSEG-KUNNR
Internal table it_accchg contains the field and the value to be changed as:
wa_accchg-fdname = 'XBLNR'
wa_accchg-oldval = Old value of XBLNR
wa_accchg-newval = New value of XBLNR
append wa_accchg to it_accchg.