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

ABAP help - create var type table

Former Member
0 Likes
1,160

dear all,

can you help me solve the below abap coding problem? thanks.

somewhere at the top


DATA: L_S_RANGE LIKE LINE OF E_T_RANGE.
DATA: L_S_VAR_RANGE LIKE E_T_RANGE.


      LOOP AT I_T_VAR_RANGE INTO L_S_VAR_RANGE.

        FIND l_s_var_range-vnam IN TABLE it_vnam.

        IF sy-subrc = 0.
          l_check = 'X'.
          EXIT.
        ENDIF.

      ENDLOOP.

Error message...

"L_S_VAR_RANGE" cannot be converted to the line type of "I_T_VAR_RANGE".

Thanks all.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
930

Hi SCHT,

Try below way...

Tell us what is E_T_RANGE is it internal table ?? or anything else.

At which statment exactly you are getting error ?

Assign l_s_var_range-vnam to char type variable.

DATA: L_S_RANGE LIKE LINE OF E_T_RANGE.
DATA: L_S_VAR_RANGE LIKE E_T_RANGE.

DATA: L_CHAR(10) TYPE C. " I am assuming lenght of vnam is 10 change it as per your need


      LOOP AT I_T_VAR_RANGE INTO L_S_VAR_RANGE.
L_CHAR =  l_s_var_range-vnam.
        FIND  L_CHAR IN TABLE it_vnam.
 
        IF sy-subrc = 0.
          l_check = 'X'.
          EXIT.
        ENDIF.
 CLEAR L_CHAR.
      ENDLOOP.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

8 REPLIES 8
Read only

former_member156446
Active Contributor
0 Likes
930

types: L_S_VAR_RANGE type E_T_RANGE.

Read only

0 Likes
930

J,

after changing that i got a new error

Type "E_T_RANGE" is unknown

any advice?

Read only

0 Likes
930

Hi,

try this

DATA: L_S_VAR_RANGE type E_T_RANGE.

Or try using the field symbols..

Field-symbols: L_S_VAR_RANGE TYPE ANY.

Regards,

Aditya

Read only

former_member217544
Active Contributor
0 Likes
930

Hi SCHT,

Can you show how E_T_RANGE, I_T_VAR_RANGE are defined?

Regards,

Swarna Munukoti

Read only

Former Member
0 Likes
931

Hi SCHT,

Try below way...

Tell us what is E_T_RANGE is it internal table ?? or anything else.

At which statment exactly you are getting error ?

Assign l_s_var_range-vnam to char type variable.

DATA: L_S_RANGE LIKE LINE OF E_T_RANGE.
DATA: L_S_VAR_RANGE LIKE E_T_RANGE.

DATA: L_CHAR(10) TYPE C. " I am assuming lenght of vnam is 10 change it as per your need


      LOOP AT I_T_VAR_RANGE INTO L_S_VAR_RANGE.
L_CHAR =  l_s_var_range-vnam.
        FIND  L_CHAR IN TABLE it_vnam.
 
        IF sy-subrc = 0.
          l_check = 'X'.
          EXIT.
        ENDIF.
 CLEAR L_CHAR.
      ENDLOOP.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

Read only

0 Likes
930

hiye,

this ABAP is in BI and my error is at L_S_VAR_RANGE.

E_T_RANGE is of type EXPORTING ans association type of RSR_T_RANGESID.

hope this helps.


      LOOP AT I_T_VAR_RANGE INTO L_S_VAR_RANGE. *<-- error msg stops here.*
 
        FIND l_s_var_range-vnam IN TABLE it_vnam.
 
        IF sy-subrc = 0.
          l_check = 'X'.
          EXIT.
        ENDIF.
 
      ENDLOOP.

Read only

0 Likes
930

Hi SCHT,

One more small information required,

What is the data type of table I_T_VAR_RANGE ?

Regards,

Swarna Munukoti

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
930

Hello,

You have defined the work area incorrectly :

DATA: L_S_VAR_RANGE LIKE E_T_RANGE.

It should be :

DATA: L_S_VAR_RANGE LIKE LINE OF E_T_RANGE.

Change this & check.

BR,

Suhas