cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup for NLS archived DSO data using routine

0 Kudos

Hello,

We have completely archived data of a DSO1 to Near Line Storage and we want to do a look-up the archived data of this DSO1 in a transformation from DSO2 to Infocube1.

We tried to achieve this in 2 ways :

1) using 'Read from DataStore' feature in transformation.

- This works fine when we use the 'Read from DataStore' feature for single field in the transformation rule and get the output (archived data).

2) using field 'Routine' in transformation.

-  this does not work when trying to lookup using the ABAP Code.

The reason we want to do the lookup in the routine is, so that.

-  we can do the lookup to this DSO in NLS in Start/End routine and further use this lookup data within the Start/End routine in other internal tables for further calculations.

Any inputs will be highly appreciated.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Krupali:

You have to archive enable any start or end routine when doing a lookup against data that has been archived to NLS.  The SELECT....FOR ALL ENTRIES.... statement will need to be replaced with the following API call:

    TRY.

        CALL METHOD

          cl_rsda_infoprov_query=>select

            EXPORTING

              i_infoprov           = c_infoprov        

              i_t_entries          = lt_lookup_keys

             i_t_entry_fields  = lt_lookup_conditions

            CHANGING

              c_t_data             = pt_lookup_data.

            CATCH cx_rsda_input_invalid

                         cx_rsda_access_error.


    ENDTRY.



Hope this helps!



0 Kudos

Hi J H,

Thanks for the reply.

With reference to SAP Note 1536550 -Enhancement LOOKUP API: Separate NLS lookup for DSO/CUBE,

we have used the below code :

TRY .

CALL METHOD lv_class_var->select
EXPORTING

i_infoprov = 'ZPP_BOM'
i_t_entries = SOURCE_PACKAGE
i_t_entry_fields = lt_entryfields
I_T_FIELD_SELECTIONS = lt_field_selections
i_storage_selection =
cl_rsda_infoprov_query=>c_storage_selection-all
CHANGING
c_t_data = lt_zpp_bom1.


CATCH cx_rsda_input_invalid.

CATCH cx_rsda_access_error.

CATCH cx_rsda_action_refused.

ENDTRY.

However, while loading the data, we are getting the below error in DTP :

"Exception in Substep Start Routine"

Record (0) for segment (0001) has no reference to a source record

Dereferencing the NULL reference

An exception was raised

Error in substep

Data package processing terminated

Would like to know if you have used this API successfuly.

Regards,

Krupali

 

Former Member
0 Kudos

Hi Krupali:


Please refer to a piece of sample code below as reference.  We have been able to implement the API successfully.

0 Kudos

Hi J H,

Thanks for the reference.

We will have have a look and adapt our logic accordingly.

Will keep you updated.

Regards,

Krupali

0 Kudos

Thanks for the tips.

It worked in my scenario.

Jaydip

Answers (3)

Answers (3)

0 Kudos

Hello J H,

As Jaydip has already updated, this worked for our scenario.

Thanks for the inputs.

Closing the thread.

Former Member
0 Kudos

Glad I was able to help!

0 Kudos

Hi J H,

Just one more clarification.

In your sample code,

ls_lookup_condition-fieldname = 'EMPL_ID'

ls_lookup_condition-option = 'EQ'

ls_lookup_condition-component_name = 'EMPL_ID'.

In our case, it works fine for 2 fields where 'fieldname' and 'component_name' are the same.

However, it does not, for the 3rd field which we try to lookup, where 'fieldname' and 'component_name' are different.

i.e.For example,

* for Plant (here 'fieldname' and 'component_name' are the same)

wa_entry_fields-fieldname = 'PLANT'.
wa_entry_fields-option = 'EQ'.
wa_entry_fields-component_name = 'PLANT'.

APPEND wa_entry_fields TO lt_entry_fields.


* for createdon ( 'fieldname' and 'component_name' are the different)

wa_entry_fields-fieldname = 'CREATEDON'.
wa_entry_fields-option = '='.
wa_entry_fields-component_name = 'PSTNG_DATE'.

APPEND wa_entry_fields TO lt_entry_fields.

*for Shift ( 'fieldname' and 'component_name' are the same)

wa_entry_fields-fieldname = '/BIC/ZSHIFT'.
wa_entry_fields-option = 'EQ'.
wa_entry_fields-component_name = '/BIC/ZSHIFT'.

APPEND wa_entry_fields TO lt_entry_fields.

Have you faced any such issue ?

Regards,

Krupali

fcorodriguezl
Contributor
0 Kudos

Hi Naik,

Assume you using NLS, when you execute your load, you need looking for something values to archive more information, i'm right?

Please share what is your ods keys and your routine.

Regards.

0 Kudos

Hi Francisco,

We donot need to archive more information.

While loading online data, lets say from online DSO1 to online Infocube 1, we want to refer to another near-line DSO (say DSO2 - data of this DSO is in NLS - completely)  in transformation end/start routine.

Regards.

0 Kudos

Hi,

Once you archive data in NLS, it will not be in tables, so i am not sure how you are looking up data in routine? it will not be advisable as we archive data only because we don´t need it further.

0 Kudos

Hi Fresher SAP BW,

The advantage of NLS is that you can also view data based in online database as well as Near-line data in a single report.