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

Data from KONP.

Former Member
0 Likes
3,812

hallo everyone,

my requirement is to get MWSK1 from KONP table.

so i coded as below.

SELECT * FROM konp WHERE knumv = vbak-knumv and kposn = vbap-posnr.

  konp-mwsk1 = wa-mwsk1.

It is showing error:   Unknown column name "KNUMV" until runtime, you cannot specify a field  list.

if iremove the condition i am getting always the same tax code(MWSK1).

please suggest me the corrections.

Thanks & regards,

narsireddy.

19 REPLIES 19
Read only

naveenvishal
Contributor
0 Likes
2,998

Hi narsi,

- The table with pricing of items order is KONV,

- The link between VBAK and KONV is field KNUMV,

- The link between VBAP and KONV is field KPOSN

- The field KSCHL is the condition type.

SELECT SINGLE * FROM VBAK WHERE VBELN = ........

SELECT * FROM VBAP WHERE VBELN = VBAK-VBELN

SELECT * FROM KONV WHERE KNUMV = VBAK-KNUMV

                     AND KPOSN = VBAP-PSONR.

Use KONV instead of KONP.

Hope this helps.

Regards,

Naveen

Read only

0 Likes
2,998

Hi naveen,

now i have changed my code as.

SELECT * FROM konp INTO wa WHERE knumh = vbak-knumv and kopos = vbap-posnr.

       konp-mwsk1 = wa-mwsk1.         (i have attached konp to screen)

ENDSELECT.

....................................................................

SELECT * FROM konp WHERE knumh = vbak-knumv and kopos = vbap-posnr.

       konp-mwsk1 = konp-mwsk1.

ENDSELECT.

i tried both and now i am getting empty field. Can you help me with the condition part ?

thanks & regards,

NarsiReddy.

Read only

0 Likes
2,998

Hi Narsi Reddy,

     Can you please check below points:

1. If your VBAK or VBAP is initial or they have got values.

2. Are VBAK & VBAP work areas, How did you populate them?

3. Use SELECT SINGLE *

                    FROM konp

                    WHERE knumh = vbak-knumv

                         AND kopos = vbap-posnr.

As you are using KONP in your screen, if you get any value in KONP (work area), it will populate the screen fields automatically. Hope it will be helpful.


Regards,

Anubhab

Read only

0 Likes
2,998

hi naveen,

I tried with konv but getting empty field.

SELECT * FROM konv WHERE knumv = vbak-knumv and kposn = vbap-posnr.

       konv-mwsk1 = konv-mwsk1.       (i have attached konv-mwsk1 to screen.)

ENDSELECT.

thanks & regards,

narsireddy.

Read only

0 Likes
2,998

hi anubhab,

I wrote code as.

SELECT SINGLE * FROM konp WHERE knumh = vbak-knumv AND kopos = vbap-posnr.
  konp-mwsk1 = konp-mwsk1.

and also checked for vbap and vbak, they have values.

now i am getting empty field of konp-mwsk1.

Is there anything wrong in condiion part?

thanks & regards,

Narsireddy.

Read only

0 Likes
2,998

Hi Narsi,

Pl debug to see which condition is failing or where value is getting cleared ( you can use watchpoint on konp-mwsk1).

Hope this helps.

Regards,

Naveen

Read only

0 Likes
2,998

Hi Narsireddy,

     Did you check manually in SE16 for table KONV, if you have any record with knumh = vbak-knumv & kopos = vbap-posnr. Please let me know.


Note: KONV-KOPOS is of type NUMC of length 2 & VBAP-POSNR is of type NUMC of length 6. Are you sure about your condition checking?


Regards,

Anubhab

Read only

0 Likes
2,998

hi anubhab,

I am not sure about the condition part,

please tell me how to check for the correct condition.

thanks & regards,

NarsiReddy,

Read only

0 Likes
2,998

Hi Anubhab,

Thats why I said to use table KONV instead of KONP.

SELECT * FROM KONV WHERE KNUMV = VBAK-KNUMV

                     AND KPOSN = VBAP-PSONR.

Regards,

Naveen

Read only

0 Likes
2,998

Hi,

you could see this example code

LOOP AT TB_VBAK.

      SELECT * FROM VBAP INTO TABLE TB_VBAP WHERE VBELN = TB_VBAK-VBELN.


      SORT TB_VBAP BY POSNR.

      REFRESH: TB_KONV.


      IF NOT TB_VBAP[] IS INITIAL.
      SELECT KPOSN KSCHL KWERT KAWRT KBETR KRECH KPEIN KMEIN MWSK1
         FROM KONV
           INTO CORRESPONDING FIELDS OF TABLE TB_KONV
                              FOR ALL ENTRIES IN  TB_VBAP
                                          WHERE KNUMV = TB_VBAK-KNUMV
                                            AND KPOSN = TB_VBAP-POSNR
                                            AND KINAK = SPACE.

      ENDIF.

ENDLOOP.

Best Regards

Ivan

Read only

0 Likes
2,998

Hi Narsireddy,

     If you want to read item level condition value (make sure they are maintained at item level) then as suggested by   use:

               SELECT SINGLE *

                    FROM konv

                    WHERE knumv = vbak-knumv

                         AND kposn   = vbap-posnr.

If you want to use only header level condition value, please use:

               SELECT SINGLE *

                    FROM konv

                    WHERE knumv = vbak-knumv.


Regards,

Anubhab

Read only

0 Likes
2,998

Hi anubhab,

Can you help me on this.

http://scn.sap.com/message/15100088#15100088

Read only

Former Member
0 Likes
2,998

Hi,

I am worrying about kposn = vbap-posnr

Make sure that field is present in vbap table or not

Regards,

Kiran

Read only

naveenvishal
Contributor
0 Likes
2,998

Hi Narsi,

You can also try these FMs if they suit you.

PRICING_GET_CONDITIONS

PRICING

SD_SALES_PRICING_INFORMATION

SD_SALES_PRICING_PUT

RV_PRICE_PRINT_HEAD

RV_KONV_SELECT

Hope this helps.

Regards,

Naveen

Read only

0 Likes
2,998

hi naveen,

I want to know what to export and what to import to get the value of konv-mwsk1.

CALL FUNCTION 'RV_KONV_SELECT'

  EXPORTING

    comm_head_i                 =

*   COMM_ITEM_I                 =

*   GENERAL_READ                = ' '

*   READ_CONDITION_RECORD       = ' '

*   NO_PRESTEP                  = ' '

* IMPORTING

*   COMM_HEAD_E                 =

  tables

    tkomv                       =

thanks & regards,

NarsiReddy Cheruku.

Read only

Former Member
0 Likes
2,998

Hi,

Share your codes

Read only

0 Likes
2,998

hi kiran,

SELECT SINGLE * FROM konp WHERE knumh = vbak-knumv AND kopos = vbap-posnr.

  konp-mwsk1 = konp-mwsk1.                     (added konp-mwsk1 to screen.)

thanks & regards,

narsireddy.

Read only

0 Likes
2,998

Hi Narsi,

Since you are using select single, pl check in KONV or KONP that mwsk1 is not initial for 1st record.

Regards,

Naveen

Read only

0 Likes
2,998

hi naveen,

I want to know what to export and what to import to get the value of "konv-mwsk1".

 

CALL FUNCTION 'RV_KONV_SELECT'

  EXPORTING

    comm_head_i                 =

*   COMM_ITEM_I                 =

*   GENERAL_READ                = ' '

*   READ_CONDITION_RECORD       = ' '

*   NO_PRESTEP                  = ' '

* IMPORTING

*   COMM_HEAD_E                 =

  tables

    tkomv                       =

thanks & regards,

NarsiReddy Cheruku.