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

Class - logic

Former Member
0 Likes
1,228

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,083

Could someone please help me with this , I am not able to get it right.

Thanks in advance.

Aarav

Read only

0 Likes
1,083

Hi A,

y dont u have a look at SAP examples ,check tcode ABAPDOCU or simple program - DEMO_CLASS_COUNTER.

regards

Prabhu

Read only

0 Likes
1,083

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

Read only

0 Likes
1,083

Could I please get some help in over here with the class builder.

Thanks

Read only

Former Member
0 Likes
1,083

.

Read only

matt
Active Contributor
0 Likes
1,083

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

Read only

Former Member
0 Likes
1,083

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

Read only

Former Member
0 Likes
1,083

.

Read only

Former Member
0 Likes
1,083

.