10-26-2015 8:09 AM
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.
10-26-2015 8:40 AM
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
10-26-2015 8:21 AM
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
10-26-2015 8:40 AM
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
10-26-2015 8:53 AM
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
10-26-2015 9:07 AM
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
10-26-2015 9:28 AM
Hi Raymond,
Thank you for your reply.
Please advise how to avoid the extra space infront of email field.
Thanks & Regads,
anu
10-26-2015 12:03 PM
Hi Anu,
Try,
SHIFT <material>(Fieldname) LEFT DELETING LEADING space.
Hope it helpful,
Regards,
Venkat.
02-19-2016 8:39 AM
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.