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

inline declaration

Former Member
0 Likes
902

How do I add a non table field like char or string variables in internal table using inline declaration?

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
688

You should at least tell us what you have learnt by yourself, or any clue, for that homework/interview question?

Read only

bpawanchand
Active Contributor
688

Hi,

Check below

TYPES: BEGIN OF ltyp_sample,
         id      TYPE i,
         name    TYPE c LENGTH 50,
         address TYPE string,
       END OF ltyp_sample.

DATA :
  lt_sample TYPE TABLE OF ltyp_sample,
  ls_sample TYPE ltyp_sample.


lt_sample = VALUE #(
                      ( id = 1
                        name = 'Sample'
                        address = 'sample Address'
                      )


                      ( id = 2
                        name = 'Sample2'
                        address = 'sample Address2'
                      ) ).

Regards

Pavan