07-18-2016 4:27 AM
Hi Abaper,
I created ztable to store GL Account for selection record in COEP table. So, in my program, firstly I get GL Account from ztable. Based on that GL, I query to COEP table. But, not all record are selected. When I hard code GL account directly in my program (not get from ztable) its normally, all record that relevant are selected. My ztable delivery class is Application table (master data and transaction data). anyone can help?
Thanks.
Habib,
07-18-2016 4:33 AM
Dear Habib,
How is your logic to query COEP related with your ztable ? Please give your coding.
Regards,
Yance
07-18-2016 4:33 AM
Dear Habib,
How is your logic to query COEP related with your ztable ? Please give your coding.
Regards,
Yance
07-18-2016 4:45 AM
Dear Yance,
Here the logic
select coep~wtgbtr
INTO CORRESPONDING FIELDS OF TABLE it_coep FROM coep
INNER JOIN csks ON csks~objnr = coep~objnr
INNER JOIN setleaf ON setleaf~valfrom = csks~kostl AND setleaf~setname = setname
FOR ALL ENTRIES IN it_gl
WHERE coep~perio = period AND coep~gjahr = tahun AND coep~wrttp ='04' AND coep~kstar = it_gl-hkont .
Thanks.
07-18-2016 7:08 AM
Dear Habib,
You need to add the additional information like the below logic :
select coep~kokrs
coep~belnr
coep~buzei
coep~perio
coep~gjahr
coep~kstar
coep~wtgbtr
INTO CORRESPONDING FIELDS OF TABLE it_coep
FROM coep
INNER JOIN csks ON csks~objnr = coep~objnr
INNER JOIN setleaf ON setleaf~valfrom = csks~kostl AND setleaf~setname = setname
FOR ALL ENTRIES IN it_gl
WHERE coep~perio = period
AND coep~gjahr = tahun
AND coep~wrttp ='04'
AND coep~kstar = it_gl-hkont .
If you query only the amount, then system will not include the same amount into the internal table.
Regards,
Yance
07-18-2016 7:43 AM
Dear Yance,
Thanks for the valuable replies. My problem was solved.
Regards,
Habib