Application Development and Automation 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: 
Read only

Selection from a DFKKOP

Former Member
0 Likes
3,842

If customer account is no longer a PV account, need to not select it this table.

SELECT gpart vkont
FROM DFKKOP
INTO CORRESPONDING FIELDS OF TABLE int_pv
WHERE hkont = '0000121030'.

I have a program that is selecting the accounts that were Photovoltaic (PV) but are not longer. How can I let it not select if the account is no longer a PV account?

If customer account is no longer a PV account, need to not select it this table.

SELECT gpart vkont
FROM DFKKOP
INTO CORRESPONDING FIELDS OF TABLE int_pv
WHERE hkont = '0000121030'.

I have a program that is selecting the accounts that were Photovoltaic (PV) but are not longer. How can I let it not select if the account is no longer a PV account?

12 REPLIES 12
Read only

paul_bakker2
Active Contributor
0 Likes
3,709

Hi,

  You need to restrict the selection to those accounts that are not "PV". If this attribute field cannot be found in DFKKOP, it can probably be found via an inner join to table FKKVK.

I'm guessing you can tell if an account is PV by their VKTYP value (Contract Account category)?

cheers

Paul

Read only

0 Likes
3,709

That I understand but how can the program be written to be not selecting the account if it was PV and is no longer PV? IF statement?

Read only

0 Likes
3,709

Change documents?

Rob

Read only

0 Likes
3,709

These are existing accounts and there is a report that is submitted but it keeps selecting the accounts that were PV but are no longer PV by this it's still pulling the amounts from the account into the aging report. I need to configure the program to not select the accounts that were PV but I am lost of how to complete this.

Read only

0 Likes
3,709

So, how do you identify PV accounts vs non-PV accounts?

Rob

Read only

0 Likes
3,709

The accounts are identified from DFKKOP-GSBER "Business Area" The Solar accounts are "400" and they use to be under Solar but are no longer but the program is still selecting the old accounts. Thanks.

Read only

0 Likes
3,709

OK - what exactly do you mean by "accounts"? Is it the contract account item? If so, how is the business area changed?

Or is it the GL account?

Something else?

Rob

Read only

0 Likes
3,709

I believe it is changed on the G/L account.

Read only

0 Likes
3,709

I figured it out.

SELECT gpart vkont

        FROM DFKKOP

             INTO CORRESPONDING FIELDS OF TABLE int_pv

        WHERE   hkont  = '0000121030'

          AND   vkont  in s_vkont

          AND   AUGST EQ space.

Read only

0 Likes
3,709

Hi,

All that extra line does, is restrict the selection to open items. That has nothing to do with account type at all. You may want to reconsider.

And really, after al those people tried to help you, you didn't consider any of the replies above to be 'helpful' or "correct" (except your own?)

cheers

Paul

Read only

0 Likes
3,709

I'm with Paul on this. I don't see how the change to your SELECT will help.

Additionally, the business area is just a default on the GL. It can be changed by the user at data entry time.

Rob

Read only

0 Likes
3,709

The accounts use to be with PV but they are not longer under PV and the aging report is still picking up the amounts from the closed PV account. I ran a debug on the program and found that the account is RES and then move the account back to PV.

FORM UPDATE_PORTION_MRU_CLASS.

                    int_output-portion    = int_eanlh-portion.

                    int_output-termschl   = int_eanlh-ableinh.

                    CASE int_eanlh-aklasse.

                      WHEN 'COM'.

                         int_output-z_acctclass  = 'COMM'.

                      WHEN 'IND'.

                        int_output-z_acctclass   = 'IND'.

                      WHEN 'RES'.

                        int_output-z_acctclass   = 'RES'.

                     ENDCASE.

                   READ table int_pv   with key vkont = int_dfkkop-vkont.

                      IF sy-subrc = '0'.

                         int_output-z_acctclass  = 'PHTV'.

                      ENDIF.

ENDFORM.                   " UPDATE_PORTION_MRU_CLASS