Application Development 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: 

how to remove the following error

Former Member
0 Kudos

Hi everyone,

I did Extended program Check (including Obsolete statements check) for the below codes.

FORM F_OUTPUT_LOG TABLES L_XXX STRUCTURE ZXXX

USING VALUE(LPXXX) TYPE CHAR

CHANGING LPXXXXX.

But the following error message will appears.

The current ABAP command is obsolete and problematic, especially so in ABAP

Objects

Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary

types, not "LIKE" or "STRUCTURE".

Could you give me some ideas to remove this error? Any suggestion is appreciated.

Best regards,

Julian

4 REPLIES 4

Former Member
0 Kudos

HI,

Better give TYPE ANY, do not specify any particular reference.

Regards

Subramanian

Former Member
0 Kudos

Try using this:

FORM F_OUTPUT_LOG TABLES L_XXX <b>TYPE</b> ZXXX

USING VALUE(LPXXX) TYPE CHAR

CHANGING LPXXXXX.

Thanks,

Santosh

Former Member
0 Kudos

Julian,

In the newer versions of SAP for object oriented programming we declare objects using TYPE statements.

Obsolete:

DATA: V_MATNR LIKE MATNR.

DATA: V_TABLETYPE LIKE BSEG_T.

To be used.

DATA: V_MATNR TYPE MATNR.

DATA: V_TABLETYPE TYPE BSEG_T.

For declaring structures we need to use below code:

  • LVC_T_FCAT is a table type

  • LVC_S_FCAT is a structure

DATA: i_fcat1 TYPE lvc_t_fcat.

DATA: i_fcat2 TYPE TABLE OF lvc_s_fcat.

  • Here W_FCAT1 and W_FCAT2 are same but the way they are declared are

  • different. If you are referring to a TABLE TYPE you can use TYPE LINE OF

  • method or you can directly say TYPE referring to that structure (lvc_s_fcat).

DATA: w_fcat1 TYPE lvc_s_fcat.

DATA: w_fcat2 TYPE LINE OF lvc_t_fcat.

Thanks

Former Member
0 Kudos

Julian,

In your program whereever you are using the LIKE statement

use TYPE statement to declare the fields or Structures.