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

Error message

Former Member
0 Likes
2,637

Hi Friends,

I am calling a function module and then checking my Sy-Subrc value.

In my debugging mode everything is wroking fine and the sy-subrc value is 0. my code is below.

if sy-subrc <> 0.

message e003(ZSDBDS).

endif.

It is still giving me an error message, (e003(ZSDBDS)).

Shejal.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,216

Hi,

Find out all occurences of

message e003(ZSDBDS) in function module main program

and put break-point and check.

Regards,

Amole

34 REPLIES 34
Read only

Former Member
0 Likes
2,216

Hi Shejal,

Probably the same error message is being triggered at some other place in the code?

Regards,

ravi

Read only

0 Likes
2,216

I agree, search for that message in the entire program, see if it is being fired somewhere else as well.

Regards,

Rich Heilman

Read only

0 Likes
2,216

check if the values coming from function module is triggering the error message?

if it is in loop then check again...

Read only

0 Likes
2,216

Debug the program, and place a breakpoint on "message"...When you run it, it will stop on the error message -;)

Greetings,

Blag.

Read only

0 Likes
2,216

Its a new error message and it is no where in the program or anywhere else.

Shejal.

Read only

0 Likes
2,216

Can you post more of the code?

Regards,

Rich Heilman

Read only

0 Likes
2,216

Hi

Show your complete code. we will also try to get the same error message.

Regards

vijay

Read only

0 Likes
2,216

Detail code,

if i_input-PREPAID_COLLECT <> 'P'.

message e002(ZSDBDS).

else.

CALL FUNCTION 'ZSD_GET_RATE_DETAIL' DESTINATION 'RFC_APP'

EXPORTING

SERVER = ZSD_BDS_COMMUNI-SERVER

DATABASE = ZSD_BDS_COMMUNI-ZDATABASE

USERID = ZSD_BDS_COMMUNI-USERID

PASSWORD = ZSD_BDS_COMMUNI-PASSWORD

CONNECTIONSTRING = ZSD_BDS_COMMUNI-CONNECTIONSTRING

INQUIRYUSERID = ZSD_BDS_COMMUNI-INQUIRYUSERID

INQUIRYID = ZSD_BDS_COMMUNI-INQUIRYID

TABLES

INQUIRY_INPUT = i_input

INQUIRY_CHARGES = i_charges

INQUIRY_OUTPUT_DETAILS = i_output_details

INQUIRY_ERRORS = i_errors

EXCEPTIONS

OTHERS = 1 .

endif.

if sy-subrc <> 0.

message e003(ZSDBDS).

endif.

let me know if you need anything else guys.

Shejal.

Read only

0 Likes
2,216

Hi,

if i_input-PREPAID_COLLECT <> 'P'.
message e002(ZSDBDS).
else.
CALL FUNCTION 'ZSD_GET_RATE_DETAIL' DESTINATION 'RFC_APP'
EXPORTING
SERVER = ZSD_BDS_COMMUNI-SERVER
DATABASE = ZSD_BDS_COMMUNI-ZDATABASE
USERID = ZSD_BDS_COMMUNI-USERID
PASSWORD = ZSD_BDS_COMMUNI-PASSWORD
CONNECTIONSTRING = ZSD_BDS_COMMUNI-CONNECTIONSTRING
INQUIRYUSERID = ZSD_BDS_COMMUNI-INQUIRYUSERID
INQUIRYID = ZSD_BDS_COMMUNI-INQUIRYID
TABLES
INQUIRY_INPUT = i_input
INQUIRY_CHARGES = i_charges
INQUIRY_OUTPUT_DETAILS = i_output_details
INQUIRY_ERRORS = i_errors

EXCEPTIONS
OTHERS = 1 .
<b>if sy-subrc <> 0.
message e003(ZSDBDS).
endif.</b>
endif.

Regards

vijay

Read only

0 Likes
2,216

I don't see anything...... are you sure that you are check SY-SUBRC after the call function.

EXCEPTIONS
OTHERS = 1 .
endif.

<b>*  PUT BREAK POINT HERE!  What is SY-SUBRC?</b>
if sy-subrc <> 0.
message e003(ZSDBDS).
endif.

Regards,

Rich Heilman

Read only

0 Likes
2,216

Hi Shejal,

I understand that this part of the code is in a loop of the intrenl table i_input.

Are you sure it has only one entry?

It must be having multiple entries and hence it is not stipping at the error for some entries and may be triggered for some other entry.

regards,

Ravi

Read only

0 Likes
2,216

I have tried to put the break point at the exact same place where you have specified and the value is '0'.

however when i did the test i had commented the

  • if sy-subrc <> 0.

  • message e003(ZSDBDS).

  • endif.

the reason for commenting was without being commented it directly gave me the error message, inspite of having the break point much before the error message.

shejal.

Shejal.

Read only

0 Likes
2,216

So you are saying that you have the MESSAGE statement commented out of the program, but when you run the program, you still get the error message? Is this right?

If so, the message must be coming from somewhere else, or your program is not activated.

Regards,

Rich Heilman

Read only

0 Likes
2,216

Thanks everybody for all the suggestions. However if any one is intrested in the entire code i will be more than happy to mail you guys.

Shejal.

Read only

0 Likes
2,216

Sure send it to the email addres on my business card.

Regards,

Rich Heilman

Read only

0 Likes
2,216

NO rich u got me wrong. when i uncomment the message and have a break piont before the message it is giving me the error message directly, where as i am excepting it to stop at the break point. so i had uncommented the message and then had a break point just to check the sy-subrc value. when i uncmmented it its working fine and gives me results. but i need to check the condition.

shejal.

Read only

0 Likes
2,216

Hi,

you do this...

since FM has exception. but you are not handling the FM exception.just check it.

CALL FUNCTION 'ZSD_GET_RATE_DETAIL' DESTINATION 'RFC_APP'
EXPORTING
SERVER = ZSD_BDS_COMMUNI-SERVER
DATABASE = ZSD_BDS_COMMUNI-ZDATABASE
USERID = ZSD_BDS_COMMUNI-USERID
PASSWORD = ZSD_BDS_COMMUNI-PASSWORD
CONNECTIONSTRING = ZSD_BDS_COMMUNI-CONNECTIONSTRING
INQUIRYUSERID = ZSD_BDS_COMMUNI-INQUIRYUSERID
INQUIRYID = ZSD_BDS_COMMUNI-INQUIRYID
TABLES
INQUIRY_INPUT = i_input
INQUIRY_CHARGES = i_charges
INQUIRY_OUTPUT_DETAILS = i_output_details
INQUIRY_ERRORS = i_errors
 
EXCEPTIONS
OTHERS = 1 .
<b>if sy-subrc <> 0.
message e003(ZSDBDS).
endif</b>.

Regards

vijay

Read only

0 Likes
2,216

Are you sure the error message is coming out of this piece of code?

Read only

0 Likes
2,216

I Am sure because i just created that error message.

shejal.

Read only

0 Likes
2,216

Did you get my Email Rich.

Shejal.

Read only

0 Likes
2,216

Can I please see the code inside the function module.

Regards,

Rich Heilman

Read only

0 Likes
2,216

Your current code


IF i_input-prepaid_collect <> 'P'.<b><-- You are 
                                         checking this <u>current record</u></b>
  MESSAGE e002(zsdbds).
ELSE.
  CALL FUNCTION 'ZSD_GET_RATE_DETAIL' DESTINATION 'RFC_APP'
    EXPORTING
      server                 = zsd_bds_communi-server
      database               = zsd_bds_communi-zdatabase
      userid                 = zsd_bds_communi-userid
      password               = zsd_bds_communi-password
      connectionstring       = zsd_bds_communi-connectionstring
      inquiryuserid          = zsd_bds_communi-inquiryuserid
      inquiryid              = zsd_bds_communi-inquiryid
    TABLES
      inquiry_input          = i_input <b><-- but passing the entire table here?</b>
      inquiry_charges        = i_charges
      inquiry_output_details = i_output_details
      inquiry_errors         = i_errors
    EXCEPTIONS
      OTHERS                 = 1.
ENDIF.

IF sy-subrc <> 0. <b><-- why is this outside of the ENDIF 
                         as pointed out by Vijay before?</b>
  MESSAGE e003(zsdbds).
ENDIF.

Read only

0 Likes
2,216

First I am checking the condition

if i_input-PREPAID_COLLECT <> 'P'.

if it does not meet i dont want to call the FM.

Hence i have and endif after the FM call.

However i tried the other way with endif, as you guys have recommended but no change.

shejal.

Read only

0 Likes
2,216

Can you please do one thing? Go to SE91, enter this ZSDBDS message class and enter the number 003 and then do a where used list. See where else this message is being issued. I think you may be getting this from somewhere else.

Read only

0 Likes
2,216

I dont have anything in the source code of function module.

FUNCTION ZSD_GET_RATE_DETAIL.

*"----


""Local interface:

*" IMPORTING

*" VALUE(SERVER) TYPE CHAR50 OPTIONAL

*" VALUE(DATABASE) TYPE CHAR50 OPTIONAL

*" VALUE(USERID) TYPE VBAK-ERNAM OPTIONAL

*" VALUE(PASSWORD) TYPE CHAR30 OPTIONAL

*" VALUE(CONNECTIONSTRING) TYPE CHAR30 OPTIONAL

*" VALUE(INQUIRYUSERID) TYPE CHAR30 OPTIONAL

*" VALUE(INQUIRYID) TYPE CHAR10 OPTIONAL

*" TABLES

*" INQUIRY_INPUT STRUCTURE ZSD_INQUIRY_INPUT OPTIONAL

*" INQUIRY_CHARGES STRUCTURE ZSD_INQUIRY_CHARGES OPTIONAL

*" INQUIRY_OUTPUT_DETAILS STRUCTURE ZSD_INQUIRY_OUTPUT_DETAILS

*" OPTIONAL

*" INQUIRY_ERRORS STRUCTURE ZSD_INQUIRY_ERRORS OPTIONAL

*"----


ENDFUNCTION.

Shejal.

Read only

0 Likes
2,216

check the values in i_input table. whether there is null values r there which doesn't meet the condition.

if there r any null values appended then change select statement.

Read only

0 Likes
2,216

The point is, if you keep the 'IF SY-SUBRC <> 0' outside the previous ENDIF, there is a chance that this error message is raised even if the rfc is not executed. Let us say, before the 'I_INPUT-PREPAID_COLLECT <> 'P'.', sy-subrc is not zero and this condition is satisfied. Then your function module will not be executed, but still the error message will be raised because SY-SUBRC was already non-zero.

Second, you are probably looping at I_INPUT and checking this condition, but when it comes to calling the function module, you are passing the entire table. Which means, you will be passing the entire internal table to the RFC, for every record of the internal table, assuming PREPAID_COLLECT <> 'P' in every record. Is that what you want to do?

Srinivas

Read only

0 Likes
2,216

Srinivas can i have your eamil id please. I would like to send you the code. I am kind of a bit confused on your previous message or you can mail on shejal_79@yahoo.com. i will reply back.

Shejal.

Read only

0 Likes
2,216

Before the fM, clear the return code.

and move the sy-subrc check immediately after the FM call.

Read only

Former Member
0 Likes
2,216

Hi,

check if import is commented or not.

call function 'TEST'

export

<b> import</b>

if sy-subrc <> 0.

endif.

Regards

Amole

Read only

Former Member
0 Likes
2,218

Hi,

Find out all occurences of

message e003(ZSDBDS) in function module main program

and put break-point and check.

Regards,

Amole

Read only

Former Member
0 Likes
2,216

Hi Shejal,

Execute the program in debug mode. Once you are in debug screen, click Breakpoint -> Breakpoint at -> Statement. In the statement field, put 'message' as keyword.

Now execute the program (F8). The program will stop at the place where the error message is being called. That will give you an idea from where message is actually coming.

Cheers,

Vikram

Pls reward for helpful replies!!

Read only

Former Member
0 Likes
2,216

Hi Shejal Shetty,

if i_input-PREPAID_COLLECT <> 'P'.

message e002(ZSDBDS).

else.

<u><b>* Initialize the return code

CLEAR: SY-SUBRC.</b></u>

CALL FUNCTION 'ZSD_GET_RATE_DETAIL' DESTINATION 'RFC_APP'

EXPORTING

SERVER = ZSD_BDS_COMMUNI-SERVER

DATABASE = ZSD_BDS_COMMUNI-ZDATABASE

USERID = ZSD_BDS_COMMUNI-USERID

PASSWORD = ZSD_BDS_COMMUNI-PASSWORD

CONNECTIONSTRING = ZSD_BDS_COMMUNI-CONNECTIONSTRING

INQUIRYUSERID = ZSD_BDS_COMMUNI-INQUIRYUSERID

INQUIRYID = ZSD_BDS_COMMUNI-INQUIRYID

TABLES

INQUIRY_INPUT = i_input

INQUIRY_CHARGES = i_charges

INQUIRY_OUTPUT_DETAILS = i_output_details

INQUIRY_ERRORS = i_errors

EXCEPTIONS

OTHERS = 1 .

<u><b>* Here u can check the return code

if sy-subrc <> 0.

message e003(ZSDBDS).

endif

endif..</b></u>

<u><b>* Don't check here

if sy-subrc <> 0.

message e003(ZSDBDS).

endif.</b></u>

- Selvapandian Arunachalam

Read only

Former Member
0 Likes
2,216

Got your code. I don't see why this error message should be raised even though sy-subrc = 0. There are other changes that can be made to the code, but they are not relavant to this issue, so I won't touch upon them.

Just a hunch. Did you activate the code, and generate the main program of this user exit?

Message was edited by: Srinivas Adavi

Of course apart from the question about the position of your IF SY-SUBRC <> 0.