05-13-2010 5:09 PM
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
05-13-2010 5:30 PM
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
05-13-2010 6:40 PM
Hi Vikram ,
Thanks for your reply .
I m Creating Article Master data , BAPI_MATERIAL_SAVEDATA It wont be work I think.
Thanks ,
GJ
05-13-2010 11:26 PM
Hi,
As Vikram mentioned, you need to use the EXTENSIONIN and EXTENSIONINX parameters for Z-fields.
Arash
05-21-2010 6:11 AM
Hi ,
Kindly throw some light on this issue.
Best regards,
GJ
Edited by: Shankar GJ on May 21, 2010 11:22 AM
05-21-2010 10:31 AM
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
01-30-2014 5:04 PM