Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
RV_INVOICE_DOCUMENT_READ not returning any data in form in SAP FM
When using the RV_INVOICE_DOCUMENT_READ function module in SAP, you may encounter issues where no data is returned in forms. The most common cause is the missing alpha conversion for input parameters.
Understanding Alpha Conversion
Alpha conversion is SAP's internal process that formats numeric data with leading zeros. When you call a function module directly in SE37 (Function Builder), it automatically performs alpha conversions as part of parameter processing. However, when calling the same function module from ABAP code, you must handle this conversion manually.
Common Issue
The RV_INVOICE_DOCUMENT_READ function module expects document numbers in internal format (with leading zeros). If you pass external format numbers, the function may not find any matching records.
Solution Example
Before passing parameters to the function module, apply internal formatting using alpha conversion ?
DATA: lv_invoice_doc TYPE vbeln_vf VALUE '1234567890'.
" Apply alpha conversion to input parameter
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_invoice_doc
IMPORTING
output = lv_invoice_doc.
" Now call the function module with converted parameter
CALL FUNCTION 'RV_INVOICE_DOCUMENT_READ'
EXPORTING
document_number = lv_invoice_doc
TABLES
invoice_header = lt_header
invoice_items = lt_items.
Alternative Approach
You can also use the ALPHA conversion exit directly in your variable assignment ?
DATA: lv_invoice_doc TYPE vbeln_vf.
" Direct alpha conversion
lv_invoice_doc = |{ '1234567890' ALPHA = IN }|.
Conclusion
Always ensure proper alpha conversion of input parameters when calling SAP function modules from ABAP code, as this internal formatting is crucial for data retrieval functions like RV_INVOICE_DOCUMENT_READ.
