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: 

Getting subrc 1001 from calling a function module

oliver_ried
Explorer
0 Kudos

Hi,

I want to call an ABAP report "A" within another ABAP report "B".

With the report "A" I have created a batch-input (SHDB), and with this recorded batch-input I built a function module.

In report "B" I call this function module with CALL FUNCTION.

In our test system it works. Report "B" calls report "A", and when I test the function module with SE37, it works, too.

But when I want to run it in our productive system, I always get the subrc 1001.

I have found the following info:

Mode "N": Processing without display of screens. If a breakpoint is reached in one of the called transactions, processing is terminated with sy-subrc same as 1001. The field sy-msgty contains "S", sy-msgid contains "00", sy-msgno contains "344", sy-msgv1 contains "SAPMSSY3", and sy-msgv2 contains "0131".

But there are no breakpoints in my program.

I do not understand this behavior. Why does the program works in the test-system and breaks in the productive system?

Kind regards

Oliver

1 ACCEPTED SOLUTION

rajkumarnarasimman
Active Contributor
0 Kudos

Hi Oliver,

Also check in foreground by changing the mode 'A' in debugger. This is not due to difference in system. It may be due to difference in value which we are passing.

In some case the error occurs if the value is not matching with the field. In foreground, you can easily find out.

Eg: For employee number instead of giving 8 digit number, user may given characters, on such case, this will occur.

Regards

Rajkumar Narasimman

3 REPLIES 3

former_member201275
Active Contributor
0 Kudos

It's beacuse your OKCODE statement is incorrect, or missing, i think. Use this BDC_OKCODE (=FNAM).


rajkumarnarasimman
Active Contributor
0 Kudos

Hi Oliver,

Also check in foreground by changing the mode 'A' in debugger. This is not due to difference in system. It may be due to difference in value which we are passing.

In some case the error occurs if the value is not matching with the field. In foreground, you can easily find out.

Eg: For employee number instead of giving 8 digit number, user may given characters, on such case, this will occur.

Regards

Rajkumar Narasimman

0 Kudos

Hi Rajkumar,

you are great. The mode "A" was the solution.

I have found an error in my batch-input.

Thank you for the help.

Kind regards

Oliver