Application Development 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: 

Call Transaction behaving differently in Foreground and Background job

manoj_goyal2
Participant
0 Kudos

Hi Guys,

I have created a program (Z_TEST_CALL_TRAN), in the program I am doing CALL TRANSACTION as below.

When I run in foreground I get error in LT_MSG (as expected), SY-SUBRC is 1001.

When I run in background then LT_MSG is empty (My test is failed). SY-SUBRC is 0.

Itab LT_MSG should be field with error in background also.  I tried with MODE 'N" also, but still LT_MSG is empty.

CALL TRANSACTION 'FF_5' USING lt_bdcdata

             MODE 'A'

             UPDATE 'S'

             MESSAGES INTO lt_msg.


lv_subrc = sy-subrc.


In real world this program (Z_TEST_CALL_TRAN) will be submit as background job.


Can you advise me how I can fix this problem?


I have attached my test program for reference.


Thanks a lot.

1 ACCEPTED SOLUTION

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Call transaction method works in  Foreground only. use Session Method for background/foreground, and   status in SM35

Hope it helpful,

Regards,

Venkat.

3 REPLIES 3

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Manoj,

Comparison between foreground and background comes in next step. First thing, BDC is not working which is need to consider here.

SUBRC fails, if it shows 1001 then there is a value mismatch/validation issue with the screen field. Kindly check the same by using Mode 'A'.

Hope you can trace the same in foreground using Mode 'A' type. If it works in foreground, it will definitely work in background.


CALL TRANSACTION 'FF_5' USING lt_bdcdata

            MODE 'A'

             UPDATE 'S'

             MESSAGES INTO lt_msg.

Regards

Rajkumar Narasimman

0 Kudos

Thanks Rajkumar for your reply,

I have already tried using MODE 'A', as shown in my original post.

For my testing, I am expecting error in LT_MSG, which I have when I call program Z_TEST_CALL_TRAN in foreground.

When I execute the above program in background, then LT_MSG is empty.

I need to display message if there is any error in executing tcode FF_5.

In this case, there is error but LT_MSG is not populated with error msg, and I cannot report the error message.

Hope I explained my situation.

Thanks,

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Call transaction method works in  Foreground only. use Session Method for background/foreground, and   status in SM35

Hope it helpful,

Regards,

Venkat.