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

using bapi_te_mara

Former Member
0 Likes
2,662

Hello friends,

I have used the following code to to add 3 customised fields in my bapi_te_mara field to the standard bapi.

It is working only for the first field , other fields are just empty .

hope to get your valuable inputs to sort it out

I am giving the code which deals with the customising part alone

bapi_te_mara-yyfield1 = l_t_data-g_d_yyfield1.

bapi_te_marax-yyfield1 = 'X'.

bapi_te_mara-yyfield2 = l_t_data-g_d_yyfield2.

bapi_te_marax-yyfield2 = 'X'.

bapi_te_mara-yyfield3 = l_t_data-g_d_yyfield3.

bapi_te_marax-yyfield3 = 'X'.

g_t_bapiparex-structure = 'BAPI_TE_MARA'.

g_t_bapiparex-valuepart1+0(18) = l_t_data-g_d_matnr.

g_t_bapiparex-valuepart1+18(20) = l_t_data-g_d_yyfield1.

g_t_bapiparex-valuepart1+38(18) = l_t_data-g_d_yyfield2.

g_t_bapiparex-valuepart1+56(18) = l_t_data-g_d_yyfield3.

APPEND g_t_bapiparex.

g_t_bapiparexx-structure = 'BAPI_TE_MARAX'.

g_t_bapiparexx-valuepart1+0(18) = l_t_data-g_d_matnr.

g_t_bapiparexx-valuepart1+18(1) = 'X'.

g_t_bapiparexx-valuepart1+38(1) = 'X'.

g_t_bapiparexx-valuepart1+56(1) = 'X'.

APPEND g_t_bapiparexx.

extensionin = g_t_bapiparex

extensioninx = g_t_bapiparexx

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,377

Hi,

If you are filling the structure bapi_te_mara, is better than you asigned it to the extension-valuepart1 directly, in order to avoid problems with blanks.

g_t_bapiparex-structure = 'BAPI_TE_MARA'.
g_t_bapiparex-valuepart1 = bapi_te_mara.
append g_t_bapiparex.

g_t_bapiparexx-structure = 'BAPI_TE_MARAX'.
g_t_bapiparexx-valuepart1 = bapi_te_marax.
append g_t_bapiparexx.

If the first field is filled correctly, maybe the problem is taht the fields length is not correct.

Regards,

Pepe

1 REPLY 1
Read only

Former Member
0 Likes
1,378

Hi,

If you are filling the structure bapi_te_mara, is better than you asigned it to the extension-valuepart1 directly, in order to avoid problems with blanks.

g_t_bapiparex-structure = 'BAPI_TE_MARA'.
g_t_bapiparex-valuepart1 = bapi_te_mara.
append g_t_bapiparex.

g_t_bapiparexx-structure = 'BAPI_TE_MARAX'.
g_t_bapiparexx-valuepart1 = bapi_te_marax.
append g_t_bapiparexx.

If the first field is filled correctly, maybe the problem is taht the fields length is not correct.

Regards,

Pepe