2016 Mar 23 7:31 AM
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.
2016 Mar 23 2:36 PM
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,
In BW Info Object maintenance change length ZSSFPK1,
use ALPHA conversion
or
Transformation rule details in source fields give info object name.
2016 Mar 23 8:08 AM
2016 Mar 23 8:46 AM
In BW Info Object maintenance change length ZSSFPK1,
use ALPHA conversion
or
Transformation rule details in source fields give info object name.
2016 Mar 23 2:36 PM
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,
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |