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

Extra space is inserted in custom field in the table using BAPI_PR_CREATE.

former_member569532
Participant
0 Likes
2,145

Hi Experts,

I need to update the custom fields in PR screen using BAPI.

After updating there is extra space in front of the data of each field in eban table

ls_ext_in-valuepart1 = ls_m_value+0(67).

ls_ext_in-structure = 'BAPI_TE_MEREQITEM'.

ls_ext_in-valuepart2 ls_m_value+67(240).

Kindly anyone advise how to avoid this space in front of the custom field.

Thanks & Regards,

Anusha.



1 ACCEPTED SOLUTION
Read only

former_member186660
Participant
0 Likes
1,901

Good day Anu,

Looks like your position is not properly defined on ls_ext_in-valuepart2+67(240)

I believe it should have bee defined like this ls_ext_in-valuepart2+0(64).

Start from position 0 put 67 characters.

The one you defined read start from position 67 put 240 characters.

hope it helps.

Regards,

Tumelo Modise

So you added 240-67 space characters in the structure, on old versions try some:


ls_ext_in-structure = 'BAPI_TE_MEREQITEM'.

ls_ext_in-valuepart1 = ls_m_value+0(240).

ls_ext_in-valuepart2 = ls_m_value+240(240).

SAP will concatenate the valuepart to rebuild the extension structure (using same class reverse method in Unicode)

Regards,

Raymond

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,901

I suppose ls_m_value is of TYPE BAPI_TE_MEREQITEM and ls_ext_in of TYPE BAPIPAREX, so try some :


ls_ext_in-structure = 'BAPI_TE_MEREQITEM'.

cl_abap_container_utilities=>fill_container_c(

  EXPORTING

    im_value              = ls_m_value

  IMPORTING

    ex_container          = ls_ext_in+30.

Question: why do you split at position 67, when VALUEPARTn fields length is 240, in pre-unicode old versions you could split by block of 240.


Regards,

Raymond

Read only

former_member186660
Participant
0 Likes
1,902

Good day Anu,

Looks like your position is not properly defined on ls_ext_in-valuepart2+67(240)

I believe it should have bee defined like this ls_ext_in-valuepart2+0(64).

Start from position 0 put 67 characters.

The one you defined read start from position 67 put 240 characters.

hope it helps.

Regards,

Tumelo Modise

Read only

0 Likes
1,901

Hi Raymond,

Thank your for your reply.

There are other custom fields of length 67 infront  of the email field.That is reason I offset the email field from 67.

Regards,

Anusha

Read only

0 Likes
1,901

So you added 240-67 space characters in the structure, on old versions try some:


ls_ext_in-structure = 'BAPI_TE_MEREQITEM'.

ls_ext_in-valuepart1 = ls_m_value+0(240).

ls_ext_in-valuepart2 = ls_m_value+240(240).

SAP will concatenate the valuepart to rebuild the extension structure (using same class reverse method in Unicode)

Regards,

Raymond

Read only

0 Likes
1,901

Hi Raymond,

Thank you for your reply.

Please advise how to avoid the extra space infront of email field.

Thanks & Regads,

anu

Read only

0 Likes
1,901

Hi Anu,

Try,

SHIFT <material>(Fieldname) LEFT DELETING LEADING space.



Hope it helpful,


Regards,

Venkat.

Read only

0 Likes
1,901

I can able to solve the problem by passing the data as below.

ls_ext_in-structure = 'BAPI_TE_MEREQITEM'.

ls_ext_in+30 = ls_m_value.