‎2008 Dec 11 10:09 AM
Hi all
My problem is the following:
I call the bapi BAPI_CONTRACT_CHANGE with some extensions (zfields) in the table EKKO. One of those Zfields is an amount.
*/ Extension
ls_extensionin-structure = 'BAPI_TE_MEOUTHEADER'.
ls_bapi_te_meoutheader-zcontratcadre = ls_party-internal_id-content.
ls_bapi_te_meoutheader-zlotnr = ls_party-receiving_site-internal_id-content.
ls_bapi_te_meoutheader-number = ls_pur_contr-id-content.
ls_bapi_te_meoutheader-zamount = ls_pur_contr-open_target_amount-content.
*/ TCH - Start
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = ls_bapi_te_meoutheader
IMPORTING
ex_container = lv_container
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
ls_extensionin+30 = lv_container.
APPEND ls_extensionin TO lt_extensionin.
but when I check in debugger the value of the amount, I get this: ##倀ఀ
The reason why I use this method, is to convert the structure into a string, so I can fill my extension.
Does anyone have an idea how to convert this amount into the valueparts of the extension?
Best regards
‎2008 Dec 11 10:15 AM
‎2008 Dec 11 10:23 AM
Flavya
I have problems filling the extensionin with in the valuepart an amount. If I convert this into a string of 960 characters, the amount is not converted or wrongly converted so passing this will dump later in the BADI.
‎2022 Jun 20 4:26 AM
Provide update below, even this is a very old post but I can see many people asking for similar questions.
The trick is, shift the lv_container by 30 char, which is the length of the structure. Same trick for reading the extension using cl_abap_container_utilities=>read_container_c
*/ Extension
ls_extensionin-structure = 'BAPI_TE_MEOUTHEADER'.
ls_bapi_te_meoutheader-zcontratcadre = ls_party-internal_id-content.
ls_bapi_te_meoutheader-zlotnr = ls_party-receiving_site-internal_id-content.
ls_bapi_te_meoutheader-number = ls_pur_contr-id-content.
ls_bapi_te_meoutheader-zamount = ls_pur_contr-open_target_amount-content.
*/ TCH - Start
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = ls_bapi_te_meoutheader
IMPORTING
ex_container = lv_container+30
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
ls_extensionin+30 = lv_container.
APPEND ls_extensionin TO lt_extensionin.
‎2023 Jul 06 10:18 AM
Hi @Kevin,
How do you know that the lv_container is 30 characters in length?
‎2023 Jul 06 10:13 AM
Hi Kristof,
Please can you list how you defined your data types lv_container and ls_extensionin?
I have a similar problem with a different BAPI.
Thanks
Joe
‎2023 Jul 07 1:47 AM
Hi oppenheim.jm ,
The variable lv_container is type of BAPIPAREX.
DATA: lv_container TYPE BAPIPAREX.The first 30 characters is for the field STRUCTURE. So we're filling our data after 30-char.

‎2023 Jul 07 7:24 AM
Thanks kevin-chang. Exactly what I was looking for! Appreciate the feedback!