Skip to Content
0
Aug 17, 2015 at 06:07 PM

Custom field in MARC not updating via BAPI BAPI_MATERIAL_SAVEDATA.

1243 Views

Hi

I need to add custom fields in MARA and MARC , for MARA custom fields are getting updated but for MARC even though BAPI is not returning any error but it is not getting update in MARC table.

I have already added fields in BAPI_MARC & BAPI_MARCX. & Functional guyz have done SPRO settings.

Adding my code below:-

WA_HEADDATA-MATERIAL = '5FRP349V'.


 CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
   EXPORTING
     INPUT  = WA_HEADDATA-MATERIAL
   IMPORTING
     OUTPUT = WA_HEADDATA-MATERIAL.


 MOVE 'BAPI_TE_MARC' TO WA_EXTENSIONIN-STRUCTURE.
 WA_EXTENSIONIN-VALUEPART1+5(8) =  'ABCDEFGH'.
 WA_EXTENSIONIN-VALUEPART1+0(4) = '1010'.
 APPEND WA_EXTENSIONIN TO IT_EXTENSIONIN.

 MOVE 'BAPI_TE_MARCX' TO WA_EXTENSIONINX-STRUCTURE.
 WA_EXTENSIONINX-VALUEPART1+5(1) = 'X'.
 WA_EXTENSIONINX-VALUEPART1+0(4) = '1010'.
 APPEND WA_EXTENSIONINX TO IT_EXTENSIONINX.

 WA_PLANTDATA-PLANT = '1010'.
 WA_PLANTDATAX-PLANT = '1010'.



 CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
   EXPORTING
     HEADDATA     = WA_HEADDATA
     PLANTDATA    = WA_PLANTDATA
     PLANTDATAX   = WA_PLANTDATAX
   IMPORTING
     RETURN       = WA_RETURN
   TABLES
     EXTENSIONIN  = IT_EXTENSIONIN
     EXTENSIONINX = IT_EXTENSIONINX.

 IF WA_RETURN-TYPE CA 'EA'.
   ROLLBACK WORK.
 ELSE.
   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT = 'X'.
 ENDIF.

Please suggest What I am doing wrong

Regards,

Ankesh