Skip to Content
0
Former Member
Jul 26, 2005 at 03:59 PM

Pulling the condition records - help in the ABAP code -urgent!!!!!

365 Views

hi folks,

I need some urgent help here..

I have discussed this portion before in the forum but there are some changes and I need some help here.

The code goes like this....

select knumv kschl kbetr kwert

from konv into table cdata

for all entries in bodyitab21

where konv~knumv = bodyitab21-knumv

and konv~kwert > 0.

  • I am successfully pulling the data into cdata here..

I need to check for various condition types that are around 100. I need to split them into two types because some condition types containe just pricing values while some others have values in % (but the value not stored in that format) To do the extra coding I have use two differetn case statements and that's what i have done here.

<b>My probelm is I will have to check for each condition type, if the 'kwert' field has some value in it pull the data and there is a condition text associcated to it in the table 'T685T' that needs to be pulled into the itab.

This process has to be done for every condition type.</b>Given this scenario how can i do it?

loop at cdata into wac.

case wac-kschl.

when 'ZRAT' OR 'ZAGR' OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW' OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'ZTHX' OR 'ZCOL'

OR 'ZCFE' OR ZSPA' OR 'ZBOX' OR 'ZCOR' OR 'Y130' OR 'ZBOR'

OR 'Y108' OR 'ZFPP' OR 'Y204' OR 'Y200' OR 'Y202' OR 'Y201' OR 'Y203' OR 'Y002' OR 'ZSCR' OR 'Y128' OR 'Y100' OR 'ZABS' OR 'ZSMG' OR 'ZFRE' OR 'ZREC' OR 'ZCOM' OR 'ZPMG' OR 'BEMG' OR 'ZDTI' OR'ZBET'.

<b>***** the first set of these condition types have just values</b> if wac-kbetr = ' ' AND wac-kwert = ' '.

continue.

else.

p = wac-kbetr.

i = p.

c = i.

MOVE c to w_accitab-zrate.

MOVE wac-kbetr to w_accitab-zrate.

MOVE wac-kwert to w_accitab-zsubtotal.

endif.

when 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR'

OR 'ZECD' 'ZAC1' OR 'ZAC%' OR 'ZAC2' OR 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR' OR 'ZECD' 'ZQUD' OR 'ZEMP' OR 'Y101' OR 'Y012' OR 'ZCHU' OR 'Y054' OR 'Y065' OR 'Y066' OR 'Y067' OR 'Y068' OR 'Y069' OR 'Y096'

OR 'Y103' OR 'Y010' OR 'Y070' OR 'Y071' OR

'Y072' OR 'Y073' OR 'Y074' OR 'Y075' OR 'Y076'

OR 'Y077' OR 'Y078' OR 'Y079' OR 'Y156' OR OR 'Y148'

OR 'Y102' OR 'Y205' OR 'Y206' OR 'Y207' OR 'Y208' OR

'Y209' OR 'Y213' OR 'Y210' OR 'Y211' OR 'Y212' OR 'Z%DS'

OR 'Z%DO' OR 'Y113' OR 'Y151' OR 'Y152' OR 'Y153' OR

'Y154' OR 'Y155' OR 'Y147' OR'Z%PB' OR 'Y142' OR 'Y131'

OR 'Y141' OR 'Y149' OR 'ZDEO' OR 'Z%DR' OR 'Y115' OR

'Y116' OR 'Y095' OR 'Y084' OR 'ZSA$' OR 'ZSA%' OR

'ZPA$' OR 'ZPA%'.

  • the second set of these condition types have just values that has to be converted into %.

if wac-kbetr = ' ' AND wac-kwert = ' '.

clear w_accitab-zrate.

continue.

else.

p = wac-kbetr.

p = p / 10.

if p < 1.

rate+0(1) = '-'.

endif.

if i = 0.

clear w_accitab-zrate.

else.

i = p.

c = i.

shift c right deleting trailing '-'.

concatenate rate c '%' into rate.

condense rate no-gaps.

MOVE wac-kbetr to w_accitab-zrate.

MOVE rate to w_accitab-zrate.

clear rate.

MOVE wac-kwert to w_accitab-zsubtotal.

endif.

endif.

Thanks alot in advance.

Santhosh