cancel
Showing results for 
Search instead for 
Did you mean: 

Reg.. Schedule lines

Former Member
0 Kudos

We have created a ztable by name zcpdcurr,zcpdhtry,....

I have fetching data from two tables zcpdcurr and vbep.. while fetching data i need to check the 'order qty(wmeng)' in vbep and 'cpd_qty' in zcpdcurr.

*If less then we need to make the cpd_qty in zcpdcurr equal with order_qty in vbep*

*If greater than we need to make the cpd_qty equal with order_qty in vbep*

so anyone can help me detailed code,.....

Edited by: murari sampath kumar on Jan 10, 2008 11:34 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Murari,

There is no field by name cpd_qty present in the vbep table.

Can you please elaborate the issue clearly.

Thanks,

Kashyap Ivaturi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Murari,

First you need to compare the wmeng field in the vbep table with the cpd_qty field in the zcpdcurr table to know which one is greater.Then you can make the values equal.

For that you can use the following code.

TABLES : vbep , zcpdcurr.

DATA : BEGIN OF ITAB OCCURS 10,

WMENG LIKE VBEP-WMENG,

CPD_QTY LIKE ZCPDCURR-CPD_QTY,

END OF ITAB.

select single awmeng bcpd_qty into ITAB from vbep as a JOIN zcpdcurrr as b .

loop at itab.

IF itab-wmeng LT itab-cpd_qty OR itab-wmeng GT itab-cpd_qty .

zcdcurr-cpd_qty = itab-wmeng.

endif.

endloop.

Reward if helpfull.

Thanks,

Kashyap Ivaturi