2011 Dec 09 4:38 AM
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
2011 Dec 09 5:33 AM
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.
2011 Dec 09 5:51 AM
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
2011 Dec 12 1:07 PM
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