2014 May 27 10:38 AM
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.
2014 May 27 10:45 AM
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
2014 May 27 10:50 AM
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.
2014 May 27 10:54 AM
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
2014 May 27 10:55 AM
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.
2014 May 27 11:03 AM
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.
2014 May 27 11:07 AM
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
2014 May 27 11:13 AM
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
2014 May 27 11:19 AM
hi anubhab,
I am not sure about the condition part,
please tell me how to check for the correct condition.
thanks & regards,
NarsiReddy,
2014 May 27 11:20 AM
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
2014 May 27 11:27 AM
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
2014 May 27 11:32 AM
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
2014 Jun 03 10:44 AM
2014 May 27 10:54 AM
Hi,
I am worrying about kposn = vbap-posnr
Make sure that field is present in vbap table or not
Regards,
Kiran
2014 May 27 10:58 AM
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
2014 May 27 11:06 AM
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.
2014 May 27 11:09 AM
2014 May 27 11:11 AM
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.
2014 May 27 11:15 AM
Hi Narsi,
Since you are using select single, pl check in KONV or KONP that mwsk1 is not initial for 1st record.
Regards,
Naveen
2014 May 27 11:24 AM
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.