‎2006 Jul 10 1:42 PM
Hi Friends,
I have 60 user defined fields in append structure of MARA.
I enhanced BAPI_TE_MARA structure with user defined fields (same as Mara append structure)and also enhanced BAPI_TE_MARAX with same user defined field names but dataelement as "BAPIUPDATE" for all fields.
Now My question is how to populate internal tables EXTENSIONIN and EXTENSIONINX. I saw few discussions on SDN network , but I did not find proper answers. PL provide sample code to update customer-defined fields sucessfully using BAPI.
Appreciate your prompt reply.
Thanks in Advance.
‎2006 Jul 10 1:52 PM
Populate the fields in BAPI_TE_MARA and mark the flag for the corrsponding fields in BAPI_TE_MARAX to X.
If BAPI_TE_MARA has 2 fields FLD1 and FLD2 u need to populate these 2 fields and the flags corresponding to these fields i.e. FLD1 and FLD2 in BAPI_TE_MARAX as X.
Dont forget to use BAPI_TRANSACTION_COMMIT after the material update BAPI.
-Kiran
‎2006 Jul 10 2:23 PM
Hi Kiran,
Thanks for your quick reply. I understand how to populate EXTENSIONIN and EXTENSIONINX certen extend.
My problem is I have 60 customer defined fields in Mara. the total lenght of the field BAPIPAREX-VALUEPART1 is only 240 char. my total fields lenghts are much more than 240 char. and also I did not understand the usage of field VALUEPART2,VALUEPART3,VALUEPART4 in BAPIPARX.
Any clarification purpuse of these fields. Appreciate any sample code for updating multiple user defined fields.
Thanks
‎2006 Jul 10 2:39 PM
VALUEPART2,VALUEPART3 and VALUEPART4 are also to be used for populating data in the custom fields.
Lets say you have added a structure to MARA called STR1 which has 3 fields, 10 char each. You also need to create STR1X which has 1 character flags for the fields in STR1.
To populate values in these fields u need to maintain the extension tables as below:
BAPIPAREX-STRUCTURE = 'STR1'.
BAPIPAREX-VALUEPART1+0(10) = '1st FLD'.
BAPIPAREX-VALUEPART1+10(10) = '2nd FLD'.
BAPIPAREX-VALUEPART1+20(10) = '3rd FLD'.
APPEND BAPIPAREX.
BAPIPAREXX-STRUCTURE = 'STR1X'.
BAPIPAREXX-VALUEPART1+0(1) = 'X'.
BAPIPAREXX-VALUEPART1+1(1) = 'X'.
BAPIPAREXX-VALUEPART1+2(1) = 'X'.
APPEND BAPIPAREXX.
If you have more than 60 fields you could split the fields in to multiple strucutres and populate the extensions for each structure.
-Kiran
*Please reward useful answers
‎2006 Jul 10 2:52 PM
Hi Kiran,
Thanks for your quick reply. let me try passing fields to VALUEPART2 and VALUEPART3 and VALUEPART4 fields also.
Thanks