Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to chnage Reference filed value in Transaction code - FB02

ram_sahoo
Participant
0 Kudos
2,275

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 .

1 ACCEPTED SOLUTION

Former Member
0 Kudos
542

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.

6 REPLIES 6

raymond_giuseppi
Active Contributor
0 Kudos
542

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

0 Kudos
542

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,

0 Kudos
542

try FI_ITEMS_MASS_CHANGE, this FM will actually generate the BDC for you.

Cordialement,

Raymond

0 Kudos
542

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.

0 Kudos
542

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

Former Member
0 Kudos
543

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.