cancel
Showing results for 
Search instead for 
Did you mean: 

How to update trading partner (BSEG-VBUND) in tr.code FB01/FB02?

Former Member
0 Kudos

Hi,

I need, under some circumstances, to update value of trading partner code (field BSEG-VBUND) to all items in the FI document, created/changed with transaction FB01/FB02.

I checked available user exits and bussiness events, but didn't found one, which could do the trick.

In fact, in bussiness transaction event #00001430 (CHANGE DOCUMENT: Field substitution header/line - Checks prior to posting change completed) - for FB02 I have access to the internal table T_BSEG, but it seems this table is used as import parameter only and any changes didn't take efect at the end.

Any help how can I do the trick? And this is while I'm in a transaction FB01/FB02.

My system is 4.6c.

Many thanks in advance.

Regards,

Ivaylo Mutafchiev

Accepted Solutions (0)

Answers (3)

Answers (3)

fernando_evangelista
Contributor
0 Kudos

Refer to the following trheads:

Regards,

Fernando Evangelista

Former Member
0 Kudos

hi.

Try implementing this oss note.

0001412559 FB02: Substitution from process BTE 1430 is not saved

This allows you modify the standar fields. I dont know if be usefull to update vbund field. You may to append it in BSEG_SUBST structure and try again.

Regards.

Rodrigo.

Former Member
0 Kudos

Hi,

Why don't you use a normal substitution, instead BTEs ?

If you want to create a substitution in FI, use transaction GGB1. If the substitution fields are not enough, refer to SAP note 42615.

Good luck,

Svetlin

Former Member
0 Kudos

Svetlin,

thanks for a quick reply. I never used field substitution, but our application consultants did, and according to their oppinion, it will not work.

When I mentioned 'under some circumstances' I meant, that the condition may not be in the current item, but in some other - before or after the current. I have to check for account number (HKONT), and for exsistence of specific trading partner number (VBUND), and, if the condition is TRUE, to loop over some of the records of the document and to change the value of their trading partner.

Nevertheless, I'll check if it's possible to do what I need following the 'substitution way' and will post my results here (and will assign points, of course ).

Any further ideas are wellcome.

Regards,

Ivo

Former Member
0 Kudos

Hi Ivo,

You can try with matrix substitution (complete document ). Use subtitution exits programming. They are more flexible.

Svetlin

Former Member
0 Kudos

Hi Svetlin,

I've played for few hours with complete substitions (as you proposed), and finaly made one active complete matrix substituon (passing all data from document as one parameter - BOOL_DATA of type GB002_015).

I made some modifications in the structures of the BOOL_DATA (specificaly - all records of BSEG), and they remain changed after leaving my user-exit, but unfortunately my changes are not taken in mind further in the process logic. There is a part of the system code, where DATA_IN and DATA_OUT (structures of type GB002_015 and DATA_IN is the one where my changes are) are swapped, and only 1 field of DATA_IN-BSEG is taken in mind.

I could pass some code, part of the stack and trace here, but for me it's not nessessary for now. Everything was checked in debugger - there are a lot of dynamic cals (as usual).

Finaly the result is negative - my changes were not recorded to the database.

My original code is a bit complex, but for testing purposes I unconditionaly modified single field of all the records of BSEG with some static value.

Any ideas how to proceed?

Thanks in advance.

Regards,

Ivo

Former Member
0 Kudos

Hi Ivo,

Did you check you substitution fields ? In most of the cases you should add them to table GB01. See OSS note 42615 for details.

Svetlin

Former Member
0 Kudos

Svetlin, Max,

what I did until now is:

1) followed matrix substitution = callup point 3 (complete document) - I checked for existance of correct substitution field(s) in the GB01 table, and re-generated substitution code (as noticed in note 42615). That added my field in the list of fields for substtitution which are considered at the end of substtitution - in forms:

FORM EXP_REC_015

USING

DATA_CHANGED TYPE GB002_015

CHANGING

DATA_OUT TYPE GB002_015.

and

FORM EXP_TAB_015_BSEG

USING

IN_ORIG STRUCTURE BSEG

CHANGING

OUT_RESULT STRUCTURE BSEG

B_RESULT.

both forms are in main generated program GBTAAFI0.

My field (VBUND) is taken in account - added to the structure:

DATA: BEGIN OF TEMP_STRUCT,

VBUND LIKE BSEG-VBUND

ZFBDT LIKE BSEG-ZFBDT

END OF TEMP_STRUCT.

here ZFBDT was the other field defined in GB01 for substitution from someone esle - perhaps by default, I don't know.

Further (in the include MF05LFB0),

almost all of the structures which contain my changes are cleared (below is extract from the code):

............

LOOP AT beltab WHERE xarch NE char_x. "Note 0383125

REFRESH xbseg.

REFRESH ybseg.

REFRESH xbsec.

REFRESH ybsec.

REFRESH xbsed.

REFRESH ybsed.

REFRESH xbset.

REFRESH ybset.

REFRESH t_bsegco.

REFRESH t_fmfich.

.......

Further, the logic proceed with the program SAPFF011 and form 'import_*beleg', where my changes were overwritten with original data - before substitution.

2) Tried Max's proposal - and extended structure BSEG_SUBST with field VBUND, further populated the substitution table in the related BTE 1430 accordingly.

Unfortunately the flow-logic proceeded further to the same form 'import_*beleg' in the program SAPFF011 and my changes dissapeared.

I'm at dead-end - have no idea where and what is the problem...

Checked few OSS notes - 42615, 386896, 513891, 391309, 438076. Everything which is related to my exact situation is set correctly - as far as I found :-).

Just for tests I tried both ways (BTE and matrix substitution) with another field ==> BSEG-XREF3, and it was updated correctly - accorging to my logic.

Thanks guys, your suggestions were right at the time and valuable, but they didn't help me to solve my problem. Perhaps there is something messed in our system - I can't be sure. What I can say for sure is that we have working BTE-s (1430 is used in our system - I just added piece of code into it), and validations are working also.

Thanks again.

Regards,

Ivaylo

P.S. If you have any suggestions, I'll be glad to hear them from you.

Former Member
0 Kudos

Hi Ivaylo

Are you sure? The bussiness transaction event #00001430 is for Master Data Vendore (I'm using a 4.6C): Have you tried 00001020 0r 00001025?

Regards

Max

Former Member
0 Kudos

Max,

Thanks for a quick reply.

according to the description of the BTE gotten from tr.code FIBF=>Environment=>InfoSystem(Processes) BTE #1430 is:

00001430 CHANGE DOCUMENT: Field substitution header/line Checks prior to posting change completed

And BTE #1020 is:

00001020 DUNNING: Following reading, prior to printing

nothing related to BSEG in the interface, sorry...

BTE #1025 is:

00001025 POST DOCUMENT: Final checks completed Document number not yet assigned

No, I didn't checked it, because I tried to find those in CHANGE mode for now. I'll take a look at it. Even if it works, it will do part of the task - when in NEW mode (FB01).

Any further ideas are wellcome.

Thanks,

Ivaylo

Former Member
0 Kudos

Hi

Excuseme, but I didn't understand that you was using user-exit of Process and Not Event.

Anyway the function module of your event can only change the fields inserted in structure BSEG_SUBST: these are its fields:

TABIX SYTABIX

(It's the index of record you want to change)

SGTXT SGTXT

ZUONR DZUONR

HZUON HZUON

XREF1 XREF1

XREF2 XREF2

XREF3 XREF3

ZLSPR DZLSPR

.INCLUDE CI_COBL

.APPEND J_1IEWTDATE

VALUT VALUT

How you can see there isn't your field.

Perhaps you can try to create an APPEND STRUCTURE for BSEG_SUBST and insert your field in it.

Or you can try to use an user-exit to check document before saving.

Max

Former Member
0 Kudos

Max,

thanks for the reply. As I mentioned in the 1st posting of this thread - I didn't found any active user-exit at document save in our ssytem. If you have some in mind, could you please share it with me/us?

I'll try your suggestion to extend (append) structure BSEG_SUBST but furst I'm going to deal with the Svetlin's proposition.

I'll stay in touch here with results.

Thanks again.

Regards,

Ivaylo