Using HRFORM and HRFORMS_METADATA



我正在使用HRFORMS和HRFORMS_METADATA交易更改表单,我确实创建了一个新字段

MetaDimensions->ZBAN_SWIFT2
Using MF -> ZHRCA_READ_BANK_2 that have
Interface local:
*"  IMPORTING
*"     REFERENCE(BANK_COUNTRY) LIKE  BNKA_BF-BANKS
*"     REFERENCE(BANK_NUMBER) LIKE  BNKA_BF-BANKL
*"     REFERENCE(SPRSL) TYPE  SPRAS DEFAULT SY-LANGU
*"  EXPORTING
*"     VALUE(SWIFT) TYPE  SWIFT
  data
      it_bank TYPE bnka-SWIFT.
SELECT swift
  FROM bnka
  INTO it_bank
       WHERE  banks  = bank_country
       AND    bankl  = bank_number.
ENDSELECT.
SWIFT = it_bank.
MetaFields
   Key        MetaFields         type Field 
    X       BANK_COUNTRY           BANKS
    X       BANK_NUMBER            BANKK
Attribute
    X          SWIFT               SWIFT

Create MetaStar
ZDADOS_SWIFT
where:
MetaDimension        MetaFields         type Field 
  ZBAN_SWIFT2       BANK_COUNTRY           BANKS
  ZBAN_SWIFT2       BANK_NUMBER            BANKK

然后保存,在事务HRFORMS上,我将新字段传递给INFONET,然后激活…但是自动生成的程序打印,它改变了对我的函数模块的调用,生成了EXPORTING而不是CHANGING

METHOD read_ZBAN_SWIFT2.
  define_dim_fs ZBAN_SWIFT2.
  LOOP AT formdata-dim_ZBAN_SWIFT2
          ASSIGNING <dwa_ZBAN_SWIFT2> WHERE
            SWIFT IS INITIAL AND
            ( NOT key IS INITIAL or key IS INITIAL ).
* Call the function which fills the dimension attributes
    CALL FUNCTION 'ZHRCA_READ_BANK_2'
      EXPORTING
        sprsl         = language
        BANK_COUNTRY  = <dwa_ZBAN_SWIFT2>-key-BANK_COUNTRY
        BANK_NUMBER   = <dwa_ZBAN_SWIFT2>-key-BANK_NUMBER
      CHANGING
        SWIFT         = <dwa_ZBAN_SWIFT2>-SWIFT
      EXCEPTIONS
        display_error = 4
        no_authority  = 3
        others        = 0.
    IF sy-subrc <> 0.
      CALL METHOD insert_message( ).
    ENDIF.
  ENDLOOP.
ENDMETHOD.          "read_ZBAN_SWIFT2

在最后这是错误

发生了一个异常,下面将详细解释。分配给CX_SY_DYN_CALL_PARAM_NOT_FOUND类的例外是没有陷入程序READ_ZBAN_SWIFT2 (METHOD),也没有通过raise来传播条款。因为过程的调用者不可能预料到异常发生,当前程序终止。异常的原因是:调用功能模块ZHRCA_READ_BANK_2参数为SWIFT

该参数未定义。

谁能告诉我为什么?

我找到了一个用SAP标准交付的例子。它是功能模块HRF_READ_BANK_ATTRIBUTES。如果你看一下它,你会发现所有的输出参数都被定义为CHANGING

我猜这个框架期望输出参数完全像那样定义。

*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(SPRSL) TYPE  SPRAS DEFAULT SY-LANGU
*"     REFERENCE(BEGDA) TYPE  BEGDA DEFAULT '18000101'
*"     REFERENCE(ENDDA) TYPE  ENDDA DEFAULT '99991231'
*"     REFERENCE(BANK_NUMBER) TYPE  BANKL
*"     REFERENCE(CONTROL_KEY) TYPE  BKONT
*"     REFERENCE(COUNTRY) TYPE  LAND1
*"  CHANGING
*"     REFERENCE(BANK_NAME) TYPE  BANKA OPTIONAL
*"     REFERENCE(ADDRESS_KEY) TYPE  ADRNR OPTIONAL
*"     REFERENCE(BANK_BRANCH) TYPE  BRNCH OPTIONAL
*"  EXCEPTIONS
*"      DISPLAY_ERROR
*"----------------------------------------------------------------------

相关内容

  • 没有找到相关文章

最新更新