Application Development 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: 

Requirement pricing routine : find the CONDITION value in debug (in ME21N)

Former Member
0 Kudos

Hi,

I've created a condition record (transaction MEK1) : condition type 2822

In the customizing we linked the routine 601 to 2 condition types : 2822 and 2826.

I put a break-point in the routine (RV61A601).

In a PO creation (ME21N), with the same details than the condition record (purch. org., vendor, valid date, settlement group), when I stop on this break-point I want to know which condition is actually used (to get the field KNUMH)

In global data, I got plenty of structures / tables, but I can't find one with correct data. Table TKOMV contains all the conditions... (with the good one, 2822, but I can't select it), structure KONP contains another condition...

In few words : I need an existing structure with the condition details which is actually processed.

Any ideas ?

Thank you.

Regards,

Thibault Doche

12 REPLIES 12

former_member191735
Active Contributor
0 Kudos

Try XKOMV header which is the one currently processing record.

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hi ,

Actually the condition values in the routines will store will table-field name.

So it is easy to us that if you enter the table name - field you will get the values in it.

example KUWEV-KUNNR.

Thanks,

Bhargav

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hi ,

Actually the condition values in the routines will store will table-field name.

So it is easy to us that if you enter the table name - field you will get the values in it.

example KUWEV-KUNNR.

Thanks,

Bhargav

Former Member
0 Kudos

Thanks for your answers.

In XKOMV, I don't have all the conditions, and the field KSCHL is empty.

But I think I found a start of answer :

I found the table KOMT1 which is maybe the good one. In the header line, I have the field KSCHL with the value I look for (condition type 2822).

Now, I have to find a way to get my condition (with the unique number KONH-KSCHL)...

Edited by: thibault.doche on May 20, 2011 11:43 AM

Former Member
0 Kudos

Hi,

did you maintaining your condition value field in your internal table or not. if not you can add one field for condition value in the internal table.

if you already maintinag field for condition value, check the entries in respective table. Definitely it will useful to u.

Good Luck.

Ram.

0 Kudos

Hi Ram,

I'm not sure I understand what you want to say.

When I create my PO, I go 2 times in my routine (because I customized 2 conditions for this routine), and each time I can get the condition type (KSCHL), but not the condition number (KNUMH)...

0 Kudos

Condition number will be available only after saving the document. Did you try XKOMV internal table for all the conditions and the header record is the current one.

0 Kudos

The header line of XKOMV doesn't have the correct data (another condition).

Condition number will be available only after saving the document.

Thanks, I didn't know that.

But still, I think I have all the data to get this condition, which is already in DB (table KONH) :

KOMK-EKORG, KOMT1-KSCHL, KOMP-MATNR, KOMK-LIFNR, KOMP-BONUS...

I could maybe use the field VAKEY in KONH...

0 Kudos

The header line of XKOMV doesn't have the correct data (another condition).

XKOMV should have every condition type in the pricing procedure. However, header of XKOMV is always the current record. if you are in the routine/requirement and the header of XKOMV is not the one you are looking for then you could always read it using XKOMV-KSCHL.

KSCHL is the condition type.

For example, i am in routine 622 and in current condition is 'XXXX' but if i need to search for XVYY condition type then i can read it using KSCHL and if it is item specific then you can use KONV or other table to find what the current item or currently processing item.

0 Kudos

The table XKOMV doesn't contain the condition type I look for. Same thing for the header line.

At this point, the only way I found (I don't know if it's working in all cases) is to access the table Axxx (the value in KOMT2-KOTABNR) with the data I already have (KSCHL, LIFNR, EKORG etc.). Then, I can find the condition record KNUMH.

0 Kudos

Strange but what do you want to do with the condition record KNUMH? I mean, do you want to populate the condition type with those values?

I recommend you to talk to your pricing resource. Usually all the condition types in the pricing procedures should be there irrespective of access sequence and other determinations. At least, it should be there as an inactive condition unless you delete it in any user exit.

0 Kudos

Well, I need the field KZUST, and I know I can get it in the table KONH, with the key KNUMH.

I talked to the functional consultant, but he's not technical at all and he doesn't know where I can find this number. I'm currently waiting for the response of another consultant.

At least I'd like to know if I can get the KNUMH :

- directly in the routine (with all the global data) --> I searched, without results...

- or if I have to find this number myself (for exemple, with the FMs ME_DETERMINE_KOTABNR and then MM_CONDITION_RECORDS_READ, but it seems that the first one doesn't deal with all the custom tables like Axxx).

Maybe I'm totally missing the point...

Thank you.