Hi,
Can we update two tables MARA & MARC in single run of this BAPI BAPI_MATERIAL_SAVEDATA ?
WA_HEADDATA-PURCHASE_VIEW = 'X'.
WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARC'.
WA_EXTENSIONIN-VALUEPART1+0(4) = <FS_DCS>-WERKS.
WA_EXTENSIONIN-VALUEPART1+4(8) = <FS_DCS>-ZZDCBNR.
APPEND WA_EXTENSIONIN TO IT_EXTENSIONIN.
WA_EXTENSIONINX-STRUCTURE = 'BAPI_TE_MARCX'.
WA_EXTENSIONINX-VALUEPART1+0(4) = <FS_DCS>-WERKS.
WA_EXTENSIONINX-VALUEPART1+4(1) = 'X'.
APPEND WA_EXTENSIONINX TO IT_EXTENSIONINX.
<FS_DCS>-FLAG = 'X'.
WA_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARA'.
WA_EXTENSIONIN-VALUEPART1+0(18) = WA_FPS-MATNR.
WA_EXTENSIONIN-VALUEPART1+78(18) = WA_FPS-ZZSPMATNR.
WA_EXTENSIONIN-VALUEPART1+96(18) = WA_FPS-ZZFPMATNR.
WA_EXTENSIONIN-VALUEPART1+114(10) = WA_FPS-ZZDREPIFID.
WA_EXTENSIONIN-VALUEPART1+124(10) = WA_FPS-ZZFREPIFID.
APPEND WA_EXTENSIONIN TO IT_EXTENSIONIN.
WA_EXTENSIONINX-STRUCTURE = 'BAPI_TE_MARAX'.
WA_EXTENSIONINX-VALUEPART1+0(18) = WA_FPS-MATNR.
WA_EXTENSIONINX-VALUEPART1+24(1) = 'X'.
WA_EXTENSIONINX-VALUEPART1+25(1) = 'X'.
WA_EXTENSIONINX-VALUEPART1+26(1) = 'X'.
WA_EXTENSIONINX-VALUEPART1+27(1) = 'X'.
APPEND WA_EXTENSIONINX TO IT_EXTENSIONINX.
WA_HEADDATA-MATERIAL = WA_FPS-MATNR.
WA_HEADDATA-BASIC_VIEW = 'X'.
CLEAR : WA_RETURN, WA_RETURN1, GV_STRING, GV_STRING1.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = WA_HEADDATA
IMPORTING
RETURN = WA_RETURN
TABLES
EXTENSIONIN = IT_EXTENSIONIN
EXTENSIONINX = IT_EXTENSIONINX.