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

Flow-logic

Former Member
0 Likes
1,696

Hi!

I need to create a logic in class to check the list pricing

For that I ahve created a method with follwoing parameters

IV_KNUMV Importing Type KNUMV

IV_KPOSN Importing Type KPOSN

RV_IS_LIST Returning Type BOOLEAN

Now for this I need to create a logic for the code based on the

follwoing steps. I havent created a class before , but I tried it

though its giving me errors and hence I am unable to get through.

Could someone please help me out with this .

The steps are as mentioned below. In teh steps there is a ztable

that had to be created which I have done and the fields for the

table are as follows.

table name : ZSD_PRICE_TYPE

MANDT MANDT CLNT 3 0 Client

KAPPL KAPPL CHAR 2 0 Application

KSCHL KSCHA CHAR 4 0 Condition type

KOTABNR KOTABNR NUMC 3 0 Condition table

ZPRICE_TYPE ZPRICE_TYPE NUMC 2 0 Price type flag

the steps are as follows:-

Determine if Condition is Active or Inactive. Only go forward with Active conditions.

For each item, read KONV with the Condition Type, DocCond and Item No.

Determine if condition is Active (KONV-KINAK). If active, get the Access # (KONV-KOLNR). Example: 60.

Read Table T685 with Application = V, Condition Type from KONV (eg. ZPRL)

to get the Access sequence name (T685-KOZGF). This can be 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.

Thanks

Aarav

17 REPLIES 17
Read only

Former Member
0 Likes
1,650

Is there any help for this class generation ? I am not able to go through with teh standard coding and hence getting errors.

Thanks

Aarav

Read only

0 Likes
1,650

Is your problem with classes or the logic?

Rob

Read only

0 Likes
1,650

I have never worked on the classes but my problem here is the logic which is trouble for me here.

Thanks

Aarav

Read only

0 Likes
1,650

I wouldn't worry about two things at once. To get the logic going, you can create an executable report with performs. This should simplify it a bit.

Rob

Read only

0 Likes
1,650

Thats true , I am not worried about the class but the logic si what I am trying to get through with first where I am stuck up . If I can get some help on the logic would be highly appreciated .

Thanks

Aarav

Read only

0 Likes
1,650

Well, you've supplied the logic already. Why don't you try writing pseudo-code for it and when you have that, you can convert it to ABAP.

Rob

Read only

0 Likes
1,650

Didnt get through correctly with proper code , thats why came back for help.If some help can be provided.

Thanks

Read only

0 Likes
1,650

Can I get some help with the logic flow please?

thanks

Read only

0 Likes
1,650

Why don't you try it and get back to the forum with the code you develop if you have questions?

Rob

Read only

0 Likes
1,650

I have teh code but its giving em exception and more so I need to loop through the same logic for all conditions for the same item to determine the list or off list setting of each . If I can get some help on it would be great.


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.
    loop at zt685 into zkozgf.
      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.
    endloop.
  endselect.
endmethod.

Thanks

Read only

0 Likes
1,650

The problem is the looping which I am not pretty sure if its looping thropugh al the conditions for the same item to determine if its list oroff list price.

When I run the method/class it shows an exception as below.

Exception CX_SY_NO_HANDLER

Exception CX_SY_NO_HANDLER triggered

An exception with the type CX_SY_DYNAMIC_OSQL_SEMANTICS occur

Thanks

Aarav

Read only

0 Likes
1,650
 select single ZPRICE_TYPE into RV_IS_LIST from (zkotabnr) where kschl eq zkonv-kschl 

Why are you using a dynamic table name: (zkotabnr)?

Isn't this an internal table? I see, this is a variable which does NOT hold any valid table name I guess.

Where are you selecting this field from? Replace this (zkotabnr) by the name of the database table you are trying to access.

Hence the dynamic SQL short dump.

Edited by: Micky Oestreich on Feb 19, 2009 7:19 PM

Read only

0 Likes
1,650

(zkotabnr) is from the previous select statement output .


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 = 0.

Thanks

Read only

0 Likes
1,650

Thats not a table but a variable into which the value of kotabnr is stored after selevtion from t682i table.

Thanks

Read only

0 Likes
1,650

I changed it to the table from whichit is derived .

         select single ZPRICE_TYPE into RV_IS_LIST
                       from zsd_price_type where
                               kschl eq zkonv-kschl .

.

I just wanted to know if the looping is alright or not , so that it loops in for all conditions for the same item to determine the price is off list or from list.

Thanks in advance.

Aarav

Read only

0 Likes
1,650

Is there any help with this regard, I am not able to get the result with this logic , if someone will be kind enough to help me out would be highly appreciated.

thanks

Read only

Former Member
0 Likes
1,650

.