2023 Jan 18 7:18 PM
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
2023 Jan 18 7:18 PM
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
2023 Jan 18 7:40 PM
What is the actual value of "sy-subrc" and which one of these two alternatives was executed?
2023 Jan 18 8:07 PM
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.
2023 Jan 19 10:16 AM
I'd start by checking the definition of S_ACCNO, is it a select-options?