Condition Type - Pricing

Question: guys

need some ABAP help here.

I have some materials retrieved from MARA acc to some pre conditions.
Now i need to loop thru this internal table of MARA materials say T-MARA
and do something:

I need to go to a table A304 and get the condition record number from field KNUMH and then go to KONP table and for this condition record number i need to get the current rate for the day KBETR and validate to see that the pricing condition is valid for the execution date of the program. We do this for condition type PR00 (default value) and before we loop back to the new item, we need to output this to a file.

Please help me out here... esp how to validate this pricing condition for the execution date of the program....

Thanks

Answer:
I'm not sure if I understand you, but did you try to use transaction VK32 for changing conditions?

If I'm not answering your question, could you elaborate some more?

Answer:
thanks for the followup, anyways i'll make u more clear

I have some materials selected acc to some condition and got it in an internal table. Now i need to go to A304 table (material with release status - may be a different table in ur system) and get the corresponding KUNMH (condition record number) for a material and for a default condition type (PR00 - field KBETR) and now once we get this KUNMH, go to KONP and get the corresponding rate of the day (KBETR) for the corresponding KUNMH we found in A304. And now all these info must be in one internal table to write them to an output file. I have some other data from other internal tables to write to the output table like material description, unit of measure etc.

Hope this is better for ur understanding,

Thanks again

Answer:
Just check the validity period of your pricing condition against SY-DATUM.

That should give you all the validation against your condition record.

As for getting it into one internal table, loop and move...
_________________
Kind Regards

Rosie Brent

Please remember to search the forum and check the FAQ before posting questions, thank you.

Tuly Idiot most of the time, part-time Guru

Answer:
I wrote the below code long time ago. Table A305 is a sister of A304, so same basic rules apply. Does this help?

Also, if you'd like change the validity date, as I said before, TA VK32 would let you do it.

* Condition reference table
select single knumh datab
from a305
into wa_a305
where kappl = 'V'
and kschl = 'PR00'
and vkorg = wa_zskxz69-vkorg
and vtweg = wa_zskxz69-vtweg
and kunnr = wa_zskxz69-zskxsold_to
and matnr = wa_zskxz70-mabnr
and kfrst = ' '
and datbi >= sy-datum.

if sy-subrc <> 0.
"error procedure
else.

* Get condition for the material.
select single kbetr konwa kpein
from konp
into (wa_zskxz70-kbetr, wa_zskxz70-koein,
wa_zskxz70-kpein)
where knumh = wa_a305-knumh
and kopos = '01'
and kschl = 'PR00'.

if sy-subrc <> 0.
"if there is a record in A305, there should be
"no error here.
else.
Copyright ?2007 - 2008 www.jt77.com