on 09-11-2014 3:43 PM
Hello,
I would like to enhance 0EQUIPMENT_ATTR. Standard Master Data Source BWE_EQUI is appended with the field GROES. The data for this field is filled from EQUI - GROES. I tried to do exactly the same as in tutorial:
When I enhance 0PROFIT_CTR_ATTR, as in tutorial, it is working correctly. Unfortunately, in case of 0EQUIPMENT_ATTR, I can't activate my method.
The error is: "EQUI_GROES" is not defined in the ABAP Dictionary as a table, projection view, or database view.
The code looks similar to the one from the tutorial. What should I do to make EQUI table visible and activate my method?
Thank you in advance for any help!
The code:
method IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM.
CHECK i_datasource = '0EQUIPMENT_ATTR'.
DATA: lt_data TYPE TABLE OF BWE_EQUI.
FIELD-SYMBOLS: <ls_data> TYPE BWE_EQUI.
*----------------------------------------------------------------*
* Internal table for EQUI_GROES
*----------------------------------------------------------------*
TYPES:
BEGIN OF ty_equimpent,
EQUNR TYPE BWE_EQUI-EQUNR,
GROES TYPE BWE_EQUI-GROES,
END OF ty_equimpent.
DATA:
lt_equimpent type standard table of ty_equimpent,
ls_equimpent type ty_equimpent.
lt_data[] = c_t_data[].
*----------------------------------------------------------------*
* Read data into internal memory
*----------------------------------------------------------------*
select EQUNR
GROES
from equi_groes
into table lt_equimpent
for all entries in lt_data
where EQUNR eq lt_data-EQUNR.
LOOP AT lt_data ASSIGNING <ls_data>.
read table lt_equimpent into ls_equimpent
with key EQUNR = <ls_data>-EQUNR.
if sy-subrc eq 0.
<ls_data>-GROES = ls_equimpent-GROES.
MODIFY lt_data FROM <ls_data>.
endif.
ENDLOOP.
REFRESH c_t_data.
c_t_data[] = lt_data[].
endmethod.
Hi,
In select statement u have mention the table name.
No need to use modify statement, if you are using field-symbol.
select EQUNR
GROES
from BWE_EQUI
into table lt_equimpent
for all entries in lt_data
where EQUNR eq lt_data-EQUNR.
Thanks,
Somesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Than you guys! I just changed EQUI_GROES to EQUI and now it is working. Big thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mateuz,
looking to the code you listed issue is caused because table EQUI_GROES is not available in your system.
As how to document you are referring to says it applies to: "SAP_BASIS 6.20 and PI_BASIS 2004_1"... I'd say that you maybe running system on lower version of these components?
cheers
m./
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mateusz,
Please apply following code then you shold be good:
----------------
IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM.
CHECK i_datasource = '0EQUIPMENT_ATTR'.
DATA: lt_data TYPE TABLE OF BWE_EQUI.
FIELD-SYMBOLS: <ls_data> TYPE BWE_EQUI.
*----------------------------------------------------------------*
* Internal table for EQUI_GROES
TYPES:
BEGIN OF ty_equimpent,
EQUNR TYPE EQUI-EQUNR, ""AMIT""
GROES TYPE EQUI-GROES, ""AMIT""
END OF ty_equimpent.
DATA:
lt_equimpent type standard table of ty_equimpent,
ls_equimpent type ty_equimpent.
lt_data[] = c_t_data[].
* Read data into internal memory
select EQUNR
GROES
from equi ""AMIT""
into table lt_equimpent
for all entries in lt_data
where EQUNR eq lt_data-EQUNR.
LOOP AT lt_data ASSIGNING <ls_data>.
read table lt_equimpent into ls_equimpent
with key EQUNR = <ls_data>-EQUNR.
if sy-subrc eq 0.
<ls_data>-GROES = ls_equimpent-GROES.
* MODIFY lt_data FROM <ls_data>. ""AMIT"" Comment this statement
endif.
ENDLOOP.
REFRESH c_t_data.
c_t_data[] = lt_data[].
endmethod.
--------------
All the ""AMIT"" changes you need to do in your code.
Thanks
Amit
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.