2007 Jul 06 2:44 PM
Hi,
I have a requirement to display reservations along with open PO and consignment stock for materials.
As Per the requirement i am not able to fetch the exact requirements.
I am getting correct reservations for some and wrong for some materials when compared to MD04 Reservations.
I have used the below logic to fetch the reservations.
SELECT *
FROM resb
INTO CORRESPONDING FIELDS OF TABLE i_resb
FOR ALL ENTRIES IN i_mard
WHERE matnr EQ i_mard-matnr
AND werks EQ i_mard-werks
AND xloek EQ ' '
AND kzear EQ ' '.
LOOp At i_mard into mard.
READ TABLE i_resb INTO resb WITH KEY matnr = mard-matnr
werks = mard-werks.
IF sy-subrc EQ '0'.
LOOP AT i_resb FROM sy-tabix.
IF i_resb-matnr NE mard-matnr.
EXIT.
ENDIF.
zmmresv-bdmng = zmmresv-bdmng + ( i_resb-bdmng - i_resb-enmng ).
ENDLOOP.
ENDIF.
Clear mard.
ENDLOOP.
Can any one suggest me the exact logic to fetch the reservations.
Thanks in advance.
Message was edited by:
babulreddy kurapatti
2007 Jul 06 3:05 PM
Hi,
You can use this FM MD_STOCK_REQUIREMENTS_LIST_API to get the same information as transaction MD04.
Regards,
Ferry Lianto
2007 Jul 06 3:00 PM
The logic what you written is wrong.
first get the data from resb table
select * from resb into table resb
where condition.
if sy-subrc eq 0.
SELECT * INTO TABLE i_mard
FROM mard
FOR ALL ENTRIES IN i_resb
WHERE matnr = i_resb-matnr
other where condition.
endif.
loop at i_resb.
here you can use read table with mard and move to final internal table.
endloop.
Thanks
Seshu
2007 Jul 06 3:05 PM
Hi,
You can use this FM MD_STOCK_REQUIREMENTS_LIST_API to get the same information as transaction MD04.
Regards,
Ferry Lianto
2007 Jul 09 8:55 AM