2021 Jun 16 12:24 PM
Hi guys,
I'm using a function module RFC_READ_TABLE to get 'BSEG' table data. Based on my filter condition there are 11 records. But it's returning only 1 record that too all the field values are coming as '###...' or 'some chinese or japanese letter'. And surprisingly every time that 1 record is having different values but in same '###' or 'unknown language letters' format.
Code as:TYPES: BEGIN OF ty_bseg,
mandt TYPE mandt,
bukrs TYPE bukrs,
belnr TYPE belnr_d,
gjahr TYPE gjahr,
prctr TYPE prctr,
END OF ty_bseg.
DATA: lt_bseg_temp TYPE STANDARD TABLE OF ty_bseg.
CALL FUNCTION 'RFC_READ_TABLE' DESTINATION 'NONE'
EXPORTING query_table = 'BSEG'
* DELIMITER = ' '* NO_DATA = ' '
* ROWSKIPS = 0
* ROWCOUNT = 0
TABLES options = lt_option_bseg
fields = lt_field_bseg
data = lt_bseg_TEMP
EXCEPTIONS table_not_available = 1
table_without_data = 2
option_not_valid = 3
field_not_valid = 4
not_authorized = 5
data_buffer_exceeded = 6
OTHERS = 7.
Note: while debugging into the FM the 'DATA' table parameter is pulling 11 records
but when coming back to the main program it's getting only 1 record that too wrong values.
Just not to make code lengthy I'm not adding the code for lt_option_bseg and lt_field_bseg.
Please help if any idea. 🙂
2021 Jun 16 12:40 PM
Please edit your question, select your code and press the "CODE" button to make it correctly colorized/indented, so that it's easier for us to analyze it. Thank you.
2021 Jun 16 12:59 PM
It's well-known that SAP recommends to not use RFC_READ_TABLE because of all its flaws. You should create your own RFC-enabled function module.
2021 Jun 16 1:14 PM
I guess it's true that this FM is not a proper one. Now that I changed the type of internal table to the type of FM's parameter type, it's working fine.
But I'm using my own type for the internal table to call BKPF and it did work there but not in BSEG's case.
Still whatever be it now the program is running fine. Thanks for the suggestions.