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 extension problem

Former Member
0 Likes
2,023

hi experts,

i need to update material master using BAPI BAPI_MATERIAL_SAVEDATA..i need to populate custom fields also.so i am using bapi extesnions. i have added my custom fields to MARA through append structure. but now i want to add my fields into bapi_te_mara. but it was asking access key.

how to add fields to bapi textension.

please give me some ideas

Thanks

Sai

7 REPLIES 7
Read only

Former Member
0 Likes
1,281

Create an APPEND STRUCTURE inside bapi_te_mara.

Read only

former_member156446
Active Contributor
Read only

tarangini_katta
Active Contributor
0 Likes
1,281

Hi,

y can't use EXIT_SAPLMGMU_001.

For creating the custom fields add populating the custom fields.

Thanks,

Read only

Former Member
0 Likes
1,281

you need to append structure in bapi_te_mara & bapi_te_marax .

field names should be same in all three structures.

also need to make entry in T130F table.

Read only

Former Member
0 Likes
1,281

hi vivek,

can u please explain me what entry i need to maintain in table t130f.

Thanks

sai

Read only

Former Member
0 Likes
1,281

hi,

use BAPI_MATERIAL_SAVEDATA in to modify , First of all I add new fields to structure BAPI_TE_MARA (append ZABAPI_TE_MARA) as char fields.

then addthese fields to structure BAPI_TE_MARA (append ZABAPI_TE_MARAX) as char(1). And activated both appends.

..

DATA: head_data LIKE bapimathead,

return LIKE bapiret2,

extensionin LIKE bapiparex OCCURS 0 WITH HEADER LINE,

extensioninx LIKE bapiparexx OCCURS 0 WITH HEADER LINE.

(....)

headdata-material = wa_p-matnr.

headdata-basic_view = 'X'.

extensionin-structure = 'BAPI_TE_MARA'.

extensionin-valuepart1+0(18) = wa_p-matnr. "field u want to add.

extensioninx-structure = 'BAPI_TE_MARAX'.

extensioninx-valuepart1+0(18) = wa_p-matnr.

extensioninx-valuepart1+29(1) = 'X'.

APPEND extensionin.

APPEND extensioninx.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

head_data = head_data

IMPORTING

return = return

TABLES

extensionin = extensionin

extensioninx = extensioninx.

are you using this function after calling BAPI use

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

IMPORTING

return = return.

also check this link

thanks

Read only

Former Member
0 Likes
1,281

sf