Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Report for Customer Condition Records

Former Member
0 Kudos

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

2 REPLIES 2

former_member386202
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Solved it with some changes in the way I approached this report.

-Bhavin P Shah