Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_MATERIAL_MAINTAINDATA_RT for MARA 'Z' fields

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

Hi Shankar,

You should instead use BAPI BAPI_MATERIAL_SAVEDATA to create/save material.

Use parameters EXTENSIONIN and EXTENSIONINX to save values in custom fields. Check out documentation for this FM.

Cheers,

Vikram

0 Kudos

Hi Vikram ,

Thanks for your reply .

I m Creating Article Master data , BAPI_MATERIAL_SAVEDATA It wont be work I think.

Thanks ,

GJ

0 Kudos

Hi,

As Vikram mentioned, you need to use the EXTENSIONIN and EXTENSIONINX parameters for Z-fields.

Arash

0 Kudos

Hi ,

Kindly throw some light on this issue.

Best regards,

GJ

Edited by: Shankar GJ on May 21, 2010 11:22 AM

Former Member
0 Kudos

Shankar,

Have you gone thru the documentation of EXIT_SAPL1001_003?

Detailed examople is given. Check whether you are missing some thing. seems you have choosen write exit.

--

Reddy

0 Kudos

Hello Sankar,

Check note 568513.

Hope it helps.

BRs,

RDM