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: 

Merging of multiple rows in an internal table as a single record

Former Member
0 Kudos
1,201

Hi All,

I have an internal table which has the following columns:

text, date, time, user.

it stores notes in the internal table.

The problem is...when I save a note with multiple lines and spaces it saves each line of the note as a row in the internal table.

Thus i get more no. of rows in the internal table compare to the no. of rows!

I need to store each notes as single row in the internal table.

Please advise how to approach this?

Helpful answers will be rewarded.

Thanks & Regards,

Anshumita.

1 ACCEPTED SOLUTION

kiran_k8
Active Contributor
0 Kudos
86

Anshumita,

I don't think that it is possible to store the whole notes as one record in the internal table.Why don't you try it by giving an internal table of the below structure.

TYPES :BEGIN OF TY_ITAB2,

DATA(400),

END OF TY_ITAB2.

DATA: ITAB3 TYPE TY_ITAB2 OCCURS 0 WITH HEADER LINE

Loop at itab1.

ITAB3-DATA = ITAB1-LABEL.

APPEND ITAB3.

ITAB3-DATA = ITAB1-MATNR.

APPEND ITAB3.

endloop.

I am not sure whether this kind of internal table will help you or not.

K.Kiran.

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos
86

HI Anshumita,

Can you provide an example of the issue you face?

Regards,

RAVi

kiran_k8
Active Contributor
0 Kudos
87

Anshumita,

I don't think that it is possible to store the whole notes as one record in the internal table.Why don't you try it by giving an internal table of the below structure.

TYPES :BEGIN OF TY_ITAB2,

DATA(400),

END OF TY_ITAB2.

DATA: ITAB3 TYPE TY_ITAB2 OCCURS 0 WITH HEADER LINE

Loop at itab1.

ITAB3-DATA = ITAB1-LABEL.

APPEND ITAB3.

ITAB3-DATA = ITAB1-MATNR.

APPEND ITAB3.

endloop.

I am not sure whether this kind of internal table will help you or not.

K.Kiran.

former_member195698
Active Contributor
0 Kudos
86

You can create a deep internal table. You can declare one Column as an internal table and store the NOTES in that Internal table for each row.

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm

you can check the example in the link

regards,

abhishek