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

Concatenation output

Former Member
0 Likes
1,116

Hi, I am creating a CDS view. I am concatenating two fields from a table "LFA1"

The fields are:

lifnr(supplier id)[TYPE: CHAR : LENGTH:10]

&

name1(supplier name)[TYPE: CHAR : LENGTH:35]

So when I concatenate like:

Concat(Concat(Concat(Vendor.name1 , '('),Vendor.lifnr),')') as MySupplier

I get something like:

Geller(0000100791)

These "0000" are appended. I guess its done to match length of lifnr .

But I don't want it to display like this. I want it to appear as-

Geller(100791)

Is there any workaround?

Thanks.

1 ACCEPTED SOLUTION
Read only

christian_seitel
Product and Topic Expert
Product and Topic Expert
0 Likes
947

Hi,

is the function LTRIM available in your system ?


LTRIM( Vendor.lifnr, '0' ) is what you are looking for.


Regards, Christian

4 REPLIES 4
Read only

christian_seitel
Product and Topic Expert
Product and Topic Expert
0 Likes
948

Hi,

is the function LTRIM available in your system ?


LTRIM( Vendor.lifnr, '0' ) is what you are looking for.


Regards, Christian

Read only

0 Likes
947

Additional Info:

The string function LTRIM is available as of AS ABAP 7.5:

http://help.sap.com/abapdocu_750/en/index.htm?file=abennews-750-abap_cds.htm  --> Expressions and Functions

Read only

0 Likes
947

Thanks a lot Carine, Very useful document.

Read only

0 Likes
947

Thanks a lot Christian, It worked