输入参数的数目不足。 出错 invoice_ocr1 (line 3) if size(imagen,3)==3 %RGB image
时间: 2024-05-18 21:16:48 浏览: 8
根据你提供的信息,这个错误似乎与一个名为 "invoice_ocr1" 的函数有关,该函数的第三行中使用了一个名为 "imagen" 的参数。
从错误信息来看,这个函数期望传入的图像是一个 RGB 图像,即它必须具有三个通道。但是,由于您提供的参数数量不足,导致该函数无法正确地解析输入的图像。因此,建议您检查您的代码,确保在调用 "invoice_ocr1" 函数时提供了正确数量的参数,并且这些参数都是正确的图像。
相关问题
sap RV_INVOICE_CREATE的作用、参数即代码示例
SAP RV_INVOICE_CREATE是一个函数模块,用于创建SAP发票。它的作用是将SAP销售订单或交货单转换为SAP发票。
以下是该函数模块的一些参数:
- I_BUKRS:公司代码
- I_FKART:发票类型
- I_FKDAT:发票日期
- I_FKIVV:发票抬头
- I_FKIVP:发票抬头地址
- I_FKIVZ:发票抬头参考
- I_FKKNR:客户号
- I_FKONT:合同号
- I_FKTYP:发票类型
- I_SALES_DOCUMENT:销售订单号或交货单号
- I_UPDATE_HISTORY:是否更新历史记录
以下是一个简单的示例代码,演示如何使用RV_INVOICE_CREATE函数模块:
```
DATA: ls_invoice_header TYPE bapifkinv,
lt_invoice_items TYPE TABLE OF bapifkism,
lt_invoice_schedule TYPE TABLE OF bapifkpsm,
lt_return TYPE TABLE OF bapiret2.
ls_invoice_header-fkart = 'Z001'.
ls_invoice_header-fkdat = sy-datum.
ls_invoice_header-fkivv = 'ABC Company'.
ls_invoice_header-fkknr = '123456'.
ls_invoice_header-fktyp = 'M'.
ls_invoice_header-bukrs = '1000'.
APPEND ls_invoice_header TO lt_invoice_header.
CALL FUNCTION 'RV_INVOICE_CREATE'
EXPORTING
update_history = 'X'
TABLES
invoice_header = lt_invoice_header
invoice_items = lt_invoice_items
invoice_schedule = lt_invoice_schedule
return = lt_return.
IF sy-subrc EQ 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.
```
在上述示例中,我们首先定义了发票的头部信息,并将其附加到一个表中。然后,我们调用RV_INVOICE_CREATE函数模块,并将发票头部信息表、发票项目表、发票计划表和返回表传递给它。最后,我们提交或回滚事务,具体取决于函数模块的返回代码。
for index, (invoice_info, details_infos) in enumerate(zip(details, invoice_details)): for line_detail in details_infos: line_item_name = ignore_special_symbols(try2get(line_detail, item_name_keys)) line_item_price = line_detail['单价'] if line_item_name in item_name_map.keys(): item_name_map[line_item_name][0].append(xor_float_r2(line_item_price)) item_name_map[line_item_name][1].append(index) else: if not line_item_name: continue item_name_map.update({line_item_name: ([xor_float_r2(line_item_price)], [index])})将这段代码简化
这段代码的作用是将发票信息中的每个条目的名称和价格存储到一个字典中,字典的键是名称,值是一个元组列表,元组中包含价格和该条目在发票信息中的索引。
代码简化后如下:
```
for invoice_info, details_infos in zip(details, invoice_details):
for line_detail in details_infos:
line_item_name = ignore_special_symbols(try2get(line_detail, item_name_keys))
line_item_price = line_detail['单价']
if not line_item_name:
continue
if line_item_name in item_name_map:
item_name_map[line_item_name][0].append(xor_float_r2(line_item_price))
item_name_map[line_item_name][1].append(index)
else:
item_name_map[line_item_name] = ([xor_float_r2(line_item_price)], [index])
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)