Skip to Content
0
Jun 13, 2016 at 03:38 PM

BAPI_MATERIAL_SAVEDATA extensionin DEC type dump

1440 Views

Hi experts,

Under the SAP ERP 6.0 EHP7, we have this requirement added the 2 field( Dec type 9 length 2 point) in BAPI_TE_MVKE:

used the FM: BAPI_MATERIAL_SAVEDATA will have a dump, I guess it have the issue it is the type convert . because standard extension cant input the dec type , just input only char type.


and use the CALL METHOD cl_abap_container_utilities=>fill_container_c to convert the dec type. (the mothod can convert the QUAN type, it is okay work for BApi BAPI_SALESORDER_CREATEFROMDAT2 );

already config the 2 field in SPRO, checked the T130F.

But I got the dump when I run the code as below:


Could you give me the any idea? Thank you very much!




*------------------------------------------------------------------------------

SALES_ORG type VKORG CHAR 4 0

DISTR_CHAN type VTWEG CHAR 2 0

.APPEND type ZSMVKE_BAPI 0 0

ZZXJE type ZEZZXJE DEC 9 2

ZZXJESF type ZEZZXJESF DEC 9 2

And my code:

*-----------------------------------------------------------------------------

DATA: s_te_mvke TYPE bapi_te_mvke.

DATA: s_te_mvkex TYPE bapi_te_mvkex.


DATA: t_extensionin TYPE TABLE OF bapiparex WITH HEADER LINE.
DATA: s_extensionin LIKE LINE OF t_extensionin.
DATA: t_extensioninx TYPE TABLE OF bapiparexx WITH HEADER LINE.
DATA: s_extensioninx LIKE LINE OF t_extensioninx.


CLEAR s_extensionin.
CLEAR s_te_mvke.

s_te_mvke-sales_org = ls_main-vkorg. "
s_te_mvke-distr_chan = ls_main-vtweg. "
s_te_mvke-zzxje = ls_main-zzxje. "enhancement field 1
s_te_mvke-zzxjesf = ls_main-zzxjesf. "enhancement field 2

s_extensionin-structure = 'BAPI_TE_MVKE'.



********

CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = s_te_mvke
IMPORTING
ex_container = s_extensionin-valuepart1
EXCEPTIONS
OTHERS = 0.

*********


APPEND s_extensionin TO t_extensionin.
CLEAR s_extensionin.
CLEAR s_extensioninx.
CLEAR s_te_mvkex.

s_te_mvkex-sales_org = ls_main-vkorg. "
s_te_mvkex-distr_chan = ls_main-vtweg. "
s_te_mvkex-zzxje = 'X'. "enhancement field 1
s_te_mvkex-zzxjesf = 'X'. "enhancement field 2
s_extensioninx-structure = 'BAPI_TE_MVKEX'.

s_extensioninx-valuepart1 = s_te_mvkex.

APPEND s_extensioninx TO t_extensioninx.
CLEAR s_extensioninx.


CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = headdata
clientdata = clientdata
clientdatax = clientdatax
plantdata = plantdata
plantdatax = plantdatax
forecastparameters = forecastparameters
forecastparametersx = forecastparametersx
planningdata = planningdata
planningdatax = planningdatax
storagelocationdata = storagelocationdata
storagelocationdatax = storagelocationdatax
valuationdata = valuationdata
valuationdatax = valuationdatax
warehousenumberdata = warehousenumberdata
warehousenumberdatax = warehousenumberdatax
salesdata = salesdata
salesdatax = salesdatax
storagetypedata = storagetypedata
storagetypedatax = storagetypedatax
flag_online = ' '
flag_cad_call = ' '
no_dequeue = ' '
no_rollback_work = ' '
IMPORTING
return = return
TABLES
materialdescription = materialdescription
unitsofmeasure = unitsofmeasure
unitsofmeasurex = unitsofmeasurex
* internationalartnos = internationalartnos
materiallongtext = materiallongtext
taxclassifications = taxclassifications
returnmessages = returnmessages
* prtdata = prtdata
* prtdatax = prtdatax
extensionin = t_extensionin
extensioninx = t_extensioninx.


IF return-type EQ 'S'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
APPEND return TO et_return.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

et_return[] = returnmessages[].
ENDIF.

Attachments

error2.JPG (110.8 kB)
st22.JPG (159.6 kB)