‎2006 Nov 07 9:15 AM
hi all,
we r using 'BAPI_MATERIAL_SAVEDATA' to update MVKE with 3 custom fields and one standard field.
BAPI_TE_MVKE, BAPI_TE_MVKEX are extended to include the z-fields.
after BAPI call commit is also done. BAPI returns a success message. but finally in table i dont see the update.
what could be the reason ? we have done such things before and succeeded.
<b>but this time the difference is that the z-fields added to MVKE are not present in any view of any transaction.
they are only in the table</b>
any useful info. in this regard is appreciated.
‎2006 Nov 07 10:34 AM
‎2014 Sep 12 9:36 AM
Hello all,
please make sure that customizing is set properly for the Z-fields.
Follow the steps in post:
Important for MVKE extension:
Here is a demo report that is working for me (change of existing material) after correct customizing setup:
*&---------------------------------------------------------------------*
*& Report ZDEMO_BAPI_MATERIAL_SAVEDATA
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zdemo_bapi_material_savedata.
DATA: headdata TYPE bapimathead,
lt_extensionin TYPE STANDARD TABLE OF bapiparex,
wa_extensionin LIKE LINE OF lt_extensionin,
lt_extensioninx TYPE STANDARD TABLE OF bapiparexx,
wa_extensioninx LIKE LINE OF lt_extensioninx,
wa_bapi_te_mvke TYPE bapi_te_mvke,
wa_bapi_te_mvkex TYPE bapi_te_mvkex,
return TYPE bapiret2,
returnmes TYPE TABLE OF bapi_matreturn2.
headdata-material = '1N4148'.
headdata-sales_view = 'X'.
wa_bapi_te_mvke-sales_org = '0100'.
wa_bapi_te_mvke-distr_chan = '10'.
wa_bapi_te_mvke-zzabcnetwr = 'A'.
wa_bapi_te_mvkex-sales_org = '0100'.
wa_bapi_te_mvkex-distr_chan = '10'.
wa_bapi_te_mvkex-zzabcnetwr = 'X'.
wa_extensionin-structure = 'BAPI_TE_MVKE'.
wa_extensionin-valuepart1 = wa_bapi_te_mvke.
APPEND wa_extensionin TO lt_extensionin.
wa_extensioninx-structure = 'BAPI_TE_MVKEX'.
wa_extensioninx-valuepart1 = wa_bapi_te_mvkex.
APPEND wa_extensioninx TO lt_extensioninx.
* Call the BAPI
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = headdata
IMPORTING
return = return
TABLES
returnmessages = returnmes
extensionin = lt_extensionin
extensioninx = lt_extensioninx.
* RETURN-TYPE is 'E' in case of error, else 'S'.
IF return-type = 'E'.
* le_error_count = le_error_count + 1.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
LOOP AT returnmes ASSIGNING FIELD-SYMBOL(<return>).
WRITE: <return>-message, <return>-field.
ENDLOOP.
ELSE.
*---- Kein Commit nötig??
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true.
ENDIF.