‎2007 Jul 26 9:52 PM
Hi,
I have to update the table gt_zprice with created CreditMemo. I tried the following two ways, but nothing is working. Please guide me if I am doing something wrong here.
Thanks,
Neelu.
READ TABLE gt_zprice INTO gs_zprice.
IF sy-subrc EQ 0.
gs_zprice-crmemo = salesdocument.
MODIFY TABLE gt_zprice FROM gs_zprice
TRANSPORTING crmemo.
ENDIF.
READ TABLE gt_zprice INTO gs_zprice.
IF sy-subrc EQ 0.
gs_zprice-crmemo = salesdocument.
MODIFY TABLE gt_zprice FROM gs_zprice
TRANSPORTING mandt vkorg vtweg spart kunnr matnr crdate efdate
sprice eprice eohqty aohqty auart bstkd werks augru
xblnr crmemo.
ENDIF.
‎2007 Jul 27 12:04 AM
Hi,
Try this..
.................
DATA: v_tabix TYPE sytabix.
LOOP AT gt3_zprice INTO ls_zprice.
READ TABLE gt_zprice INTO gs_zprice INDEX ls_zprice-index.
IF sy-subrc EQ 0.
v_tabix = sy-tabix.
gs_zprice-crmemo = salesdocument.
MODIFY gt_zprice FROM gs_zprice INDEX v_tabix TRANSPORTING crmemo.
Thanks
Naren
‎2007 Jul 26 9:55 PM
check this
READ TABLE gt_zprice INTO gs_zprice.
IF sy-subrc EQ 0.
gs_zprice-crmemo = salesdocument.
<b>MODIFY gt_zprice FROM gs_zprice
TRANSPORTING crmemo index sy-tabix.</b>
ENDIF.
Mahesh
Message was edited by:
I Can Solve It
‎2007 Jul 26 9:56 PM
Try this way.
<b>DATA: v_index TYPE i.</b>
READ TABLE gt_zprice INTO gs_zprice.
IF sy-subrc EQ 0.
<b>v_index = sy-tabix.</b>
gs_zprice-crmemo = salesdocument.
MODIFY TABLE gt_zprice FROM gs_zprice
TRANSPORTING crmemo <b>INDEX v_index.</b>
ENDIF.
‎2007 Jul 26 9:56 PM
Hi,
While reading gt_zprice wht will be key?
READ TABLE gt_zprice INTO gs_zprice with key <<< you need to mention>>.
IF sy-subrc EQ 0.
gs_zprice-crmemo = salesdocument.
MODIFY TABLE gt_zprice FROM gs_zprice
TRANSPORTING crmemo index sy-tabix.
ENDIF.
aRs
Message was edited by:
a®
‎2007 Jul 26 9:58 PM
sorry small change
READ TABLE gt_zprice INTO gs_zprice.
IF sy-subrc EQ 0.
gs_zprice-crmemo = salesdocument.
<b>MODIFY gt_zprice FROM gs_zprice index sy-tabix
TRANSPORTING crmemo .</b>
ENDIF.
‎2007 Jul 26 10:50 PM
Hi,
I tried all the ways but I am getting error saying 'No Component exists with name INDEX.' Please correct me if I am doing something wrong.
FORM update_pricetable.
DATA: ls_zprice TYPE ty_zprice.
LOOP AT gt3_zprice INTO ls_zprice.
READ TABLE gt_zprice INTO gs_zprice INDEX ls_zprice-index.
IF sy-subrc EQ 0.
gs_zprice-crmemo = salesdocument.
MODIFY TABLE gt_zprice FROM gs_zprice
transporting crmemo.
ENDIF.
ENDLOOP.
REFRESH:gt3_zprice.
ENDFORM. " update_pricetable
gt3_zprice contains few records of the table where CRMEMO has to be placed.
TYPES: BEGIN OF ty_zprice,
mandt TYPE mandt,
vkorg TYPE vkorg,
vtweg TYPE vtweg,
spart TYPE spart,
kunnr TYPE kunnr,
matnr TYPE matnr,
crdate TYPE zcrdate,
efdate TYPE zefdate,
sprice TYPE zprice3,
eprice TYPE zprice4,
eohqty TYPE zquantity1,
aohqty TYPE zquantity2,
auart TYPE auart,
bstkd TYPE bstkd,
werks TYPE werks_d,
augru TYPE augru,
xblnr TYPE xblnr,
crmemo TYPE vbeln,
index TYPE sy-index,
END OF ty_zprice.
Thanks,
Neelu.
‎2007 Jul 27 12:04 AM
Hi,
Try this..
.................
DATA: v_tabix TYPE sytabix.
LOOP AT gt3_zprice INTO ls_zprice.
READ TABLE gt_zprice INTO gs_zprice INDEX ls_zprice-index.
IF sy-subrc EQ 0.
v_tabix = sy-tabix.
gs_zprice-crmemo = salesdocument.
MODIFY gt_zprice FROM gs_zprice INDEX v_tabix TRANSPORTING crmemo.
Thanks
Naren
‎2007 Jul 27 12:22 AM
Thank you Naren. It is displaying the CreditMemo number now.
I really appriciate your help.
Regards,
Neelu.