Application Development and Automation 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: 
Read only

FB01 - Need to update fields and cannot find solution

Former Member
0 Likes
8,495

I have a need to update VERTN, KUNNR, WERKS, and PPRCT when posting an invoice with FB01. The only field I can find a way to change is PPRCT (through substitution). I have looked at all the user exits, BADI's, BAPI's, and BTE's and cannot find a solution. Nothing I can find has these fields available to change.

I thought BTE 1020 was my solutution, but it seems you can't change any data with it - which I can't figure out the point of it then. Right after the call to the BTE, it sets the BSEG internal table back to the way it was before the call.

Anyone have any suggestions?

I have a need to update VERTN, KUNNR, WERKS, and PPRCT when posting an invoice with FB01. The only field I can find a way to change is PPRCT (through substitution). I have looked at all the user exits, BADI's, BAPI's, and BTE's and cannot find a solution. Nothing I can find has these fields available to change.

I thought BTE 1020 was my solutution, but it seems you can't change any data with it - which I can't figure out the point of it then. Right after the call to the BTE, it sets the BSEG internal table back to the way it was before the call.

Anyone have any suggestions?

13 REPLIES 13
Read only

Former Member
0 Likes
5,085

Hi,

Check the BTE

00001120 DOCUMENT POSTING: Field substitution header/items

Thanks,

Naren

Read only

Former Member
0 Likes
5,085

In looking through program SAP , here is the call to BTE 1120:

call function 'OPEN_FI_PERFORM_00001120_P'

exporting

i_bkdf = bkdf

tables

t_bkpf = xbkpf

t_bseg = xbseg

t_bsec = xbsec

t_bkpfsub = bkpfsubsttab

t_bsegsub = bsegsubsttab

changing

i_bkdfsub = ls_bkdfsubst

When you double-click into the FM, you can see that it actually puts BSEG back to the way it was before the call. The only fields that can be substituted are what's in BSEG_SUBST - and none of the fields I need are in it.

Read only

0 Likes
5,085

Hi,

You are corrent that the fields you want to substitute are not available in <b>BSEG_SUBST</b>.

To get these fields you will have to maintain <b>table GB01 and GB01C</b>. This is where you define which field you can substitute. The fields you want are define as non substitutable in table GB01 ( BEXCLUDE = 'X' ).

I know that you can substitute custom fields by adding entry in these table but i do not know if it is advisable to change the entry in table to make the field substitutable. I checked OSS not but could not find any for the fields you have specified.

You might want to check for OSS note by yourself and if you could not find any, write to SAP and ask if you can change the entry in GB01 and GB01C.

Let me know if you have any question.

Regards,

RS

Read only

Former Member
0 Likes
5,085

Forgot to put the complete program name for FB01 - SAPMF05A

Read only

Former Member
0 Likes
5,085

I have found a couple of OSS notes that refer to writing your own "Z" program to update table GB01 and take out the "X" (exclude field) for the fields you want to allow for substitution. SAP doesn't recommend this approach, but it can be done.

Is this my only alternative?

Read only

0 Likes
5,085

Hi,

If you look at the code of these 'Z' program, you will see that it is just 5-6 line of code which move the data into table and then do the direct update the table with Modify statement.

Wherever it is possible SAP has given an OSS note and most of the places it talks about custom fields ( include structure CI_AUFK, CI_PRPS, CI_PROJ etc. )

I do not think there is any OSS notes for the field you are looking for. But this is the only alternative for you.

You might want to open a OSS message with SAP and ask them if you can modify these table for your requirement.

Regards,

RS

Read only

Former Member
0 Likes
5,085

Would it be feasible to add an append structure to BSEG_SUBST and add the fields I need to change? I know the system would let me do it, but I don't what the consequences of that would be. Has anyone ever done this?

Read only

Former Member
0 Likes
5,085

Hi Kristine,

Were you able to solve this issue? If sso, can you please mention it. I am facing the similar problem. I am sure its been a while you worked on it. But, just if you remember your help is appreciated.

Thanks,

Raju

Read only

josgabriel_martnez
Participant
0 Likes
5,085

Hi Kristine.

Right now I'm in similar situation (I need to change BSEG-ZTERM, but this field is not available in BSEG_SUBST).

What about tables GB01 - GB01C ? Did you resolve your issue?

Thanks in advance.

I thought these was and easy issue, but, it has become into a nightmare.

Regards,

José Gabriel.

Read only

josgabriel_martnez
Participant
0 Likes
5,085

Hello Kristine,

Finally, I found the BTE-Process: SAMPLE_PROCESS_00001140 (SAP ECC 6.0)

And it works.

Documentation says: "This interface is for internal use at SAP only."; but, for me it's OK.

The table T_BSEG can be updated and after exiting the FM, it is not "restored" by SAP with the original values.

Solved (for my case). It should work for similar issues, like yours.

Regards.

José Gabriel.

Read only

uygur_burak
Active Contributor
0 Likes
5,085

Hi Kristine,

You can user 1120 BTE.

You can append additional fields to BSEG_SUBST using append structure function.

For example,

You want to update customer field (KUNNR), you must append additional fields 'KUNNR' to BSEG_SUBST via append structre. Then you can update T_BSEGSUB internal table in 1120 BTE function module. It will be changed on FI document.

But, I think there is a problem about Controlling data. If you want to change profit center(PRCTR) or cost center(KOSTL) system will be get dump. Because system already post CO document when entered this exit.

Regards,

Burak

Read only

0 Likes
5,085

Thanks Burak.

Correction: Sorry, process 1140 should be discarded, it doesn't work for all of the cases.

The correct one is the process 1120 and FM: SAMPLE_PROCESS_00001120.

The structure BSEG_SUBST can be used just adding the desired fields via Append Structures.

(Like Burak explained above, thanks again).

Regards,

José Gabriel.

Read only

0 Likes
5,085

Hi Burak,

Hope you can help me on this also.

I am appending additional fields 'KUNNR' and 'LIFNR 'to BSEG_SUBST structure using append structure function. and using this structure in 1120 BTE to update the data in BSEG while posting .

My test cases are as follows

1) Vendor invoice posting from FB60

-> I am able to update LIFNR from  vendor line to G/L line when running from FB60 .

2) Customer Invoice posting from FBR2

-> But when running FBR2 , this 1120 BTE is not triggering so failing to update KUNNR from customer line to G/L lines in BSEG table .

Please help me on this.