Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BW Start Routine - error

tnecnivo
Active Contributor
0 Kudos
512

Hi ABAP gurus,

Appreciate if anyone can suggest a way on solving this issue.

Currently I am trying to load data into my Internal table for further uses later.

however, the codes below have error occurs.

It displayed error:-

When you use the addition "FOR ALL ENTRIES IN itab", the fields "/BIC/ZSSFPK1" and "LT_DATA-STSMA" must have the same type and the same length.


DATA:

       lt_data TYPE _ty_t_sc_1.

         lt_data[] = source_package[].

     IF lt_data[] IS NOT INITIAL.

       SELECT /bic/zssfpv2

         INTO TABLE it_rs[]

         FROM /bic/azssfomp200

         FOR ALL ENTRIES IN lt_data[]

         WHERE /bic/zssfpk1 = lt_data-stsma

         AND /bic/zssfpk2 = lt_data-estat.

I well aware of the error is due to /BIC/ZSSFPK1 is length 15 and LT_DATA-STSMA is length 8.

but is there a way to make this work without creating a new BW infoObject for staging to make them the same length (8)?

Many thanks.

1 ACCEPTED SOLUTION
Read only

chabbi_mustapha
Explorer
0 Kudos
318

Hello,

No , you don't need to create an infoobjet.

The solution is hereunder.

TYPE:

Define a type for lt_data.

zssfpk1

estat


DATA:

ls_package like line of source_package.

LOOP AT Source_package into ls_package.

ls_data-zssfpk1 = ls_package-stsma.

ls_data-estat   = ls_package-estat.


APPEND ls_data to lt_data.


ENDLOOP

Use lt_table in your selection

Hope that will be useful,

Best Regards,

Mustapha,

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Kudos
318

No need of a new InfoObject,, just define a local internal table of type /bic/zssfpk1 in the routine, fill it in a loop from source_package, and use it in the FOR ALL ENTRIES clause.

Regards,

Raymond

Read only

former_member251664
Participant
0 Kudos
318

In BW Info Object maintenance change length ZSSFPK1,

use ALPHA conversion

or

Transformation rule details in source fields give info object name.

Read only

chabbi_mustapha
Explorer
0 Kudos
319

Hello,

No , you don't need to create an infoobjet.

The solution is hereunder.

TYPE:

Define a type for lt_data.

zssfpk1

estat


DATA:

ls_package like line of source_package.

LOOP AT Source_package into ls_package.

ls_data-zssfpk1 = ls_package-stsma.

ls_data-estat   = ls_package-estat.


APPEND ls_data to lt_data.


ENDLOOP

Use lt_table in your selection

Hope that will be useful,

Best Regards,

Mustapha,