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: 

ZTable for data selection

rizaldy_hidayat
Explorer
0 Kudos

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,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Dear Habib,

How is your logic to query COEP related with your ztable ? Please give your coding.

Regards,

Yance

4 REPLIES 4

Former Member
0 Kudos

Dear Habib,

How is your logic to query COEP related with your ztable ? Please give your coding.

Regards,

Yance

0 Kudos

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.

0 Kudos

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

0 Kudos

Dear Yance,

Thanks for the valuable replies. My problem was solved.

Regards,

Habib