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: 
Read only

Unicode issue: strucutre contains junk characters '#'

rthoodi
Active Participant
0 Likes
1,303

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

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

3 REPLIES 3
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
977

Debug and check it. You can find which field offset causes the dump inside LOOP AT extensionin. CI_PRPS should be having a integer field ,when # moved to it it causes dump.

Read only

0 Likes
977

HI Keshav,

Thanks for you replay.

When I debugged it, export structure wa_bapi_te_prps contains numerous fields with junk characters "#", and short dump is due to this junk characters. this junk data coming from method cl_abap_container_utilities=>read_container_c. so before we pass data to EXTENSIONIN that must be unicode compatible, please help in that.

select * from (dd08v_tab-checktable) " dd08v_tab-checktable = 'AUFK'

up to 1 rows into <result_workarea>

where (single_cond). "single_cond = 'AUFNR = ############'.

endselect.

Thanks

RK

Read only

0 Likes
977

I have solved myself, this issue is because of the lengthy structure, BAPI extension will work up to 960 chars, after that it assigns junk characters for each field maintained in structure.

Thanks

RK