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

is incompatible with

Former Member
0 Likes
1,685

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

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
1,621

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

17 REPLIES 17
Read only

Former Member
0 Likes
1,621

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

Read only

Former Member
0 Likes
1,621

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.

Read only

0 Likes
1,621

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.

Read only

former_member772790
Participant
0 Likes
1,621

Hi,

In the FORM statement, use TYPE TABLE OF instead of TYPE.

Read only

Former Member
0 Likes
1,621

Hi,

u defined lt_attr_data is of table type.

Change type of lt_attr_data to bbp_attr_list.

Regards,

Kusuma.

Read only

Former Member
0 Likes
1,621

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

Read only

Former Member
0 Likes
1,621

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)

Read only

0 Likes
1,621

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

Read only

Former Member
0 Likes
1,621

dear all,

problem is still existing !

Read only

0 Likes
1,621

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.

Read only

Former Member
0 Likes
1,621
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

Read only

ThomasZloch
Active Contributor
0 Likes
1,622

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

Read only

Former Member
0 Likes
1,621

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

Read only

0 Likes
1,621

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

Read only

0 Likes
1,621

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

Read only

0 Likes
1,621

> 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

Read only

0 Likes
1,621

many thanks.

I now definetly how to handle with tables at FORM routines.

Regards

sas