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: 

How to resolve the error

0 Kudos

FORM fetch_data.

* MESSAGE 'An error occurred during data fetch.' TYPE <TYPE>.
IF P_RB1 = 'X'.
SELECT TRANSACTION_DATE TRANSACTION_ID TRANSACTION_AMOUNT CURRENT_BALANCE CURRENCY
FROM Z019_ACCOUNT AS AC INNER JOIN Z019_TRANSACTION AS TR
ON AC~ACCOUNT_NUMBER = TR~TO_ACC_NO INTO CORRESPONDING FIELDS OF TABLE GT_OUT
WHERE AC~ACCOUNT_NUMBER IN S_ACCNO.

ELSEIF P_RB2 = 'X'.
SELECT TRANSACTION_DATE TRANSACTION_ID TRANSACTION_AMOUNT CURRENT_BALANCE CURRENCY
FROM Z019_ACCOUNT AS AC INNER JOIN Z019_TRANSACTION AS TR
ON AC~ACCOUNT_NUMBER = TR~FROM_ACC_NO INTO CORRESPONDING FIELDS OF TABLE GT_OUT
WHERE AC~ACCOUNT_NUMBER IN S_ACCNO.

IF SY-SUBRC <> 0.
MESSAGE 'An error occurred during data fetch.' TYPE 'E'.
ENDIF.
ENDIF.

ENDFORM.

ERROR : S_ACCNO is not an internal table

4 REPLIES 4

AlexGourdet
Community Manager
Community Manager
0 Kudos

Thank you for visiting SAP Community to get answers to your questions.

As you're looking to get most out of your community membership, please consider include a profile picture to increase user engagement & additional resources to your reference that can really benefit you:

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

All the best,

Alex

manfred_reinart
Active Participant
0 Kudos

What is the actual value of "sy-subrc" and which one of these two alternatives was executed?

Sandra_Rossi
Active Contributor

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Clarify what "error" you have. It could be anything.

Use the ABAP debugger. We don't have access to your system.

Patrick_vN
Active Contributor
0 Kudos

I'd start by checking the definition of S_ACCNO, is it a select-options?