cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with BTE and FI-parking- no data from memory ID to ABAP

Former Member
0 Kudos

Hi Experts,

I have a scenario in Business Workflow where I want to catch the data(BKPF & BSEG) after SAP transaction processing - event is to change parked FI-document with FBV2. I´m trying to use BTE to receive the data after processing transaction.

All BTE steps seems to be activated - because I can debug my functions when processing FBV2 - but I cannot reach any data into my coding after processing.

I have created my project in BF24:

ZXXX Testing: WF-memory ID



I have also linked few FI-events to my BTE interface funtion in BF34:

00001130 ZXXX ZXXX_FIPP_CHANGE_BTE
00002213 ZXXX ZXXX_FIPP_CHANGE_BTE
00002217 ZXXX ZXXX_FIPP_CHANGE_BTE




My BTE function ZXXX_FIPP_CHANGE_BTE is as following:

DATA: memid(15) VALUE 'ZXXX_2217'.

*Initialize
CLEAR: t_vbkpf,
t_vbsegs.
FREE MEMORY ID 'ZXXX_2217'.
*Backtracking of BTE
EXPORT t_vbkpf
t_vbsegs
TO MEMORY ID memid.

ENDFUNCTION.



I have also created funtion to call FBV2:

data: memid(15) value 'ZXXX_2217'.
CALL TRANSACTION 'FBV2'.


*Import memory of BTE
IMPORT t_vbkpf
t_vbsegs
FROM MEMORY ID memid.
*Free memory id
FREE MEMORY ID memid.

When I set a breakpoint to both of the functions and I execute FBV2 I reach the breakpoints. Problem is that the data is not passed from memid 'ZXXX_2217' into function after FBV2(this syntax: IMPORT t_vbkpf t_vbsegs FROM MEMORY ID memid.)

What could be missing. So both functions are called but NO DATA is passed from memory ID to my internal tables? This seems to be a problem with memory ID´s. Also in my BTE function ZXXX_FIPP_CHANGE_BTE I receive a sy-subrc value 4 when executing syntax "FREE MEMORY ID 'ZXXX_2217'. ".

All hints appreciated,

Jani

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jani,

Did you check the data in the internal tables t_vbkpf

t_vbsegs using breakpoint when the data is exported ?

Also if the tables t_vbkpf and t_vbsegs are defined without header line then the clear statement would initialise these internal tables.

Regards,

Vin

Former Member
0 Kudos

Thanks of Your reply Vin!

Yes - I checked those tables when debugging the function.

The problem is that no data is imported from memory ID into those internal tables t_vbkpf & t_vbsegs.

I´ve carried out actions in tarnsactions BF24 and BF34 - do I havr to do something else?

Is there a place where I have to activate / cerate etc. the memory ID´s that I want to use? As I also mentioned I receive a sy-subrc value 4 when exporting my internal tables into memory ID in my BTE funtion.

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Hi Jani,

Welcome to the Forum!!

It all depends where your FM with import is being called from. When you EXPORT to memory, the data is stored in the cross-program ABAP memory of the <b><u>current internal session</u></b>. The data can then be imported by any program called in the same internal session. If your FM with import is part of a workflow, then the Exported data is not available since workflow gets launched in a different session. If this is the case, you will have to pass the data using event parameters or get it from the DB tables.

Cheers,

Ramki Maley.

Former Member
0 Kudos

Hi Jani,

You are not required to do any activation for using memory ids. I agree with Ramki that you need to check where the FMs are being called from the memory point of view.

The memory ids function differently as compared to parameter ids where the data is stored in the global, user-specific SAP memory and available across external and internal sessions. Using Memory ids you can store data in ABAP memory. You can retain or pass data across internal sessions only. Also each new EXPORT ... TO MEMORY overwrites the old data in ABAP memory. Please check these.

Regards,

Vin

Former Member
0 Kudos

Hi Guys,

Thanks of welcoming me into forum and Your replys!

To clarify this a bit more: I´ve managed to get this working previously in other WF-projects. So it seems that there is some problems with memid´s in this customer system.

Scenario is that I have a method which calls TAC FBV2 and with that same method I read(I´m trying to...;-)) the data from memory ID and as mentioned that logic is called correctly because I can debug it(also the system reaches the breakpoint in my BTE function when accesing FBV2). So all of these actions are processed in same dialog session - based on my understanding.

I cannot do this by reading the database - main purpose for using BTE(or some similar way?) is that this system seems to be a bit "slow" time to time, and the data is not stored into databasse(BKPF & BSEG) when my method is executed. Therefore I want to catch the data immediatly & runtime in my FBV2 method.

Br,

Jani

Br,

Jani

Former Member
0 Kudos

One detail:

Previoysly - when I have managed to get this running - I have executed exporting to memid and importing from it in same function. Therefore it has worked? Like this:

Function...

export t_vbkpf to memid....

call transaction 'FBV2'.

import t_vbkpf from memid...

endfunction.

Br,

Jani

Former Member
0 Kudos

Still not working....(-; I imported all of the locig in same program.

I have a function like this:

<b> DATA: memid(15) VALUE 'ZFUJ_2217'.

*Initialize

CLEAR: t_vbkpf,

t_vbsegs.

FREE MEMORY ID 'ZFUJ_2217'.

*Backtracking of BTE

EXPORT t_vbkpf

t_vbsegs

TO MEMORY ID memid.

CALL TRANSACTION 'FBV2'.

*Import memory of BTE

IMPORT t_vbkpf

t_vbsegs

FROM MEMORY ID memid.

*Free memory id

FREE MEMORY ID memid.

*Check data

READ TABLE t_vbkpf INDEX 1.

COMMIT WORK.

ENDFUNCTION.</b>

As mentioned I receibe sy-subrc 4 when exporting to memid and as well importing from it! What could be teh problem.

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

Is the code above your BTE FM? I do not think CALL TRANSACTION & COMMIT WORK are allowed in the BTE FM.

Please explain why you need to export and import in the same function module?

Thanks,

Ramki.

Former Member
0 Kudos

Hi Ramki,

Again many thanks of Your reply here!

The commit in my function is useless - I should have removed that.

It might be that I am confusing us here, but the target is to get the data from ABAP memory after FBV2 is executed. I know that is has been done like this(using BTE) in our earlier projects. In those cases "export to memid..." has been in BTE funtion and transaction call and "import from memid.." in separate function. I included both - export and import - to same coding based on Your last commenst - that all should be executed in same dialog?

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

Sorry if I confused you. The Export/Import is available to any called transaction/function module executed within the same internal session.

It will help me to know what transaction/process triggers the call to FBV2. In your case the FIPP Change BTE is executed as part of the CALL TRANSACTION 'FBV2'. Perhaps the Export should be done at this time.

Thanks,

Ramki.

Former Member
0 Kudos

Hi Ramki,

No, no. You´re not confusing me - I´m doing that myself..;-) I think we understand my goal & prob´s now.

The way that we have done this earlier(and described in my first message) is as You described in Your previous email. And it has worked, but now in this customer case it´s not working. It should work like this:

1. In my BTE function ZZZZ_BTE i use "export t_vbkpf to memid..."

2. Then FBV2 is called from function ZZZZ_FBV2 and then BTE function ZZZZ_BTE is triggered(and this is working)

3. After I have finalized FBV2 I catch the data in ZZZZ_FBV2 by "import t_vbkpf from memid..."

The problem is that the data is not imported from memid into t_vbkpf in function ZZZZ_FBV2 and also when I export those internal tables to memid in BTE function I received sy-subrc 4.

So from "BTE point of view" everything is working, but internal tables are not exported to memory id and as weel the data is not imported from memid to my coding. That is the reason why I thought I´ve forgotten to do something with memory id´s?

I know that I could do the catching of the transaction data also with BADI, but I´m not familiar with that technique. As it seems, I´m not too familiar with BTE and memory ID´s either...;-)

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Hi Jani,

OK, now everything is clear. I entirely misunderstood your initial post and assumed there is some workflow involved.

Correct me if I am wrong. BTEs 00001130, 00002213 and 00002217 each call the customer functions with a different interface. I am not sure if you could use the same FM ZXXX ZXXX_FIPP_CHANGE_BTE for each event.

The BTE for FIPP changed is 00002214. I have tested it and it worked fine. Here is the code I used.

<b><u>The BTE FM:</u></b>

function z_fipp_00002214_changed.

*"----


""Local interface:

*" EXPORTING

*" VALUE(E_SUBRC) LIKE SY-SUBRC

*" TABLES

*" T_VBKPF STRUCTURE FVBKPF

*" T_XVBSEG STRUCTURE FVBSEG

*" T_YVBSEG STRUCTURE FVBSEG

*"----


data: memid(15) value 'FIPP_CHANGED'.

export t_vbkpf t_xvbseg t_yvbseg

to memory id memid.

endfunction.

<b><u>Test Program:</u></b>

REPORT ZRAMKI_IMPORT .

data: memid(15) value 'FIPP_CHANGED'.

data: t_vbkpf like fvbkpf occurs 0 with header line.

data: t_xvbseg like fvbseg occurs 0 with header line.

data: t_yvbseg like fvbseg occurs 0 with header line.

call transaction 'FBV2'.

*Import memory of BTE

IMPORT t_vbkpf t_xvbseg t_yvbseg FROM MEMORY ID memid.

*Free memory id

FREE MEMORY ID memid.

HTH,

Ramki Maley.

Former Member
0 Kudos

Hi Ramki,

No we´re talking!

This is the same kind of coding that I used originally. As You mentioned I had too many entries in BF34 with same interface function.I removed all others but event 2214.

I copied Your coding and tested.

But I still have a probelm. When I set a breakpoint into my BTE function and trigger FBV2 it does not reach the breakpoint. So my BTE function is not triggered when using event 2214. But when I use for example events 2217 or 2218 it works fine - but of course I´m not able to catch data, because "export t_vbkpf to memid.." should be performed before transaction call.

So as a conclusion. In this system BTE´s are not working when using events(such as 2214) which should be triggered beforre TAC call? What could cause this!?

Thanks again.

Br,

Jani

Former Member
0 Kudos

Some more info...

I did some more testing.

I added the syntax "export t_vbkpf into memid..." in my program where I call FBV2.

Then I manually inserted data into t_vbkpf.

Now when I executed this program I received my manually enetered data from memid after FBV2 was processed.

So there is no problem with memory ID´s - but in BTE there is. BTE interface functions which should be processed BEFORE transaction call(such as 2214) are not working at all. Therefore I cannot export my internal tables(t_vbkpf) in memory ID into SAP coding. And because of that the data is missing when "import t_vbkpf from memid..." is executed.

What on earth causes this...

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

I do not think there is any problem in the system. Check the product associated with the BTE is active in BF24. Also make sure you actually change some data in the parked document using FBV2.

I am not sure what you mean by <i>..."export t_vbkpf to memid.." should be performed before transaction call.</i>

The BTE FM is executed when you save the document in the transaction call to FBV2. And that is when the export takes place. The data is available for import once FBV2 has ended and control returns to the next statement.

Cheers,

Ramki.

Former Member
0 Kudos

Hi Ramki,

I must be frustrating You with these stupid questions... You have already supported me hugely to get more famailiar with BTE. For example not to commit in BTE etc. Big thanks for that!

In all cases when I have tested my project in BF24 has been always active; and yes I have changed the pre. posted document always to trigger the BTE.

I still have a problem. I copied all customizing and coding into other system - with same dissapointing results. Let me describe this once more:

<b>My entry in BF24:</b>

<i>Product: ZBE

Text: Jani testing

RFC destination:

Active: </i> X

<b>My entry in BF34:</b>

<i>Event: 00002214

Product: ZBE

Ctr:

Appl:

Function module: ZBE_BTE</i>

<b>My BTE function:</b>

<i> DATA: memid(15) VALUE 'ZBE_BTE2214'.

DATA: t_vbkpf LIKE fvbkpf OCCURS 0 WITH HEADER LINE.

FREE MEMORY ID memid.

EXPORT t_vbkpf TO MEMORY ID memid.</i>

<b>And the function ZBE_BTE_EXECUTE where I call FBV2:</b>

<i> DATA: memid(15) VALUE 'ZBE_BTE2214'.

DATA: t_vbkpf LIKE fvbkpf OCCURS 0 WITH HEADER LINE.

CALL TRANSACTION 'FBV2'.

IMPORT t_vbkpf FROM MEMORY ID memid.

FREE MEMORY ID memid.</i>

When I process my function ZBE_BTE_EXECUTE - and I have added a breakpoint into ZBE_BTE - for FBV2 call <b>it does not reach the breakpoint</b> in ZBE_BTE at all! This occurs when using event linkage 00002214! And I do execute a real change to parked document.

But if I change the entry in BF34 to be linked for event 00002217 or 00002218 process reaches my breakpoint in BTE function ZBE_BTE! But in these cases also, it does not import the data after transaction call in function ZBE_BTE_EXECUTE. When I continue debugging the coding in BTE function ZBE_BTE further into SAP-coding, I can see that my internal table t_vbkpf is filled. But when I leave SAP-coding when FBV2 is completed and return to ZBE_BTE_EXECUTE - where t_vbkpf should be filled from memory id - t_vbkpf is empty!

Again as a conclusion in this system:

For BTE event 00002214 this locig does not work at all. For events 00002217 and 00002218 it does get activated, but does not bring any data from memory ID into my abap. Strangest this is that I use absolutely same kind of coding that You.

Can You see if I have to fill those empty fields( Ctr. & Appl.) in my BF34 customizing? Or is some other customizing action missing?

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Hi Jani,

Are you sure the document you are working with is actually in Parked status? BTE 2214 will work only if you have parked the document initially. Also your BTE FM does not look right to me. T_VBKPF is a parameter to the 2214 FM and you should not be able to define it again. Please post the complete code of your BTE FM.

BTW, no frustration here. Glad to help you out. you can thank me by awarding points to each answer that has helped you! Since you are new to the forum, here are couple of links on awarding points:

https://www.sdn.sap.com/irj/sdn?rid=/webcontent/uuid/e7b06b5c-0501-0010-3c80-f82a07c9838a [original link is broken]

/people/mark.finnern/blog/2004/08/10/spread-the-love

Cheers,

Ramki Maley.

Former Member
0 Kudos

Hi Ramki,

Tahnsk a lot of Your reply.

Yes; that document is a parked document. We´re talking about a workflow process here and it´s been parked in WF using a TAC variant of FV60.

That example that I sent is full coding( in it´s all shortmess...) of my BTE function ZBE_BTE. Do You mean that I should define t_vbkpf in my function´s table statement - insted of in separate data statement?

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

I wanted to see your FM including the interface. It should look exactly like the example I provided.

Cheers,

Ramki.

Former Member
0 Kudos

Hi Ramki,

Here it comes:

<b>function zbe_bte.

" TABLES

" T_VBKPF STRUCTURE FVBKPF

DATA: memid(15) VALUE 'ZBE_BTE2214'.

FREE MEMORY ID memid.

EXPORT t_vbkpf TO MEMORY ID memid.</b>

Br,

Jani

Former Member
0 Kudos

I would like to bring this thread up again.

I have already received very useful info and helping answers from Ramki Maley, but the issue is still not totally solved.

I have executed needed actions in BF24 and BF34. Coding should also be sufficient for this purpose - I was guided to correct the coding by Ramki´s tips. When I am testing this I´m changing the preliminary posted document(created with transaction variant of FV60) with FBV2. I am executing real changes - for example adding or removing line items.

Existing problems are:

1. My BTE function is not triggered at all when usign BF24 linakge to event 2214. But for example with 2217 it is triggered.

2. In program where I call FBV2, the data from transaction process is NOT imported into my ABAP from memory ID. This is not with any event(tried 2214, 2217, 2218 and 1030 in BF24).

All hints are very highly approeciated - I really need this functionality.

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

Please post the entries in BF24 and BF34 for the BTEs mentioned. Also specify what is your R/3 release.

Thanks,

Ramki.

Former Member
0 Kudos

Hi Ramki,

Please find details from BF34 and BF24 - as well coding of BTE and "FBV2" functions - attached below. I already attached these a few postings before.

My entry in BF24:

+Product: ZBE
Text: Jani testing
RFC destination:
Active: X+

My entry in BF34:

+Event: 00002214
Product: ZBE
Ctr:
Appl:
Function module: ZBE_BTE+

My BTE function:

+DATA: memid(15) VALUE 'ZBE_BTE2214'.
DATA: t_vbkpf LIKE fvbkpf OCCURS 0 WITH HEADER LINE.

FREE MEMORY ID memid.

EXPORT t_vbkpf TO MEMORY ID memid.+

And the function ZBE_BTE_EXECUTE where I call FBV2:

+DATA: memid(15) VALUE 'ZBE_BTE2214'.

DATA: t_vbkpf LIKE fvbkpf OCCURS 0 WITH HEADER LINE.

CALL TRANSACTION 'FBV2'.

IMPORT t_vbkpf FROM MEMORY ID memid.

FREE MEMORY ID memid.+

The thing that confirms that I have to be missing something is that I have tried this in two(2) fifferent systems with similar BF24 & 34 entries and ABAP coding. The levels of systmes that I´ve been using are 4.7 and 5.0.

Thanks,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

I have no problem in my 6.20 system even using your code for ZBE_BTE. Email me the screen shots for BF24, BF34 and SE37 for ZBE_BTE. My email address can be found in <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=t67d0xk%2fxyw%3d">my business card.</a>

Thanks,

Ramki.

Message was edited by: Ramki Maley

Former Member
0 Kudos

Hi Ramki,

I just sent an email to You.

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Thanks Jani. Everything looks correct. In my system both 2214 & 2217 are triggered when the field BKPF-BSTAT is "V" (parked doc) for the document being changed by FBV2. I don't think I can offer any more help on this matter. If you still have problems, please open a message with SAP.

Regards,

Ramki.

Former Member
0 Kudos

Hi Ramki,

Huge thanks of Your assistance in this case!

I´ll open a case to OSS.

Br,

Jani

Former Member
0 Kudos

Hi Ramki,

Sorry to disturb You again, but I found one detail what might cause this error. I sent this as an email also.

As I earlier told, when I execute syntax <b>"free memory id 'ZBE_BTE'.."</b> in my BTE-function I receive a sy-subrc value 4. Therefore I think that my internal tables are not exported to memory id in next lines of coding?

I investigated the content of table SYST when debugging this BTE function. The error message is <b>FI 011 ""Company code & is not assigned to an FM area".</b>

Any idea if this causes my problem? And what causes this message?

Br,

Jani

Former Member
0 Kudos

One more detail,

This occurs when using linkage to event 00002217 in BF24 - for 2214 BTE function is still not triggered at all.

It seems that this error message "FI 011" is used only in SAP´s function FM_INPUT_CHECK. Any idea what that is used for?

But as mentioned, I will create a case to OSS.

Br,

Jani

ramki_maley
Active Contributor
0 Kudos

Jani,

1) The very first time you perform "free memory id 'ZBE_BTE', you receive a sy-subrc value 4 because the memory id does not exist (nothing has ever been exported). It has no bearing on the execution of the next statement. Also, it is not necessary to free before export because export will automatically overwrite the earlier contents.

2) The message in the SYST structure is of no consequence unless it is actually displayed as an error message and transaction execution stops. The message you see and the function FM_INPUT_CHECK belong in the Funds Management (FM) application module. If your installation is implementing the FM module then some configuration is missing.

Can you confirm that the document being edited with FBV2 is actually in parked status (BKPF-BSTAT = "V") ?

Regards,

Ramki.

Former Member
0 Kudos

Hi Ramki,

Again thanks of these informative answers - they extended my knowledge and Your amount of points..;-)

Message FI 011: No it´s not a message with dialog appereance. FBV2 is succesfully completed. I just wondered that if this causes something, because we´re running out of ideas here.

Yes - the document is parked one. I just created a couple of new ones with FV60. Abd the va,ue in BSTAT is "V".

I'm waitin for OSS ID´s for this customer. After received one, I´ll create customer case.

Br,

Jani

Former Member
0 Kudos

Hi Ramki Maley,

Sub: Iam facing problem with workflow in parked vendor invoice with the chaged event.

When iam doing particular (Changing GL account, Cost Center, Amount) changes in parked vendor invoice through t-code FBV2 then the Changed event of business object FIPP is not getting triggered. If iam changing Invoice date then the workflow is getting tirggered.

Can you help me, is there any configuration required or else how to check this problem.

Please help me, Its urgent