2022 Oct 18 4:44 PM
Hi Experts,
I'm new in abap world.
i have two questions.
I'm trying to write a program that updates the inforecord from last purchase order, and i use batch input with call transaction.
I search and insert in an internal table all the elements that i need, like purchase order net price (ekpo-netpr), PRICE UNIT(ekpo-peinh) and order price unit(ekpo-bprme).
When i append value from work area to bdc table the value changes.
ls_bdcdata-fnam = 'KONP-KMEIN(01)'.
ls_bdcdata-fval = ls01wa-bprmeoda.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR ls_bdcdata.
In debug i see that the Fval field has a lot of space before value that i have in work area.
Is the problem that the bdc table field type is C(132)? How can i fix it?
This error occurs.
Message no. 00348
the second question is about the price unit.
In internal table i have unconverted value (ST) but for the batch input i require converted value (PC).
Is there any way to solve this problem?
thanks for help
2022 Oct 18 5:12 PM
2022 Oct 19 5:20 PM
BDCDATA expects some output format, so convert numeric values to text, also left adjust the data.
WRITE amount_fied CURRENCY currency_code_field TO bdcdata-fval LEFT-JUSTIFIED.
WRITE quantity_field UNIT unit_field TO bdcdata-fval LEFT-JUSTIFIED.
2022 Oct 18 5:12 PM
2022 Oct 20 8:30 AM
If ls01wa-bprmeoda is a variable of type numeric then condense cannot be used (only characters). In that case, you should precise that information (ls01wa-bprmeoda is of type numeric) to other people and you should not mark this answer as "best answer", so that to help future visitors.
2022 Oct 19 5:20 PM
BDCDATA expects some output format, so convert numeric values to text, also left adjust the data.
WRITE amount_fied CURRENCY currency_code_field TO bdcdata-fval LEFT-JUSTIFIED.
WRITE quantity_field UNIT unit_field TO bdcdata-fval LEFT-JUSTIFIED.
2022 Oct 20 7:06 AM
2022 Oct 20 7:09 AM
For the second question i use
Call function 'CONVERSION_EXIT_CUNIT_OUTPUT' to convert "CUNI" value.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
input = ls01wa-bprmeoda
language = sy-langu
IMPORTING
output = ls01wa-bprmeoda.