cancel
Showing results for 
Search instead for 
Did you mean: 

FBL5N t code and BSEG table is showing wrong contract number

Former Member
0 Kudos

Hi,

The proces flow is contract number>sales order>DMR-->Invoice

Now when I am checking the VBFA table it's showing correct contract number against invoices but FBL5N t code and BSEG table are showing wrong contract numbers.

Why FBL5N and BSEG table is showing wrong contract number?

Currently we are using one enhancement and user exit is used to incorporate one customized field as identifier for bill type.

1. During the billing document release to accounting VFX3, The user exit triggering and it is update the customized fields and Net settlement indicator.

2. Using the Invoice number, get the fields VGBEL(Document number of the reference document) and VGPOS (Item number of the reference item) from VBRP and read table VBAP with VBELN and POSNR, to get DMR number (Sales Document) that created for the Invoice.

3. Use fields VGBEL and VGPOS on table VBAP to get the sale order number.

4. By using the Sales order number, get the Distribution channel to update Net indicator field

In accounting table BSEG-UZAWE = JF must be updated on the customer line.

5. Retrieve the sale order number and item level to get customized field from table VBAP

Any pointers.

Thanks

Ashu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

closed

reazuddin_md
Active Contributor
0 Kudos

Dear ashuthosh,

Seems info is not complete.

As your subject line states that " FBL5N & BSEG table is showing wrong Contract number"-

Are you talking about "reference" (table: BSEG)field or "Assignment key" ( table:BKPF).

if its from BSEG table, this reference doc will be taken as billign document. this can be controlled in Copy control from Source - Target @ header level- reference number.

Why & what is th purpose of using "Customized field"? Points 3 & 4 is not clear.

Former Member
0 Kudos

Hi Reazuddin,

Thanks for your reply,

I am concercerned about BSEG table and using user exit EXIT_SAPLV60B_008 to post the document in FI.

Now in we have enhanced this user exit for contracts and included in this way.

SELECT SINGLE ZZ_CONTRACT FROM VBAK INTO (LC_CONTRACT) WHERE VBELN EQ cvbrp-vgbel.

Endloop.

*Moving the values to final accounting table

loop at xaccit.

xaccit-vertn = lc_contract.

xaccit-VBEL2 = xaccit-AUBEL.

xaccit-xref3 = lc_vbel2.

MODIFY xaccit .

ENDLOOP.

Clear: lc_contract,lc_vgbel,lc_vgpos,lc_vbel2.

But I am getting correct data when checked other clients( development and quality), this problem I am getting in production.

Do I need to ask the ABAP'er to debug this enhancement in production?

Thanks

Ashutosh

reazuddin_md
Active Contributor
0 Kudos

It may not solve your problem, but you may get hint.

check this note: Note no- 160211

Debugging will also give route cause.