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

getting itab data

Former Member
0 Likes
593

Hi experts

I have two itabs(t_long & stext) and both are <b>having same structure.</b>I have <b>t_long</b> data like this.


QMNUM        LTEXT
000200000140|Engg Data Management 
000200000140|Product Development 
000200000140|Quality Management 
000200000141|Product Development 
000200000141|Engg Data Management
000200000141|Quality Management 

and <b>stext</b> data like this


QMNUM          LTEXT
<b>000200000140
000200000140
000200000140
000200000140
000200000140</b>
000200000141
000200000141
000200000141

Now i want <b>stext</b> data like this.


QMNUM        LTEXT
000200000140|Engg Data Management 
000200000140|Product Development 
000200000140|Quality Management 
000200000140
000200000140
000200000141|Product Development
000200000141|Engg Data Management
000200000141|Quality Management 

how can i do this.

reward guaranteed

thanks

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
570
SORT t_long BY qmnum.
LOOP AT stext.
 READ TABLE t_long WITH KEY qmnum = stext-qmnum
   BINARY SEARCH.
 IF sy-subrc EQ 0.
   stext-ltext = t_long-ltext.
   MODIFY stext TRANSPORTING ltext.
   DELETE t_long.
 ENDIF.
ENDLOOP.
4 REPLIES 4
Read only

Former Member
0 Likes
571
SORT t_long BY qmnum.
LOOP AT stext.
 READ TABLE t_long WITH KEY qmnum = stext-qmnum
   BINARY SEARCH.
 IF sy-subrc EQ 0.
   stext-ltext = t_long-ltext.
   MODIFY stext TRANSPORTING ltext.
   DELETE t_long.
 ENDIF.
ENDLOOP.
Read only

0 Likes
570

try this..


LOOP AT T_long.
 read table stext with key qmnum = t_long-qmnum
                           ltext = space.
   if sy-subrc eq 0.
   stext-ltext = t_long-ltext.
   MODIFY stext.
 endif.
ENDLOOP.

Regards,

Suresh Datti

Read only

0 Likes
570

Hi Wenceslaus G

thanks a lot.

full points alloted.

kaki

Read only

former_member186741
Active Contributor
0 Likes
570

LOOP AT t_LONG.

READ TABLE STEXT WITH KEY QMNUM = T_LONG-QMNUM

AND LTEXT = '' BINARY SEARCH.

IF SY-SUBRC = 0.

STEXT = T_LONG.

MODIFY TABLE STEXT INDEX SY-TABIX.

ENDIF.

ENDLOOP.