Difference between revisions of "SAP EHS"
From SapWiki
(→BAPI) |
(→BAPI) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | ==Funciones== | ||
+ | *CBIH_IA30_IAL_READ | ||
==BAPI== | ==BAPI== | ||
− | * BAPI BAPI_BUS1240_CREATE - Trn. CBIH82 | + | *BAPI BAPI_BUS1240_CREATE - Trn. CBIH82 |
+ | *BAPI_BUS1240_CHANGE | ||
+ | *BAPI_BUS1240_DELETE | ||
+ | |||
+ | ==BADI== | ||
+ | *BADI EHSI_IA_BAPI para extensiones | ||
+ | <nowiki> | ||
+ | method IF_EX_EHSI_IA_BAPI~TRANSFER_EXTENSIONTAB_2_APITAB. | ||
+ | |||
+ | DATA: wa_extension TYPE bapiparex, | ||
+ | ext_value(960) TYPE c, | ||
+ | wa_action TYPE CCIHS_ACHAPI, | ||
+ | l_ref TYPE REF TO data. | ||
+ | |||
+ | FIELD-SYMBOLS: <l_struc> TYPE ANY, | ||
+ | <l_field> TYPE ANY. | ||
+ | |||
+ | loop at I_EXTENSION_IN_TAB into wa_extension where structure = 'ZMIESTRUCTURA' . | ||
+ | AT NEW structure. | ||
+ | CREATE DATA l_ref TYPE (wa_extension-structure). | ||
+ | ASSIGN l_ref->* TO <l_struc>. | ||
+ | ENDAT. | ||
+ | ext_value = wa_extension-valuepart1. | ||
+ | MOVE ext_value TO <l_struc>. | ||
+ | |||
+ | read TABLE X_API_ACTION_TAB into wa_action with key acid = wa_extension-valuepart2. | ||
+ | if sy-subrc = 0. | ||
+ | MOVE-CORRESPONDING <l_struc> to wa_action. | ||
+ | modify X_API_ACTION_TAB from wa_action index sy-tabix. | ||
+ | endif. | ||
+ | ENDLOOP. | ||
+ | endmethod.</nowiki> | ||
+ | |||
+ | <nowiki> | ||
+ | data ls_zmiestructura_e TYPE ZMIESTRUCTURA. | ||
+ | ... | ||
+ | MOVE-CORRESPONDING ls_zmiestructura TO ls_zmiestructura_e. | ||
+ | ls_extension_in-structure = 'ZMIESTRUCTURA'. | ||
+ | CALL METHOD cl_abap_container_utilities=>fill_container_c | ||
+ | EXPORTING | ||
+ | im_value = ls_zmiestructura_e | ||
+ | IMPORTING | ||
+ | ex_container = ls_extension_in-valuepart1 | ||
+ | EXCEPTIONS | ||
+ | illegal_parameter_type = 1 | ||
+ | OTHERS = 2. | ||
+ | ls_extension_in-valuepart2 = ls_zmiestructura-acid. | ||
+ | APPEND ls_extension_in TO lt_extension_in. | ||
+ | ... | ||
+ | CALL FUNCTION 'BAPI_BUS1240_CHANGE' | ||
+ | EXPORTING | ||
+ | flg_action = 'X' | ||
+ | * IMPORTING | ||
+ | * FLG_ABORT_ON_ERROR = | ||
+ | TABLES | ||
+ | return = lt_return | ||
+ | header = lt_header_b | ||
+ | action = lt_action_upd | ||
+ | actionx = lt_actionx_upd | ||
+ | extension_in = lt_extension_in.</nowiki> |
Latest revision as of 18:56, 4 September 2023
Funciones
- CBIH_IA30_IAL_READ
BAPI
- BAPI BAPI_BUS1240_CREATE - Trn. CBIH82
- BAPI_BUS1240_CHANGE
- BAPI_BUS1240_DELETE
BADI
- BADI EHSI_IA_BAPI para extensiones
method IF_EX_EHSI_IA_BAPI~TRANSFER_EXTENSIONTAB_2_APITAB. DATA: wa_extension TYPE bapiparex, ext_value(960) TYPE c, wa_action TYPE CCIHS_ACHAPI, l_ref TYPE REF TO data. FIELD-SYMBOLS: <l_struc> TYPE ANY, <l_field> TYPE ANY. loop at I_EXTENSION_IN_TAB into wa_extension where structure = 'ZMIESTRUCTURA' . AT NEW structure. CREATE DATA l_ref TYPE (wa_extension-structure). ASSIGN l_ref->* TO <l_struc>. ENDAT. ext_value = wa_extension-valuepart1. MOVE ext_value TO <l_struc>. read TABLE X_API_ACTION_TAB into wa_action with key acid = wa_extension-valuepart2. if sy-subrc = 0. MOVE-CORRESPONDING <l_struc> to wa_action. modify X_API_ACTION_TAB from wa_action index sy-tabix. endif. ENDLOOP. endmethod.
data ls_zmiestructura_e TYPE ZMIESTRUCTURA. ... MOVE-CORRESPONDING ls_zmiestructura TO ls_zmiestructura_e. ls_extension_in-structure = 'ZMIESTRUCTURA'. CALL METHOD cl_abap_container_utilities=>fill_container_c EXPORTING im_value = ls_zmiestructura_e IMPORTING ex_container = ls_extension_in-valuepart1 EXCEPTIONS illegal_parameter_type = 1 OTHERS = 2. ls_extension_in-valuepart2 = ls_zmiestructura-acid. APPEND ls_extension_in TO lt_extension_in. ... CALL FUNCTION 'BAPI_BUS1240_CHANGE' EXPORTING flg_action = 'X' * IMPORTING * FLG_ABORT_ON_ERROR = TABLES return = lt_return header = lt_header_b action = lt_action_upd actionx = lt_actionx_upd extension_in = lt_extension_in.