Application Development and Automation 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: 
Read only

BAPI_MATERIAL_SAVEDATA - extending this BAPI

Former Member
0 Likes
525

I want to extend this BAPI to update customer fields that we are adding on MARA. Does anyone have an example ( not the help documentation on EXTENSIONIN/EXTENSIONX.)

thx,

Edited by: J.J on Nov 12, 2008 7:53 AM

3 REPLIES 3
Read only

Former Member
0 Likes
491

whats the issue with documentaion on extensionin segment?

Read only

0 Likes
491

There is no issue. I am simply looking for an example from someone that has used it.

Edited by: J.J on Nov 12, 2008 9:49 AM

Read only

0 Likes
491

Hi

Here is a sample code I had written some time back. There are many BAPIs which use these structures to update fields which are added to std Tables like MARA.

This will work if MARA , BAPI_TE_MARAX , BAPI_TE_MARA & T130f all have appropreate fields.

&----


*& Report Z_VMA_MARA_EXT

*& written by : Vivek Amrute.Tested on ECC6 :

*& Updating values of custom fields added to MARA.

REPORT z_vma_mara_ext.

TABLES : mara, marc.

DATA : rex LIKE bapiparex OCCURS 0 WITH HEADER LINE,

rexx LIKE bapiparexx OCCURS 0 WITH HEADER LINE,

header LIKE bapimathead OCCURS 0 WITH HEADER LINE,

makt1 LIKE bapi_makt OCCURS 0 WITH HEADER LINE,

zbapiret2 LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

PARAMETERS : material LIKE mara-matnr,

val1 TYPE aktvt,

val2 TYPE actname_kk,

val3 TYPE aktvt,

new_desc TYPE maktx.

header-material = material.

rex-structure = 'BAPI_TE_MARA'.

CONCATENATE material val1 val2 val3 INTO rex-valuepart1 RESPECTING BLANKS.

APPEND rex.

rexx-structure = 'BAPI_TE_MARAX'.

CONCATENATE material 'XXX' INTO rexx-valuepart1 RESPECTING BLANKS.

APPEND rexx.

makt1-langu = 'E'.

makt1-langu_iso = 'EN'.

makt1-matl_desc = new_desc.

APPEND makt1.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = header

IMPORTING

return = zbapiret2

TABLES

materialdescription = makt1

extensionin = rex

extensioninx = rexx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

******End of Program *********************