cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

sorry guys forgot to inform required to have the sum of last 12 months sales qutity for each month.

Thanks

Chandra

Former Member
0 Kudos

Hiii,

If you only want to store last  12 months data in Target ODS .

Then Create filter in DTP and write routine in filter for calmonth or fiscal period.

Refer the below link to create filter routine :

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b2db87-639b-2e10-a8b9-c1ac0a44a...

Regards,

Akshay