Skip to Content
0
Former Member
May 13, 2010 at 04:09 PM

BAPI_MATERIAL_MAINTAINDATA_RT for MARA 'Z' fields

548 Views

Hi ,

I need to populate 'ZZ' fields which are appended to 'MARA' table using the BAPI function 'BAPI_MATERIAL_MAINTAINDATA_RT'. I see there are two parameters for custom fields. They are 'clientext' and 'clientextx'. I need to populate custom fields which are appended to the MARA table.

Say for example if I want to populate two custom fields. One is 'ZCOLOR' the value of which is black , the second one is 'ZFABRIC' , the value of which is 'COTTON'. If I want to populate this info using 'clientext' and 'clientextx' , how to do it.

i did some in coding EXIT_SAPL1001_003 But its not updating in MARA table , Give me some inputs .

This is my Code

DATA: BEGIN OF H_CLIENTEXT_C,      "Customer data
        FUNCTION  LIKE BAPIE1MARAEXTRT-FUNCTION,  "Key field
        MATERIAL  LIKE BAPIE1MARAEXTRT-MATERIAL,  "Key field
        FIELD1    TYPE BAPIE1MARAEXTRT-FIELD1.
DATA: END   OF H_CLIENTEXT_C.
DATA: BEGIN OF H_CLIENTEXT,     "Customer update information
        FUNCTION  LIKE BAPIE1MARAEXTRT-FUNCTION,  "Key field
        MATERIAL  LIKE BAPIE1MARAEXTRT-MATERIAL,  "Key field
        FIELD1 LIKE BAPIE1MARCEXTRT-FIELD1,     "Key field
        END   OF H_CLIENTEXT.

DATA: BEGIN OF H_CLIENTEXTX,     "Customer update information
        FUNCTION  LIKE BAPIE1MARAEXTRT-FUNCTION,  "Key field
        MATERIAL  LIKE BAPIE1MARAEXTRT-MATERIAL,  "Key field
        FIELD1 LIKE BAPIE1MARCEXTRT-FIELD1,     "Key field
        END   OF H_CLIENTEXTX.

  CASE PARAMETER_NAME.
    WHEN C_PARNAM_CLIENTEXT.
      H_CLIENTEXT_C  = F_CLIENTEXT.

      MOVE-CORRESPONDING H_CLIENTEXT_C TO  H_CLIENTEXT.
      H_CLIENTEXTX = F_CLIENTEXTX.
BREAK-POINT.
      IF NOT H_CLIENTEXTX-FIELD1 IS INITIAL  " ZZPCQTY
      OR NOT F_HEADDATA-ALL_FIELDS IS INITIAL.
*       Corresponding data field is relevant for update
        IF H_CLIENTEXT-FIELD1 IS INITIAL.
          T_RES_FIELDS-FELDNAME = 'MARA-ZZPCQTY'.
          APPEND T_RES_FIELDS.
         ENDIF.
      ELSE.
        CLEAR H_CLIENTEXT-FIELD1.
      ENDIF.
      F_MARA_UEB-ZZPCQTY = H_CLIENTEXT-FIELD1.

Thanks ,

GJ