Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need UDF to concat 4 inputs of variable length

Hi Experts,

I have a requirement where i need to concat 4 fields as an input to get the desired reuslt.

Input1- fix length

Input2 - fix length

Input3- Variable length

Input4- Variable length.

I want the desired output of input3 to be of length 10 and and of input4 to be of length 18.

If the length is less than the desired output it should add spaces in the end.

For eg;

Input1-3300

Input2-01

Input3-JPOW

Input4-SEMISOFT COAL

Than utput need to be 330001JPOW      SEMISOFT COAL   

Can you please suggest how to achieve this?

Former Member
replied

Hi Chandrabhan

Check out the last UDF listed in the following article on padding trailing spaces.

UDF Basic Building Block

For concatenation of the 4 values, you can just use the + operator.

Rgds

Eng Swee

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question