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

Scaling Problem in SD function Routine

Former Member
0 Likes
776

Hello Friends ,

I am using the below code for my req in order pricing.

Requierment is something like that : i have to find the quantity of order which not having some condtion types, after getting the quantity i have to find the scale % based on the quantity and pass the % into the field to meet req. For getting the scale % i am using select query .

can we use select in rountine if yes then the problem is that the same thing have to be apply in java IPC which not posbl, if no then can any one send me any soln.

xvakey(10) = xkomv-knumh.

xvakey+10(2) = xkomv-kposn.

xvakey+15(1) = 'X'.

xkomv-kmprs = 'X'.

clear l_discount.

read table tkomv into ls_komv

with key kposn = xkomv-kposn

kschl = 'ZPWS'.

if sy-subrc = 0.

xkomv-kbetr = l_discount.

exit.

endif.

read table tkomv into ls_komv

with key kposn = xkomv-kposn

kschl = 'ZPPG'.

if sy-subrc = 0.

xkomv-kbetr = l_discount.

exit.

endif.

clear l_ordqty.

loop at tkomp into ls_komp.

clear l_flag.

read table tkomv into ls_komv

with key kposn = ls_komp-kposn

kschl = 'ZPWS'.

if sy-subrc = 0.

l_flag = 'X'.

endif.

read table tkomv into ls_komv

with key kposn = ls_komp-kposn

kschl = 'ZPPG'.

if sy-subrc = 0.

l_flag = 'X'.

endif.

if l_flag is initial.

l_ordqty = l_ordqty + ls_komp-mglme.

endif.

endloop.

select single knumh

into l_knumh

from a512

where kappl = 'V'

and kschl = 'YVRD'

and vkorg = tkomk-vkorg

and vtweg = tkomk-vtweg

and matnr = tkomp-matnr

and datbi <= sy-datum.

select *

from konm

into table lt_konm

where knumh = l_knumh.

sort lt_konm by klfn1 descending.

clear l_discount.

loop at lt_konm into ls_konm.

if l_ordqty >= ls_konm-kstbm.

l_discount = ls_konm-kbetr.

exit.

endif.

endloop.

xkomv-kbetr = l_discount.

5 REPLIES 5
Read only

JoffyJohn
Active Contributor
0 Likes
671

you can write select in routines

Read only

Former Member
0 Likes
671

Is there any other way to find scale rather using table.

Read only

Former Member
0 Likes
671

Shilpi..

In case you dont want to use tables..... then i think it would be better if you post this query

in SD section where SD experts might be able to give you little more insight....

Cheers..

Read only

Former Member
0 Likes
671

Hi,

It is not the best pratice to write select query's on the condition sequence tables to fetch the scaling values. Generally this job will be carried by the standard SAP code dynamically as the condition sequence (Eg A512 , A513.... ) may be changed in future.

You have to find the rouitne where in the the condition number and value will be visible in a routine for a particular condition type to meet your requirement.

With Regards,

Dwarakanath.S

Read only

0 Likes
671

Is there any table for storing the condtion number . this is group condition rountine so there is no othr rountine for that,