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

Strange One

Former Member
0 Likes
1,255

Dear Fords

I Facing a very strange Problem ,

I Created a Z function Module in which I used function modules like BAPI_PR_CHANGE & BAPI_REQUISITION_RESET_RELEASE & BAPI_REQUISITION_GETRELINFO

The Problem with the function module is that when i run the Function module through se 37 by F8 it is not giving me expected results

But when i run the function module through SE 37 with the same set of values but now in debugging mode it gives me desired output strange!!!!

Any Ideas are welcome

Dear Fords

I Facing a very strange Problem ,

I Created a Z function Module in which I used function modules like BAPI_PR_CHANGE & BAPI_REQUISITION_RESET_RELEASE & BAPI_REQUISITION_GETRELINFO

The Problem with the function module is that when i run the Function module through se 37 by F8 it is not giving me expected results

But when i run the function module through SE 37 with the same set of values but now in debugging mode it gives me desired output strange!!!!

Any Ideas are welcome

9 REPLIES 9
Read only

Former Member
0 Likes
1,187

Its a matter of the changes being committed. Write a program and call your BAPI's in there and then finally the BAPI_TRANSACTION_COMMIT. It should work.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

0 Likes
1,187

Thanks Frnd

i called the BAPI_TRANSACTION_COMMIT but it is Not Happening Frnds

Here is the SEquence in which i am calling the function modules

1. BAPI_REQUISITION_GETRELINFO

2. BAPI_REQUISITION_RESET_RELEASE (To Reset the PR)

3. BAPI_PR_CHANGE (Change the PR )

4.BAPI_TRANSACTION_COMMIT (To commit the changes)

Read only

0 Likes
1,187

Shirish,

From Menu FunctionModule->Test->Test Sequence->

now you will see a popup, here in this popup give the BAPI's which you are testing

BAPI_REQUISITION_GETRELINFO

BAPI_REQUISITION_RESET_RELEASE

BAPI_PR_CHANGE

BAPI_TRANSACTION_COMMIT

are you doing all together. or one by one.

if it is one by one then you should have 3 Test sequence in place , each one with

BAPI_TRANSACTION_COMMIT

so you need to test 3 test sequence

Regards

Vijay

Read only

0 Likes
1,187

Thankx Vijay,

well .. I tried thid way i copied the all code in the function module and pasted in Executable program But same is the case with the program

I think it some thing specific to the BAPI function module

Plz throw your own ideas

Read only

0 Likes
1,187

Hi Frnds ,

The Problem has been sorted out .

I Put a statement

Wait up to 2 Seconds .

In BAPI_REQUISITION_RESET and BAPI_PR_CHANGE and it is working fine

Thankx For all.

Shirish

Read only

Former Member
0 Likes
1,187

When running programs in debug mode. Commit Works are executed. I suspect this is your problem. You are not doing a commit work after the BAPI calls.

Read only

Former Member
0 Likes
1,187

It is not strange.

in Debug mode Automatically COMMIT WORK triggers, so you are getting desired results. But in case of with out Debugging Direct run No Commit work.

if you want the same results then you have to Test it using Test Sequence.

from menu Create the Test Sequence

add your BAPI , and then BAPI_TRANSACTION_COMMIT and then test it and see.

Regards

vijay

Read only

Former Member
0 Likes
1,187

try like this

GOto - SE37 -> Function module -> TEst --> Test Function module

Read only

bruno_esperanca
Contributor
0 Likes
1,187

Hi guys,

I'm sorry to say this but I think that you are all wrong, actually, and the original poster is right.

I'm sharing this because I don't want to forget about this in the future and search for it again.

So, in fact the problem is when you reset a release status for a Purchase Requisition and you want to reset the previous release status immediately after, using either BAPI_REQUISITION_RESET_RELEASE or BAPI_REQUISITION_RESET_REL_GEN. The problem is the following line of code:

   CALL FUNCTION 'ME_UPDATE_REQUISITION_RELEASE' IN UPDATE TASK

So, the update to the database is made in update task... Which means... I think... you just have to wait...

Cheers!