‎2009 Feb 17 9:38 PM
I am trying to create a class which which will read a ztable (holds pricing tables) cosidering it a list or off list price. this table has the follwoing fields mandt,kappl,kschl,kotabnr and a custom field zprice_type which is numeric and of lenght 2. This custom field is for the price type flag which will be either 0, 1 or 2 (not applicable, list, off list).
This class will determine if condition is active or inactive. Only goes forward with active conditions.
For each item , reads KONV with the condition type , doccond and item number. determine if condition is active (konv-kinak). If active , get the access # (konv-kolnr) .
read table T685 with application = V, condition type from KONV(eg. ZPRL) to get the access sequence name(T685-kozgf). This can ve the same or different from the condition type.
Then Read Table T682I with Application = V, Access Sequence = T685_KOZGF and Access # (KONV-KOLNR) to return the Table # (T682I-KOTABNR). For example, 901.
Read the Z* table with Condition Type from KONV and Table # from T682I to determine if the table is 1 (List) or 2 (Off List). Set flag accordingly.
Loop through the same logic for all conditions for the same item to determine the List or Off List setting of each.
At end of loop, if any of the active records = 2 (Off List), the item is considered Off List. Else List.
I need to build a class out of it if someone can please help me out with this . This class I will be using in my report to cerate a pricing compare list.
Thanks
Aarav
‎2009 Feb 18 3:15 AM
Could someone please help me with this , I am not able to get it right.
Thanks in advance.
Aarav
‎2009 Feb 18 3:52 AM
Hi A,
y dont u have a look at SAP examples ,check tcode ABAPDOCU or simple program - DEMO_CLASS_COUNTER.
regards
Prabhu
‎2009 Feb 18 3:56 AM
Thanks for the reply , I did try out but wasn't able to get to teh solution , and thats the reason I approached here. Kindly please provide some help.
Thanks
‎2009 Feb 18 4:41 PM
Could I please get some help in over here with the class builder.
Thanks
‎2009 Feb 18 6:03 PM
‎2009 Feb 19 9:03 AM
If you can post the actual ABAP code that you've tried and the exact error messages, then it would be easier to help.
You should break down your first method into little step. Each step should be its own method.
matt
‎2009 Feb 19 5:02 PM
Following is the code:
method CHECK_LIST_PRICING.
data: zkotabnr type c length 15,
zkonv type konv,
zkozgf type T685-kozgf,
zt685 type standard table of t685.
select * from konv
into zkonv where kinak = ' ' and knumv eq iv_knumv and kposn eq iv_kposn.
select single kozgf into zkozgf from T685 where kappl = 'V' and kschl = zkonv-kschl.
if sy-subrc eq 0.
select single kotabnr into zkotabnr
from T682I
where kappl = 'V' and kolnr eq zkonv-kolnr
and kozgf eq ( select kozgf
from T685
where kappl = 'V' and kschl = zkonv-kschl ).
if sy-subrc eq 0.
select single ZPRICE_TYPE into RV_IS_LIST from (zkotabnr) where kschl eq zkonv-kschl.
endif.
endif.
endselect.
endmethod.Thanks
‎2009 Feb 19 5:03 PM
‎2009 Feb 20 4:09 PM