Skip to Content
0
Former Member
May 29, 2014 at 09:44 PM

selecting, reading and sum of billing quantity for last 12 months in transformation end routine

408 Views

Hi experts,

i have requirement to write end routine to read a DSO for last 12 months sales quantity for each month and sum value pass to keyfigure

not interested using bex variable, while data loading from source to target dso in end routine i am trying to read another DSO which is same as my

target dso where information is stored by fiscal period, year material etc. finally there is a keyfigure in target whih needs to be filled with sum of 12

months sales quantity, for each record form sourc to target maximum of 12 records will be in read dso (for 12 months) my routine is like below.

i am not expert in abap please kindly gothrough and guide me in this

TYPES: BEGIN OF s_/BIC/AZOSLS00,


FISCPER type /BI0/OIFISCPER,

FISCVARNT type /BI0/OIFISCVARNT,

PLANT type /BI0/OIPLANT,

STOR_LOC type /BI0/OISTOR_LOC,

/BIC/MATERIAL type /BIC/OIMATERIAL,

VTYPE type /BI0/OIVTYPE,

BILL_QTY type /BI0/OIBILL_QTY,

END OF s_/BIC/AZOSLS00.


DATA: it_/BIC/AZOSLS00 TYPE TABLE OF s_/BIC/AZOSLS00,

wa_/BIC/AZOSLS00 TYPE s_/BIC/AZOSLS00.



SELECT

FISCPER

FISCVARNT

PLANT

STOR_LOC

/BIC/MATERIAL

VTYPE

BILL_QTY



FROM /BIC/AZOSLS00 INTO TABLE it_/BIC/AZOSLS00

FOR ALL

ENTRIES IN RESULT_PACKAGE



WHERE

**********************************

below field is from value of fiscal period (which is fiscal period -999 ex: for 001.2014 this

value will be 002.2013 so 12 months including current period)

**********************


FISCPER >= RESULT_PACKAGE-/BIC/ZFISCPERF

*****************************************************

below is result filed fiscal period (here i dont know which keyword or statement to be used to select

interval values this between statement giving syntax error that can not be used in where for for all entries

**************************************

between RESULT_PACKAGE-FISCPER
AND

FISCVARNT = RESULT_PACKAGE-FISCVARNT AND

PLANT = RESULT_PACKAGE-PLANT AND

STOR_LOC = RESULT_PACKAGE-STOR_LOC and

/BIC/MATERIAL = RESULT_PACKAGE-/BIC/MATERIAL .





SORT it_/BIC/AZOSLS00 BY FISCPER FISCVARNT PLANT STOR_LOC

/BIC/MATERIAL .

LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.


READ TABLE it_/BIC/AZOSLS00 INTO wa_/BIC/AZOSLS00 WITH KEY

********************************************

below dont know what statement i need to use in read statement for interval of fiscal periods

giving error that >= can not be used

*************************************************

FISCPER >= <result_fields>-/BIC/ZFISCPERF

FISCPER = <result_fields>-FISCPER

************************************************************************************

FISCVARNT = <result_fields>-FISCVARNT

PLANT = <result_fields>-PLANT

STOR_LOC = <result_fields>-STOR_LOC

/BIC/MATERIAL = <result_fields>-/BIC/MATERIAL



BINARY SEARCH.



BREAK-POINT.



IF sy-subrc = 0.

********************************************************************

below for each record there will be 12 records in read so sume of 12 records quantity i need to pass to result again dont know what to say here

sum statement giving error

************************************************************

<result_fields>-/BIC/ZLSTSLS12 =

sum(wa_/BIC/AZOSLS00-BILL_QTY).



ENDIF.


ENDLOOP.

friends please help me in this.

Thanks

Chandra.