‎2006 Jan 09 11:39 AM
Hi,
I have calculate the date and display in the output.
SELECT MATNR
WEBAZ " no of days
FROM MARC
INTO TABLE I_MARC
FOR ALL ENTRIES IN I_FINAL1
WHERE MATNR = I_FINAL1-MATNR.
ENDIF.
LOOP AT I_FINAL1 INTO IS_FINAL1.
READ TABLE I_MARC INTO IS_MARC WITH KEY
MATNR = IS_FINAL1-MATNR BINARY SEARCH.
IF SY-SUBRC EQ 0.
I have to substract the field WEBAZ from i_final1-date and display that as output.
Can any one pls tell how to write the logic for that after the above code. or is there any other way.
‎2006 Jan 09 11:42 AM
Hi,
As long as you have I_FInal1-DATE defined as type DATS, you can directly do a subtraction and this will give u a value in date.
i_final1-date = i_final1-date - webaz.
‎2006 Jan 09 11:44 AM
Hi Hema,
try this
LOOP AT I_FINAL1 INTO IS_FINAL1.
lv_tabix = sy-tabix.
READ TABLE I_MARC INTO IS_MARC WITH KEY
MATNR = IS_FINAL1-MATNR BINARY SEARCH.
IF SY-SUBRC EQ 0.
is_final1-new_date = is_final1-date - is_marc-webaz.
modify i_final1 from is_final1 index lv_tabix.
endif.
endloop.
‎2006 Jan 09 11:46 AM
check this :
parameters: p_days like marc-webaz,
p_date like sy-datum.
start-of-selection.
p_date = p_date - p_days.
write 😕 p_date.
‎2006 Jan 09 11:47 AM
Subtract the no of days from i_final-date like follows
i_result = i_finla-date - webaz.
hope it works.
Please award oints if it helps for you
thanks
Suresh
‎2006 Jan 09 11:58 AM
Hi hema,
1. its simple
2.
LOOP AT I_FINAL1 INTO IS_FINAL1.
READ TABLE I_MARC INTO IS_MARC WITH KEY MATNR = IS_FINAL1-MATNR BINARY SEARCH.
IF SY-SUBRC EQ 0.
*----
DATA : DIFF TYPE I.
DIFF = I_MARC - I_FINAL1-DATE.
WRITE DIFF.
ENDIF.
*----
ENDLOOP
regards,
amit m.