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: 

concatenate

Former Member
0 Kudos

Hi all,

i need to concatenate the field itab-vbeln with '|' and place in one of the field in itab-text.

My field length of itab-text(250) type c and if this field exceeds vbeln of 250 char it should go to next field of itab-text1(250) type c.

can anyone help me.

regards,

r.singh.

4 REPLIES 4

Former Member
0 Kudos

concatenate itab-vbeln '|' in itab-text.

length = strlen(itab-vebeln).

if length gt 250.

itab-vbeln+250 = itab-text1.

endif.

Former Member
0 Kudos

hey,

CONCATENATE itab-vbeln itab-txt INTO var1 SEPARATED BY '|'.

Regards,

Midhun Abraham

Former Member
0 Kudos

Vbeln is going to be always 10 characters long? (are you going to save it with leading zeros?).

If you want only complete vbeln's, the element is 10 characters long plus the "|" charachter, so you can only fill the text with 22 numbers, so place a counter and every 22 loops append the text.

If you want them not complete like this:


000001|00004|00
003|00005|0006

Then I think I have an algorith somewhere that I can modify and see if it works

Former Member
0 Kudos

Hi

I hope I've understood your issue:

 DATA: LEN_TEXT TYPE I.

LEN_TEXT = STRLEN( ITAB-TEXT ).

IF LEN_TEXT <= 139.
  MOVE VBELN TO ITAB-TEXT+LEN_TEXT(10).
  LEN_TEXT = LEN_TEXT + 10.
  MOVE '|' TO ITAB-TEXT+LEN_TEXT(1).
ELSE.
  MOVE VBELN TO ITAB-TEXT1(10).
  MOVE '|' TO ITAB-TEXT1+10(1). 
ENDIF.

Max