Quantcast
Viewing all articles
Browse latest Browse all 10052

Re: Question "How to write data into an infocube"

Hi

 

Did you tried debugging your code ?

 

Does other Application have same structure ?(I mean same dimension )

 

Also why are you using technical name which is difficult to read/modify in future, please create structure of your cube & use it.. please refer below link in which it has given simple example to create structure of application (ex: data here)

 

http://scn.sap.com/docs/DOC-45449

 

method IF_UJ_CUSTOM_LOGIC~EXECUTE.
   TYPES:
BEGIN OF data,
       measures
TYPE c LENGTH 20,
       account
TYPE c LENGTH 20,
       company
TYPE c LENGTH 20,
       geography
TYPE c LENGTH 20,
       product
TYPE c LENGTH 20,
       currency
TYPE c LENGTH 20,
       unit
TYPE c LENGTH 20,
       time
TYPE c LENGTH 20,
       version
TYPE c LENGTH 20,
    
END OF data.

  DATA: wa_data
TYPE data,
        wa_final_data
TYPE data,
        it_data 
TYPE STANDARD TABLE OF data,
        it_final_data
TYPE STANDARD TABLE OF data.

 
IF ct_data[] IS NOT INITIAL.   " Checking If ct_data is not Blank .

    it_data = ct_data.  
" Copying CT_DATA into an internal Table .
   
SORT it_data BY company.   " Sorting By Company
   
DELETE it_data WHERE company <> 'ABC'.   " Deleting All other Company Except ABC .
   
SORT it_data BY account.   "Then Sorting based on Account
   
DELETE it_data WHERE account <> 'XYZ'.   "Deleing All Other Accounts Except XYZ .

   
LOOP AT it_data INTO wa_data.
      wa_final_data = wa_data.
      wa_final_data-account =
'C0049'.
     
APPEND wa_final_data TO it_final_data.
      wa_final_data-account =
'C0002'.
     
APPEND wa_final_data TO it_final_data.
    ENDLOOP.

   
SORT it_final_data.
   
DELETE ADJACENT DUPLICATES FROM it_final_data.
*  Overwrite buffer table with final result set.
    ct_data = it_final_data.
  ENDIF.
endmethod.



JAck


Viewing all articles
Browse latest Browse all 10052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>