‎2008 Dec 12 1:55 PM
Hi ALL
Good Day
I appended the structure zamarc in marc table and i had 4 fields in my structure and I am using the bapi_material_savedata to update these fields but these fields are not updated
Please someone help me in this case.
I did the coding, which is mentioned below .
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = i_headdata
clientdata = i_clientdata
clientdatax = i_clientdatax
plantdata = i_plantdata
plantdatax = i_plantdatax
IMPORTING
return = i_return
TABLES
extensionin = i_extin
extensioninx = i_extinx.
IF i_return-type = 'E'. " M01->
WRITE: / 'Update Error: ',
/ i_return-message.
READ TABLE t_messages WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
CLEAR t_error.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = t_messages-msgid
lang = sy-langu
no = t_messages-msgnr
v1 = t_messages-msgv1
v2 = t_messages-msgv2
v3 = t_messages-msgv3
v4 = t_messages-msgv4
IMPORTING
msg = t_error-desc
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
t_error-matnr = t_marc-matnr.
t_error-old_mip = t_marc-eisbe.
t_error-new_mip = t_optimiza-mip.
APPEND t_error.
v_mip_err = v_mip_err + 1.
ENDIF.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
EXPORTING
wait = ''. "commit now rather than later
"and only come back when locks released
v_mip_cnt = v_mip_cnt + 1.
ENDIF.
ENDLOOP.
Thanks in advance.
‎2008 Dec 14 9:22 AM
you have added the fileds in MARC table with ZAMARC ,but your not adding the BAPI , how its update your fields.
for this you need to extend the your BAPI using below strcture
*" EXTENSIONIN STRUCTURE BAPIPAREX OPTIONAL
*" EXTENSIONINX STRUCTURE BAPIPAREXX OPTIONAL
the other methods not correct for materail master date like BDC .....