‎2008 Nov 26 9:56 AM
Hi friends,
I am getting the error message:
In PERFORM or CALL FUNCTION "GETATTRIBUTES",
the actual parameter "LT_ATTR_DAT"
is incompatible with
the formal parameter "P_LT_ATTR_DATA".
Please advice what is wrong right here.
Thanks in advance
Sas
DATA: lt_attr_dat TYPE TABLE OF bbpt_attr.
PERFORM getattributes
TABLES
lt_attr_dat
USING
sy-uname.
FORM getAttributes
TABLES lt_attr_data type bbpt_attr
USING lv_user TYPE sy-uname.
TYPES: BEGIN OF lty_user_attr,
attr_id TYPE om_attrib,
value_logsys TYPE log_system,
value TYPE char30,
END OF lty_user_attr.
DATA: lt_user_attr TYPE TABLE OF lty_user_attr.
DATA: lt_attr_list TYPE bbpt_attr_list.
DATA: lt_vlist TYPE bbpt_attr_values.
DATA: ls_attr_list TYPE bbp_attr_list.
DATA: ls_attr_data TYPE bbps_attr.
DATA: ls_user_attr TYPE lty_user_attr.
DATA: ls_vlist TYPE bbps_attr_values.
DATA: ls_t77omattr TYPE t77omattr.
lv_user = sy-uname.
ls_attr_list-attr_id = 'WRK'.
APPEND ls_attr_list TO lt_attr_list.
* Read Attributes
CALL FUNCTION 'BBP_READ_ATTRIBUTES'
EXPORTING
iv_user = lv_user
it_attr_list = lt_attr_list
IMPORTING
et_attr = lt_attr_data
EXCEPTIONS
object_id_not_found = 1
no_attributes_requested = 2
attributes_read_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
endform. " getAttributes
‎2008 Nov 26 11:50 AM
DATA: lt_attr_dat TYPE bbpt_attr.
PERFORM getattributes
USING
sy-uname
CHANGING
lt_attr_dat.
FORM getAttributes
USING lv_user TYPE sy-uname
CHANGING lt_attr_data type bbpt_attr.
assuming that bbpt_attr is a table type.
Thomas
‎2008 Nov 26 10:01 AM
Hi
Error is in ur declarartion
FORM getAttributes
TABLES lt_attr_data type TABLE OF bbpt_attr
USING lv_user TYPE sy-uname.
u hav declared ur table as a structure. thats y.
Revert if ny issues.
Regards
Winnie
‎2008 Nov 26 10:02 AM
Hi ,
try like this
PERFORM getattributes
TABLES
lt_attr_dat
USING
lv_user.
FORM getAttributes
TABLES lt_attr_data
USING lv_user TYPE sy-uname.
also while defining
DATA: ls_attr_data TYPE bbps_attr.
bbps_attr is a structure then define it with syntax 'type table of'
hope this will work.
Regards,
Rohan.
‎2008 Nov 26 10:15 AM
Hi,
have u Used this syntax,
Hi ,
try like this
PERFORM getattributes
TABLES
lt_attr_dat
USING
lv_user.
FORM getAttributes
TABLES lt_attr_data
USING lv_user TYPE sy-uname.
also while defining
DATA: ls_attr_data TYPE bbps_attr.
bbps_attr is a structure then define it with syntax 'type table of'
hope this will work.
Regards,
Rohan.
‎2008 Nov 26 10:03 AM
Hi,
In the FORM statement, use TYPE TABLE OF instead of TYPE.
‎2008 Nov 26 10:04 AM
Hi,
u defined lt_attr_data is of table type.
Change type of lt_attr_data to bbp_attr_list.
Regards,
Kusuma.
‎2008 Nov 26 10:09 AM
Hi,
I didn't find the function module in ECC 6.0. pls let me know you are using any IS SAP.
and in FORM you have used the tables in that pls change like this
FORM getAttributes
TABLES lt_attr_data type table of bbpt_attr
USING lv_user TYPE sy-uname.
Regards
Rajesh V
‎2008 Nov 26 10:12 AM
I have changed it to
FORM getAttributes
TABLES lt_attr_data type table of bbpt_attr
USING lv_user TYPE sy-uname.
now I am getting
Different number of parameters in FORM and PERFORM (routine: GETAT
number of formal parameters: 4, number of actual parameters: 2)
‎2008 Nov 26 10:30 AM
Hi,
In ur FORM stmt with TABLES you can give TYPE type of table types only, not a structure.
If you have no table types, just ommit the type table of stmt. It should work.
FORM getAttributes
TABLES lt_attr_data
USING lv_user TYPE sy-uname..
Regards
Winnie
‎2008 Nov 26 11:34 AM
‎2008 Nov 26 11:43 AM
Hi,
Your code logic flow is same as u copied....i mean to say that
first perform stmt then form stmt and then the declarations.....
Plz let me know.
Regards,
Rohan.
‎2008 Nov 26 11:40 AM
PERFORM getattributes
TABLES
lt_attr_dat[]
USING
sy-uname.FORM getAttributes
TABLES lt_attr_data STRUCTURE bbpt_attr
USING lv_user TYPE sy-uname.Note : STRUCTURE Is obselete, hence you may define it as
types: tab_type type table of bbpt_attr.FORM getAttributes
TABLES lt_attr_data type tab_type
USING lv_user TYPE sy-uname.Regards,
Mohaiyuddin
Edited by: Mohaiyuddin Soniwala on Nov 26, 2008 5:10 PM
Edited by: Mohaiyuddin Soniwala on Nov 26, 2008 5:12 PM
‎2008 Nov 26 11:50 AM
DATA: lt_attr_dat TYPE bbpt_attr.
PERFORM getattributes
USING
sy-uname
CHANGING
lt_attr_dat.
FORM getAttributes
USING lv_user TYPE sy-uname
CHANGING lt_attr_data type bbpt_attr.
assuming that bbpt_attr is a table type.
Thomas
‎2008 Nov 26 12:30 PM
Thomas you are the best.
Thats also the reason why you have 3310 Points up to now.
And your new number of points is 3320
regards
sas
‎2008 Nov 26 1:55 PM
Thank you. Let me add that you should not use TABLES-parameters in forms anyway, since they are considered obsolete by SAP due to the internal table with header line that they represent. Better use USING or CHANGING parameters referencing table types, as seen here.
Thomas
‎2008 Nov 26 8:59 PM
Ok. Thank you very much again.
Thomas, I have one more question.
What is about tables at Form Routines if they don't refer to "table types".
Or if there is no "table type" table existing for the affected table which I want to use
at the form routine?
Thomas
Erdem Sas
‎2008 Nov 26 9:20 PM
> What is about tables at Form Routines if they don't refer to "table types".
I don't think there is an alternative to table types if the TABLES parameter is not to be used, because you cannot use ... TYPE TABLE OF ... in the declaration of the FORM-parameters, as you have found out.
> Or if there is no "table type" table existing for the affected table which I want to use
> at the form routine?
You can always declare your own one in the data dictionary or in the program, for example:
TYPES: BEGIN OF ty_struc,
field1 LIKE ...
field2 LIKE ...
END OF ty_struc.
TYPES: ty_table TYPE TABLE OF ty_struc.
Now you can use ty_table to pass internal table data to FORM-routines.
Thomas
‎2008 Nov 26 10:07 PM
many thanks.
I now definetly how to handle with tables at FORM routines.
Regards
sas