2016 Jan 28 1:13 PM
Hi Gurus,
I have a requeriment to update value of field ANLN1, while creating a PR, now the right values comes from a dataset and some parameters in a "Z" table. So far i have done all of the above and i got the right value to send in that field.
I am using method PROCESS_ITEM to recover the data and using instruction set_data to update it, but so far the vaule is not getting updated when the PR is created.
Please a i really need a help or an example to realize this action. In method ->SET_DATAX this field is not avaliable or at least i dont see in the structure "MEREQ_ITEMX".
Thanks in advice.
METHOD if_ex_me_process_req_cust~process_item.
DATA: l_preq TYPE mereq_item.
DATA: p_class TYPE setclass,
gv_index TYPE i,
gv_setdatos TYPE setnamenew,
gv_setline TYPE setline,
gv_valfrom TYPE setvalmin,
gv_posno TYPE bnfpo,
gv_bsart TYPE bbsrt,
gv_banfn TYPE banfn,
gv_knttp TYPE knttp,
wa_zmmsrmdummy TYPE zmm_srmdummy.
**********************************************************************
CALL METHOD im_item->get_data
RECEIVING
re_data = l_preq.
IF l_preq-zzanlkl1 IS INITIAL.
ENDIF.
CLEAR: gv_setdatos ,wa_zmmsrmdummy, gv_setline, gv_valfrom, gv_index.
CLEAR: gv_posno, gv_bsart, gv_banfn, gv_knttp.
"DOY VALOR A CAMPOS CLAVES DE BUSQUEDA
p_class = '0000'.
"gv_banfn = l_preq-banfn.
gv_posno = l_preq-bnfpo.
gv_bsart = l_preq-bsart.
gv_knttp = l_preq-knttp.
"UBICAR CONDICIONES ESPECIFICAS
SELECT SINGLE * FROM zmm_srmdummy INTO wa_zmmsrmdummy
WHERE bsart EQ gv_bsart
AND knttp EQ gv_knttp.
IF sy-subrc EQ 0.
gv_setdatos = wa_zmmsrmdummy-setname.
SELECT SINGLE lineid FROM rwsline INTO gv_setline
WHERE xsuppress EQ 'X'
AND setname EQ gv_setdatos
AND setclass EQ p_class.
IF sy-subrc EQ 0.
SELECT SINGLE valfrom FROM setleaf INTO gv_valfrom
WHERE setclass EQ p_class
AND setname EQ gv_setdatos
AND lineid EQ gv_setline.
IF sy-subrc EQ 0.
l_preq-anln1 = gv_valfrom.
CALL METHOD im_item->set_data
EXPORTING
im_data = l_preq.
ELSE.
MESSAGE i013(zmmaf) WITH gv_setdatos.
MESSAGE e012(zmmaf) WITH l_preq-knttp l_preq-bsart.
ENDIF.
ELSE.
"ERROR EL SET DE DATOS NO TIENE LA MARCA EN SUPRIMIR
MESSAGE e011(zmmaf) WITH gv_setdatos.
ENDIF.
ENDIF.
CLEAR: gv_setline, gv_valfrom, gv_setdatos, wa_zmmsrmdummy, gv_index.
CLEAR: gv_posno, gv_bsart, gv_banfn, gv_knttp.
2016 Jan 28 2:18 PM
Loop at the result of a call of im_item->IF_ACCT_CONTAINER_MM~GET_ITEMS( ) to execute GET/SET_EXKN(X) methods.
Hint: Also don't use statement MESSAGE but macro MMPUR_MESSAGE_FORCED (include MM_MESSAGES_MAC).
Regards,
Raymond