Skip to Content
0
Dec 09, 2011 at 04:38 AM

Unicode issue: strucutre contains junk characters '#'

326 Views

HI All,

I am working on BAPI_BUS2054_CREATE_MULTI, There are more than 100 fields in BAPI extension structure BAPI_TE_WBS_ELEMENT, when I passed this extension structure, SAP reads this structure using CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C, but export value contains junk characters '#', this leads to short dump, Iam facing this issue since 1 day , i used the following code, please help.me

CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'

EXPORTING

i_project_definition = ws_proj-pspid "Project Definition

TABLES

it_wbs_element = lt_wbs_element "WBS elements

et_return = lt_return "Return table

extensionin = lt_extensionin. "Customer fields

  • Fill BAPI extension table

CALL METHOD cl_abap_container_utilities=>fill_container_c

EXPORTING

im_value = lwa_bapi_wbs

IMPORTING

ex_container = ld_container

EXCEPTIONS

OTHERS = 0.

lwa_ext_in+30 = ld_container.

lwa_ext_in-structure = 'BAPI_TE_WBS_ELEMENT'.

APPEND lwa_ext_in TO ft_extensionin.

CLEAR:lwa_bapi_wbs,lwa_values,lwa_ext_in.

ENDIF.

Standard program code:

  • move extension with standard customer include CI_PRPS to prps_new

LOOP AT extensionin WHERE structure = 'BAPI_TE_WBS_ELEMENT'

AND valuepart1(24) = bapi_prps_new-wbs_element.

  • move extension into structure containing components of CI_PRPS

call method cl_abap_container_utilities=>read_container_c

EXPORTING

IM_CONTAINER = extensionin+30

IMPORTING

EX_VALUE = wa_bapi_te_prps

EXCEPTIONS

ILLEGAL_PARAMETER_TYPE = 1

others = 2.

  • MOVE extensionin+30 TO wa_bapi_te_prps. "#EC ENHOK

  • move into corresponding fields of PRPS

CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.

MOVE-CORRESPONDING wa_bapi_te_prps TO prps_new. "#EC ENHOK

ENDCATCH.

ENDLOOP.

Thanks

RK