This website is not affiliated with, sponsored by, or approved by SAP AG.

CALL TRANSACTION return code 1001

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

CALL TRANSACTION return code 1001

Postby amsin » Tue Jan 28, 2003 6:36 am

While executing a program on background I get a return code 1001 for a CALL TRANSACTION, while doing it ON LINE it returns a 0.

Can anyone tell me what this code means?
amsin
amsin
 
Posts: 8
Joined: Tue Jan 28, 2003 6:28 am

More info

Postby Dr Sidewalk » Tue Jan 28, 2003 6:47 am

Amsim,

What transaction were you calling ?

I assume by ON LINE you mean in Foreground.

You probably will have to change the MODE, maybe using 'N', which is sometime the case, but it's difficult to know unless we know the exact nature of your call statement, and the transaction, assuming the transaction is assign to SAP program.

Dr Sidewalk.
Dr Sidewalk
 
Posts: 3531
Joined: Mon Oct 21, 2002 11:06 am
Location: Everywhere...

Postby Guest » Tue Jan 28, 2003 8:23 am

try to analyse the messages of your CALL TA table in debugging mode.
Also it is helpy to have the mode in a varable field, so you can set it from 'N' to 'A' in debugging your CALL TA.
Check the status line while you run the CALL TA in mode A.

regards Hans
Guest
 

Postby ilya » Tue Jan 28, 2003 8:52 am

Some transactions issue 'Success' message and set the sy-subrc to 1001 (even in mode N). You have to loop through the messages that you get from BDC. If you don't have messages of type E or A, then this sy-subrc is all right. Otherwise assume that the update is not done and print this message that has A or E.
ilya
 
Posts: 2327
Joined: Thu Oct 31, 2002 4:49 am

Postby Boris Vian » Wed Feb 16, 2005 2:26 pm

Hi,

ilya wrote:If you don't have messages of type E or A, then this sy-subrc is all right.


I've encoutered this very situation while doing a CALL TRANSACTION on screen ES61 in IS-U. If someone is already in ES61, modifying the same premise I'm trying to access, the CALL TRANSACTION will end with SY-SUBRC = 1001. And although my CALL TRANSACTION was not executed properly, which is a fatal error in my case, none of the messages in my message table are of type E nor A.

The first message is of type S: message E9 029. This message tells me another user is blocking this premise. The second message is also of type S: message 00 344. This message informs me that the batchinput data does not exist for the following dynpro, since it was not able to access the next screen.

I'm not sure if it's better to validate the result with the SY-SUBRC or with the message table, there are several posts about this that discuss it in more details, but one thing's for sure, even if there is no E nor A messages, a 1001 code might still indicate a problem. It depends on your situation.
Boris Vian
 
Posts: 3
Joined: Fri Feb 11, 2005 5:00 pm

Sy-subrc 1001

Postby Jaikumar Enteg » Wed Feb 23, 2005 6:08 am

We encountered the same problem, while doing BDC for F-43. And we found out that some customization problem for that transaction. If you want to avoid in your code try with Mode 'A', 'E' or 'P' (4.6c). Then you will not get that error code 1001. we solved by doing some Customization settings by functional cons.

Thanks and Regard.
Jaikumar Enteg
 

Postby Rich » Wed Feb 23, 2005 6:19 am

The majority of SAP transactions that end because of a data lock or something not found issue a success message ( :shock: ). In my BDC's I have a table which maps message numbers to different message types. After the BDC I scan the returned messages and if there is an entry in the table I set the message type in the message collector table.

In this way as I find messages that really should be errors and not success messages I can change their type without changing sap.

This code can be found in the Repository in Docs.zip:

Code: Select all
     Call Transaction p_trans using ZBDC_Table
                               Mode p_mode
                             Update p_update
                      Messages into p_messages.
     Move sy-subrc to w__subrc.
*
*    Scan the messages in YDCRAISES to see if we need to
*    change the message class.
*
     Loop at p_messages.
          Select single msgtyp
            into w__msgtp
            from zdcraise
           where tcode  = p_messages-tcode  and
                 msgid  = p_messages-msgid  and
                 msgnr  = p_messages-msgnr.
          If sy-subrc = 0.
             Move w__msgtp to p_messages-msgtyp.
             Modify p_messages.
          EndIf.
     EndLoop.
*
*    Dump the message table ?
*
     If w__ydcset-dumpmsg = True.
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Postby phillipm » Wed Feb 23, 2005 8:22 am

Some transactions also behave differently when in batch input mode. (or did). An example of this is the goods movements transactions like MB01, MB1C, ecc... If you try a recording you will see a flag on the access screen that you do not usually get and, depending on how it is set, you will get a popup once you are on the main entry screen.


pm
phillipm
 
Posts: 376
Joined: Fri Oct 25, 2002 3:54 am
Location: Lyon, France

If sy-subrc = 1001 in Background Job ?

Postby arundgr8 » Mon Feb 26, 2007 5:32 am

Hai. I'm getting the same error like sy-subrc = 1001 after CALL TRANSACTION. In my case, the mode is 'N' and I'm executing the Program as a Background Job. If I change the mode to 'A' or 'E', then when i execute it in Background, the Job will be abended(Cancelled). Ryt ? Any solution for this ?
arundgr8
 
Posts: 4
Joined: Mon Feb 26, 2007 5:23 am
Location: Bangalore, India

Postby Rich » Mon Feb 26, 2007 7:24 am

Yep.

Put right what you've got wrong. Read the above posts and work out from your message log where it's failing. Then if you still can't work it out, post the relevant parts of the message log.

It might give us a clue.
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Check this out

Postby pindropsilence » Tue Feb 27, 2007 5:42 am

Hi All,

When you are running it online transaction must be having values of all screen fields mapped correctly and it is able to go to the last screen of it and thus saving it successfully.

If subrc is coming as 1001 in "N" mode it means transaction is not executing correctly and there must be some error in the execution.

The possible solution and the key is to look for the message table and find out what kind of messages you are getting into the message table. May be tcode is not able to find data for some screen field or there could be some other reason for why tcode is executing successfully.

Thanks
Pindropsilence
Forget past, live in today, think for tomorrow.
pindropsilence
 
Posts: 164
Joined: Fri Oct 03, 2003 12:36 am
Location: India

Check this out

Postby pindropsilence » Tue Feb 27, 2007 5:48 am

Hi All,

When you are running it online transaction must be having values of all screen fields mapped correctly and it is able to go to the last screen of it and thus saving it successfully.

If subrc is coming as 1001 in "N" mode it means transaction is not executing correctly and there must be some error in the execution.

The possible solution and the key is to look for the message table and find out what kind of messages you are getting into the message table. May be tcode is not able to find data for some screen field or there could be some other reason for why tcode is executing successfully.

Thanks
Pindropsilence
Forget past, live in today, think for tomorrow.
pindropsilence
 
Posts: 164
Joined: Fri Oct 03, 2003 12:36 am
Location: India

Postby Deeler Stan » Tue Feb 27, 2007 7:21 am

Rich wrote:Yep.

Put right what you've got wrong. Read the above posts and work out from your message log where it's failing. Then if you still can't work it out, post the relevant parts of the message log.

It might give us a clue.


Rich is right, do not use SY-SUBRC to check for success. If you use debug and mode A then when you return you will get 1001 in SUBRC.

I check for the appropriate success message from the transaction. It is the safest way..
Deeler Stan
 
Posts: 410
Joined: Thu Mar 31, 2005 3:44 am

Postby arundgr8 » Tue Feb 27, 2007 9:42 am

Hi Rich/Deeler stan/Pindropsilence,

Thanks for your response.
I agree with whatever you have mentioned.
But i'm not getting any Error messages in the Error message Internal
table that I assigned with the CAll TRANSACTION statement.
I'm getting a status message.
I analysed and found something interesting. Here is what I found...

Actually the system performs different logic based on the value of the OK_CODE, to get the value of Sy-Subrc.

1. When the perform statement (which contains the CALL TRANSACTION statement) was executed directly by pressing F6,

Sy-Subrc returned was 0.

2. When the perform statement was executed step by step by pressing F5 and after reaching the ‘CALL_TRANSACTION’ statement,

(a) When F5 key was used to execute that statement (CALL TRANSACTION), Sy-Subrc returned was 1001.

(b) When F6 key was used to execute that statement (CALL TRANSACTION), Sy-Subrc returned was 0.

3. The main reason for the changing Sy-Subrc is…based on the Key
(F5 or F6), the OK_CODE will be set (which can be viewed in

System Debugging mode). The Sy-Subrc value depends on the OK_CODE value. So it is getting changed.

Suggestions given for the solution:

Suggestion 1: We can change the Mode from ‘N’ to ‘P’ in the program.

(Here ‘N’ indicates No display and ‘P’ indicates No display; but debugging possible).But the problem is, the mode is defined as a Constant in an include program. We can’t do the changes in Include program, as the include program is being used by several other programs also. So this option will not be useful.

Suggestion 2: As the Sy-Subrc value ‘1001’ doesn’t stand for any Error execution…i.e., It is same as that of ‘0’, we can modify the code in the program like…

IF CALL_TRAN_RETURNCODE = 0 or

CALL_TRAN_RETURNCODE = ‘1001’.

MESSAGE I000 WITH 'Number Range Object ZS11_SEQ Reset to 0'.

ELSE.

MESSAGE I000 WITH 'Cannot Reset Number Range Object
ZS11_SEQ.'
'Please Notify On-Call Support'.

MESSAGE E000 WITH BDC_MESSAGE.

ENDIF.

Thanks,
Arun
arundgr8
 
Posts: 4
Joined: Mon Feb 26, 2007 5:23 am
Location: Bangalore, India


Return to ABAP

Who is online

Users browsing this forum: No registered users and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.