cancel
Showing results for 
Search instead for 
Did you mean: 

Read sales Condition records

Former Member
0 Kudos
998

Hi Experts,

I need to read the condition record from sales order maintenance. I have the following information.

Material Number, Quantity, Plant, sales area, customer, condition type. Is there any standard function module which will give me the condition rate given the above details. It should also consider if scales exists for the condtion records.

Thanks a lot for your help.

Best regards

Satish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi there

you can do this...just consult your functional guy as to what is the name of the condition table that they have created for a particular condition type (PR00)...it will start with A*...there will be some tables based on the access sequence number...in this table, give your condition type, sales area, and material, it will give a condition record number...access KONP with this to get the KBETR

if helpful, reward

Sathish. R

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks for your replies. In my case, scales will exists. Will all teh entries for different quantities exist in KONP and will they have the same condition number.Also , if multiple amounts can be maintained for different unit of measurement will they have same condition record number.

Thanks

Satish

Former Member
0 Kudos

Hi,

there will be different KNUMH's for the same Condition Type in your case.

search them in A* tables, for the different KNUMH fields (condition record may be created based on quanitties and Units also)

So Pass that KNUMH to KONP for different scales different values will be there.

regards,

Anji

Former Member
0 Kudos

Satish,

u can try this code.

if u r using WBS element, this vl be the procedure.

*Conditions

SELECT kappl kozgf kvewe kotabnr kolnr

FROM t682i INTO TABLE it_t682i

WHERE kappl = c_v AND

kvewe = c_a AND

kozgf IN (c_zpr0,c_zpr1).

IF it_t682i[] IS NOT INITIAL.

SORT it_t682i DESCENDING BY kozgf.

DELETE it_data WHERE vbeln IS INITIAL.

DATA: c_val TYPE i VALUE '3600'.

DATA: BEGIN OF t_t006,

msehi TYPE t006-msehi,

zaehl TYPE t006-zaehl,

nennr TYPE t006-nennr,

END OF t_t006.

DATA : it_t006 LIKE STANDARD TABLE OF t_t006.

SELECT msehi zaehl nennr FROM t006 INTO TABLE it_t006

WHERE dimid = 'TIME'.

LOOP AT it_data ASSIGNING <fs_data>.

DO.

READ TABLE it_t682i INTO t_t682i INDEX sy-index.

IF sy-subrc IS NOT INITIAL.

EXIT.

ELSE.

CONCATENATE c_a t_t682i-kotabnr INTO l_table.

CLEAR where_clause.

PERFORM convert_wbs_element USING <fs_data>-objid

CHANGING l_posid.

PERFORM get_sales_data_of_wbs USING l_posid

CHANGING st_sales.

IF st_sales IS INITIAL.

EXIT.

ENDIF.

CASE l_table.

  • When the table is A901, pass the WBS Element

WHEN c_a901.

CONCATENATE 'ZZPROJK = ''' <fs_data>-objid '''' INTO where_clause.

  • When the table is A902, pass the Price List

WHEN c_a902.

CONCATENATE 'PLTYP = ''' st_sales-pltyp '''' INTO where_clause.

ENDCASE.

*Read Condition Rec.No., and Condition type

SELECT knumh kschl

INTO TABLE l_gt_konp

FROM (l_table)

WHERE kappl EQ c_v

AND kschl IN (c_zpr0,c_zpr1)

AND vkorg EQ st_sales-vkorg

AND vtweg EQ st_sales-vtweg

AND kunnr EQ st_sales-kunnr

AND (where_clause)

AND matnr EQ <fs_data>-inv_mat

AND datbi GE st_sales-prsdt

AND datab LE st_sales-prsdt.

IF sy-subrc = 0.

  • Read the rate, currency and UOM

SELECT kschl kbetr konwa kmein

INTO TABLE l_gt_rate

FROM konp

FOR ALL ENTRIES IN l_gt_konp

WHERE knumh = l_gt_konp-knumh

AND loevm_ko EQ space.

IF sy-subrc = 0.

  • select the data in an internal table and then reading the record

SORT l_gt_rate DESCENDING BY kschl.

READ TABLE l_gt_rate INDEX 1.

<fs_data>-meinh = l_gt_rate-kmein.

IF l_gt_rate-kschl EQ c_zpr0.

READ TABLE it_t006 INTO t_t006 WITH KEY msehi = l_gt_rate-kmein.

IF sy-subrc IS INITIAL.

<fs_data>-netwr = ( l_gt_rate-kbetr * <fs_data>-op_megbtr ) / ( ( t_t006-zaehl / t_t006-nennr ) / c_val ) .

  • <fs_data>-netwr = l_gt_rate-kbetr * <fs_data>-op_megbtr.

ENDIF.

ELSEIF l_gt_rate-kschl EQ c_zpr1.

l_gt_rate-kbetr = l_gt_rate-kbetr / 10.

<fs_data>-netwr = ( l_gt_rate-kbetr / 100 ) * <fs_data>-op_wkgbtr.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDDO.

ENDLOOP.

ENDIF.

Regards,

Sujatha.

Message was edited by:

Sujatha Reddy

Former Member
0 Kudos

hI...

go through the following tables..

by MARA material master..

MARC

KONH Conditions header

KONP Conditions items

KONV Procedure ( billing doc or sales order)

KOND

Former Member
0 Kudos

Hi,

There are some tables KONV, KONP and structures konv, KOMP use this so that you can retrive the data