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: 

Problem with transfer data to valueparts (Bapi Extension)

former_member215739
Participant
0 Kudos
3,028

Dear Expert,

I'm trying to move data from a structure of Z-Fields into the 4 valueparts using the the method cl_abap_container_utilities=>fill_container_c

However, my decimal numbers are all turned into #####, for example: 12.00 is turned into ####.

Could you please help me to solve this problem. Thank you very much.

This is my code:

****My structure with Z-Fields Data is gs_bapi_te_mepoitem

DATA ls_ext_temp(960) TYPE c.

gs_extensionin-structure = 'BAPI_TE_MEPOITEM'.


CALL METHOD cl_abap_container_utilities=>fill_container_c

  EXPORTING
    im_value     = gs_bapi_te_mepoitem

  IMPORTING
    ex_container = ls_ext_temp

  EXCEPTIONS
    OTHERS       = 0.

****Transfer data from ls_ext_temp to valueparts

DO 4 TIMES.

  gs_extensionin-valuepart1 = ls_ext_temp(240).

  gs_extensionin-valuepart2 = ls_ext_temp+240(240).

  gs_extensionin-valuepart3 = ls_ext_temp+480(240).

  gs_extensionin-valuepart4 = ls_ext_temp+720(240).


ENDDO.

APPEND gs_extensionin TO gt_extensionin.

The last valuepart4 is full of #######.

And in other valueparts, all decimal number are turned into ####.

Please help me to solve this problem.

Thank you very much.

Best regards,

Thanh

1 REPLY 1

PeterJonker
Active Contributor
0 Kudos
683

The SAP HELP documentation states:

•Customers can use only fields of data type CHAR and similar data types in BAPI table extensions

I guess you need to do some translations before you add the field to the extension and when you read the extension in the bapi user exit. First you will need to change the datatype of this field in the append structure and then add coding to translate your decimal number to a character field (e.g. multiply times 100 to get rid of the decimal separator, or write to a char field, or....)

http://help.sap.com/saphelp_46c/helpdata/en/c3/40999d8b8911d396b70004ac96334b/content.htm