2013 Mar 13 6:55 AM
Hi Folks,
Working on Condition value routine for SD pricing..
Able to modify the Condition Value (XKWERT) in Pricing Elements in Sales order
Unable to modify the Amount (XKOMV-KBETR) which should be = Condition Value / Qty.
In this case Amount should be (274 / 2) = 137 instead of 170.
Kindly refer attached doc for relevant screenshots.
Thanks !!!
Hi Folks,
Working on Condition value routine for SD pricing..
Able to modify the Condition Value (XKWERT) in Pricing Elements in Sales order
Unable to modify the Amount (XKOMV-KBETR) which should be = Condition Value / Qty.
In this case Amount should be (274 / 2) = 137 instead of 170.
Kindly refer attached doc for relevant screenshots.
Thanks !!!
2013 Mar 13 7:07 AM
Hi,
Modify the Modify statement as below and try:
MODIFY XKOMV FROM LV_KOMV TRANSPORTING KBETR. This should work!
2013 Mar 13 7:27 AM
Hi ,
Its still not modifying XKOMV.
is there any global fields for modifying kbetr like we have for kwert (xkwert) ??
Thanks !!
2013 Mar 13 7:35 AM
Hi,
MODIFY XKOMV FROM LV_KOMV INDEX <number of the current run>TRANSPORTING KBETR. Please do an F1 on this to find the correct syntax. This should work!
2013 Mar 13 7:37 AM
The reason why its not modifying is because its unable to indentify the field and for which row the modification is required as XKOMV is a table. Hence you need to include INDEX and TRANSPORTING.
Hope this helps!
2013 Mar 13 7:51 AM
Hi bAbA,
How ur code will update the value of XKOMV from lv_komv.
U have to use INDEX in the time of update the value of XKOMV.
If u give me the details of XKOMV value Than I will give the code to update the value of XKOMV.
if XKOMV is table than READ the table XKOMV and than pass ur value and than update the table XKOMV using index.It will work definitely.
Thanks
Tarak
2013 Mar 13 8:02 AM
Hi,
I am sure you have already read XKOMV into LV_KOMV above right?
So just modify the existing statement to
MODIFY XKOMV FROM LV_KOMV INDEX <number of the current run>TRANSPORTING KBETR.
You can store the current row number while reading XKOMV into LV_KOMV above and then use that INDEX below in the MODIFY statement.
This will surely work!
2013 Mar 13 9:42 AM
Hi Guys,
I am not looping XKOMV but IT_PRICE table..
Kindly refer below screens...
Thanks !!
2013 Mar 13 11:40 AM
Hi
If you are not looping at XKOMV and XKOMV is a table, how will it know KBETR of which row should be updated? Please paste your code here and maybe we can help you.
2013 Mar 13 12:54 PM
Hi,
Below is the code where we are not looping XKOMV.
------------------------------------
FORM FRM_KONDI_WERT_901.
*{ INSERT DEVK900128 1
*
data : lv_komv type KOMV_INDEX." komv.
data : it_price type STANDARD TABLE OF ZSD_PRICE_MASTER,
wa_price type ZSD_PRICE_MASTER.
data : budat type budat,
AMT TYPE ZSD_PRICE_MASTER-FRESH_RATE_FROM,
AMT1 TYPE ZSD_PRICE_MASTER-FRESH_RATE_FROM,
lv_MGLME type i.
BUDAT = komp-KURSK_DAT. "'20130227'.
* AMT = '150'.
read table xkomv into lv_komv with key kschl = 'PR00'
KPOSN = KOMP-AUPOS.
if sy-subrc eq 0.
clear : amt .
amt = lv_komv-KBETR.
select mandt VALID_FROM VALID_TO FRESH_RATE_FROM FREASH_RATE_TO SST SEC SEC_D
PG SV_MERCI SV_NON_MERCI from ZSD_PRICE_MASTER into table it_price
where VALID_FROM <= budat and VALID_TO >= budat
AND FRESH_RATE_FROM <= AMT AND FREASH_RATE_TO > AMT.
case : KOMP-KONDM.
when : 01.
when : 02.
loop at it_price into wa_price.
amt1 = wa_price-sst.
lv_komv-KBETR = amt1.
lv_komv-KBETR = lv_komv-KBETR / 1000.
xkwert = lv_komv-kbetr . "wa_price-sst.
lv_MGLME = KOMP-MGLME / 1000.
lv_komv-kbetr = xkwert / lv_MGLME.
MODIFY XKOMV FROM LV_KOMV TRANSPORTING KBETR.
endloop.
when : 03.
when : 04.
when : 05.
ENDCASE.
exit.
else.
endif.
*} INSERT
ENDFORM.
------------------------------------
Thanks !!
2013 Mar 14 5:57 AM
Hi,
In the read statement above,
read table xkomv into lv_komv with key kschl = 'PR00'
KPOSN = KOMP-AUPOS.
if sy-subrc eq 0.
move the row number into a variable LV_INDEX.
For the row number, you may check STUNR or you will have to move SY-TABIX.
LV_INDEX = SY-TABIX or LV_KOMV-STUNR. Please check this.
Use this LV_INDEX in the MODIFY statement
MODIFY XKOMV FROM LV_KOMV INDEX LV_INDEX TRANSPORTING KBETR.
This will surely work!
2013 Mar 20 10:27 AM
Hi,
The problem is not in Modify as i am able to modify the value in XKMOV table but once it comes out of the routine it again comes to the original value.
Thanks !!
2013 Mar 20 11:11 AM
Hi Baba,
The problem is that you are using a condition value formula to modify the base.
You need to use a condition base value formula to modify kbetr
Regards
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |