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

CALL TRANSACTION won't execute report, keeps returning to program

Former Member
0 Likes
2,043

Good day to you!

I have the following code:

CALL TRANSACTION 'FPO4' USING bdcdata

MODE 'A'.

The last line in my bdcdata is to simulate pressing the Execute button (OK_CODE = '=ONLI'). However, instead of running the report that FPO4 is supposed to generate, it just comes back to my program and its selection screen.

Please note that although I am populating data on FPO4's native Selection Screen, I am also populating data on a special "predefined selection," so using a simple SUBMIT has never been an option to me.

Does anyone know how I can get FPO4 to actually execute vs. coming back to my program?

Thanks -- as always, points for all helpful answers!

13 REPLIES 13
Read only

naimesh_patel
Active Contributor
0 Likes
1,696

Before calling the call transaction, put a dummy screen of the report output

' ' 'OK_CODE' '=ONLY'.

*This screen name nad number should come in the SHDB recording..
*Don't assing any OK_CODE to that screen

Perform screen 'X' 'SAPMSSY0' '0120'.   "<< it should be your reports screen 

CALL TRANSACTION 'FPO4' USING bdcdata
MODE 'A'.

Actually, I dont' have this transaction in my systm otherwise I should able to give you exact screen name and number.

Regards,

Naimesh Patel

Read only

0 Likes
1,696

Naimesh,

I am confused by this "dummy screen" you're talking about and how I should incorporate it into my code. Can you be a little more specific on this?

Thanks,

Dave

Read only

0 Likes
1,696

Hi Dave,

Is possible for you to paste the recording of your Tcode.. Full recording?

Starting witht the selection screen, than ONLI, than the report screen and than the back button from the report screen.

I will give you the DUMMY Screen from the recording...

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,696

after call transaction use temporarily

if sy-subrc NE 0.

message <>.

endif.

and check and analyze where its coming back.

Did u debug your code though ??

Read only

Former Member
0 Likes
1,696

Hi,

Why don't you use LEAVE TO TRANSACTION... instead of call transaction...

Regards,

Dharitree

Read only

0 Likes
1,696

I didn't think I could pass data with a LEAVE TO TRANSACTION?

Read only

Former Member
0 Likes
1,696

Hi Dave,

I am in version 4.7 and I don't see a transaction code FPO4. Could you check and let me know if the transaction code is correct?

Read only

0 Likes
1,696

Hi Mark,

Yeah, it's definitely FPO4. We're running SAP ECC 6.0.

Dave

Read only

0 Likes
1,696

Hi Dave,

1) Place a break point on the call transaction statement and check if the internal table bdcdata has any data (It should not be empty).

2) Enter the update clause

CALL TRANSACTION 'FPO4' USING bdcdata

MODE 'A'

<b> UPDATE 'S'.</b>

Let me know if this helps.

Read only

0 Likes
1,696

Mark,

I originally had that UPDATE clause in there, but I put it back in. I verified that the bdcdata internal table does have all of the data in it. All of the fields get updated on the screen, but when I do that final "click" of the Execute button, I come back to my calling program.

If I go to FPO4 itself and enter values, then click Execute, it runs and creates the desired report.

Dave

Read only

0 Likes
1,696

Hi Dave,

Create an internal table of type BDCMSGCOLL and use the message clause. Probably the message returned in this internal table could give us a clue.

Read only

0 Likes
1,696

Mark,

Did that, and the message table that came back was empty.

Read only

0 Likes
1,696

Hi Dave,

I am facing the same problem i.e. can't able to execute FPO4 through bdc, so could please suggest regarding it?

I have one more query ' how to fetch FPO4 data into an internal table of my program?'

Thanks,

Lava.