2008 Jun 09 1:52 PM
Hi all,
I am working on WIP Aging Report and for this, i need to extract the data from the AUFK and COSB tables. I was told to get all the AUFNR values from AUFK table and then the values of AUFK-AUFNR will match with COSB-OBJNR values excluding the first two letters. Is there any other way to implement this requirement as extracting data without 'where' clause in from AUAK or COSB tables results with huge amount of data.
Regards,
2008 Jul 04 3:40 PM
Hi,
you can fetch the OBJNR directly from AUFK and use it for the select on COSB.
Regards
Uwe
2008 Jul 04 3:06 PM
Hiya
Try something like this, you may need to amend for your purpose but the principle may work for you. If you don't already know, never do FOR ALL ENTRIES with an empty itab...
Regards,
KM
TYPES: BEGIN OF T_AUFK,
AUFNR LIKE AUFK-AUFNR,
OBJNR LIKE COSB-OBJNR,
END OF T_AUFK.
DATA: IT_AUFK TYPE STANDARD TABLE OF T_AUFK,
IT_COSB TYPE STANDARD TABLE OF COSB.
FIELD-SYMBOLS: <AUFK> LIKE LINE OF IT_AUFK.
{ ..... }
* Get your order numbers
SELECT AUFNR INTO TABLE IT_AUFK
FROM AUFK
WHERE etc etc
IF NOT IT_AUFK IS INITIAL.
* Take 2 chars off AUFNR to give OBJNR
LOOP AT IT_AUFK ASSIGNING <AUFK>.
<AUFK>-OBJNR = <AUFK>-AUFNR.
SHIFT <AUFK>-OBJNR BY 2 PLACES.
ENDLOOP.
* Use OBJNR in the internal table to select from COSB
SORT IT_AUFK BY OBJNR.
SELECT * INTO TABLE IT_COSB
FROM COSB
FOR ALL ENTRIES IN IT_AUFK
WHERE OBJNR = IT_AUFK-OBJNR.
ENDIF.
2008 Jul 04 3:40 PM
Hi,
you can fetch the OBJNR directly from AUFK and use it for the select on COSB.
Regards
Uwe