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

Concatenate Problem

former_member251546
Participant
0 Likes
869

hi,

thank you for supproting..

Iam reading the sys status for order number.. One order number, we ve got no.of status. i need to keep all status textes in one field..

As well as i need to write the status one which is start with I. so ive kept the condition stat = 'I*'. but its not working. can u plz tell me tht one also..

for this ive wrote the code as below as ..

Ordernumber: Stat " this is from Jest table

R000400008 i008

R000400008 i009

R000400008 i010

R000400008 i011

Stat Spar txt04 " This is from tj02t table " From here i need to Concatenate the all TXT04 INTO one feild for the one ordernumber.. and modify the itab..

i008 E PDV

i009 E DEV "like R00040008 PDV DEV PEN REV "Report should be get like

i010 E PEN

i011 E REV

How to concatenate while looping..?


**Calculation for system status.

 ITAB3[] = ITAB[].
 clear:wa.
 Loop at itab3 into wa.

   Select objnr stat from jest into corresponding fields of table lt_jest where objnr =  wa-objnr AND stat NE 'X'.
*                                                  ( stat <> 'X' AND  stat = 'I*' ).

   Read table lt_jest into wa_jest with key objnr = wa-objnr transporting all fields.

   Select istat TXT04 from tj02t into corresponding fields of table lt_tj02t where istat = wa_jest-stat." and
*                                                                             spras = 'EN'.

     Loop at lt_tj02t into wa_tj02t.

     lv_sttxt1 = wa_tj02t-txt04.

     CONCATENATE lv_sttxt1 ' ' into lv_sttxt SEPARATED BY space.      "Doubt here

     Endloop.
       Read table itab into wa2 with key objnr = wa-objnr.
       Move lv_sttxt To wa2-sttxt."STTXT
        lv_tabix = sy-tabix.
       Modify itab from wa2 index lv_tabix transporting sttxt.


 Endloop.

Regards

8 REPLIES 8
Read only

Former Member
0 Likes
816

Hello


 AND  stat LIKE 'I%' ). " <- instead of stat = 'I*'

Read only

Former Member
0 Likes
816

Hi,

So what output you are getting currently?

Loop at lt_tj02t into wa_tj02t.
 
     lv_sttxt1 = wa_tj02t-txt04.
 
     CONCATENATE lv_sttxt1 ' ' into lv_sttxt SEPARATED BY space.      "Doubt here
 
Endloop.

According to me, you must be getting output as, PDV DEV PEN REV.

Is it correct?

And 1 more doubt is, according to you, you need to Concatenate the all TXT04 INTO one field for the one ordernumber. So, you must have field ordernumber in table lt_tj02t, so that you can concatenate it in a variable and modify itab accordingly.

Thanks,

Archana

Read only

0 Likes
816

Hi,

Thank you for reply.

iam unable to concate all status in one field. just iam getting one status.

Yes ur right. i need to modify my itab also. afer getting the sys status.

Regards

Edited by: balaji kiran on Mar 18, 2010 10:50 AM

Read only

0 Likes
816

Hi,

Loop at lt_tj02t into wa_tj02t.
 
     lv_sttxt1 = wa_tj02t-txt04.
 
     CONCATENATE lv_sttxt1 into lv_sttxt SEPARATED BY space.    

     clear: wa_tj02t, lv_sttxt1.    

Endloop.

Also, check in debugging mode if you are getting values in variable lv_sttxt1.

Thanks,

Archana

Read only

Former Member
0 Likes
816

Do like

Loop at itab3 into wa.

Select objnr stat from jest into corresponding fields of table lt_jest where objnr = wa-objnr AND stat LIKE 'I*'.

CLEAR lt_tj02t .

Select istat TXT04 from tj02t into corresponding fields of table lt_tj02t for all entries in lt_jest where istat = lt_jest -stat.

CONCATENATE wa-objnr ' 'INTO lv_sttxt1 separated by space.

Loop at lt_tj02t into wa_tj02t.

CONCATENATE lv_sttxt1 wa_tj02t-txt04 into lv_sttxt SEPARATED BY space.

Endloop.

Move lv_sttxt To wa-sttxt.

Modify TABLE itab from wa.

Endloop.

Edited by: Sachin Bidkar on Mar 18, 2010 11:07 AM

Read only

0 Likes
816

This message was moderated.

Read only

0 Likes
816

This message was moderated.

Read only

0 Likes
816

This message was moderated.