2007 Nov 29 11:29 AM
Hello ABAPers,
I want to write ABAP report to list out Material,Customer,Tax type and Tax amount. The data is available in tables A005 and KONP and the joining condition would be A005-KNUMH and KONP-KNUMH.
But since A005 s a Pooled table am not able to write a correct join condition.
Can any one guide me on how we can write this join condition?
I tried with FOR ALL ENTRIES IN TABLE but the output was not reading the value of Amount(KONP-KBETR).The amount is coming as zero always.
The code i'm using is:
-
SELECT MATNR KUNNR VKORG VTWEG KSCHL KNUMH INTO TABLE ITAB_JEXP FROM A005 WHERE KSCHL = 'JEXP'.
IF NOT ITAB_JEXP IS INITIAL.
SELECT KNUMH KOPOS KSCHL KBETR INTO TABLE ITAB FROM KONP FOR ALL ENTRIES IN ITAB_JEXP
WHERE KNUMH = ITAB_JEXP-KNUMH AND KSCHL = ITAB_JEXP-KSCHL.
APPEND ITAB.
ENDIF.
LOOP AT ITAB_JEXP.
MOVE-CORRESPONDING ITAB_JEXP TO ITAB.
APPEND ITAB.
ENDLOOP.
Thanks,
B P Shah
Message was edited by:
Bhavin P Shah
2007 Nov 29 11:33 AM
Hi,
Use FOR ALL ENTRIES for that joins are not allowed on cluster n pooled tables
refere these
LOOP AT it_kjmseg INTO wa_kjmseg.
lv_index = sy-tabix.
*--Select condition record number from table A006
SELECT SINGLE
knumh
FROM a006
INTO lv_knumh
WHERE kappl EQ 'V'
AND kschl EQ 'ZR00'
AND vkorg EQ '0010'
AND vtweg EQ '00'
AND pltyp EQ '01'
AND waerk EQ 'USD'
AND matnr EQ wa_kjmseg-matnr
AND datbi GT wa_kjmseg-fkdat.
IF sy-subrc NE 0.
*--Select condition record number from table A004
SELECT SINGLE
knumh
FROM a004
INTO lv_knumh
WHERE kappl EQ 'V'
AND kschl EQ 'ZR00'
AND vkorg EQ '0010'
AND vtweg EQ '00'
AND matnr EQ wa_kjmseg-matnr
AND datbi GT wa_kjmseg-fkdat.
ENDIF.
Regards,
Prashant
2007 Dec 26 10:13 AM
Solved it with some changes in the way I approached this report.
-Bhavin P Shah