Application Development 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: 

BDC CALL TRANSACTION FIELD TYPE

stefano94
Explorer
0 Kudos

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.

Field KONP-KPEIN(1) (input value is longer than the dynpro field)

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

2 ACCEPTED SOLUTIONS

thkolz
Contributor
0 Kudos

Try

ls_bdcdata-fval = condense( ls01wa-bprmeoda ).

raymond_giuseppi
Active Contributor
0 Kudos

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.
5 REPLIES 5

thkolz
Contributor
0 Kudos

Try

ls_bdcdata-fval = condense( ls01wa-bprmeoda ).

Sandra_Rossi
Active Contributor
0 Kudos
stefano94

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.

raymond_giuseppi
Active Contributor
0 Kudos

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.

0 Kudos

This solution works, thank you!

stefano94
Explorer
0 Kudos

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.