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

Two parameters in one field?

Former Member
0 Likes
1,239

Is there a way to concatenate two paramter values into one field. My test data file has First name and Last name as separate fields but I want to put them both in one field in SAP. I am using the standard eCATT, not the SAPGUI. Thanks all.

<removed_by_moderator>

Edited by: Julius Bussche on Sep 7, 2009 2:39 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
927

Hi,

Of course you can.

You can do it in ECATT script.

1. Define two parametrs(v_FIRST:first name, V_LAST:last name) as V (varible) in ECATT script.

2. Carry over first name and last name from import parametr to varible parameter:

V_FIRST = IV_FIRST.

V_LAST = IV_LAST.

  • IV_LAST, IV_FIRST defined as I (import) parameter

3. Concatenate V_FIRST and V_LAST in inner abap code in ecatt script:

ABAP.

  • Define Full Name

LV_FULL_NAME = ''.

CONCATENATE V_FIRST V_LAST

INTO LV_FULL_NAME SEPARATED BY ' '.

ENDABAP.

4. Use LV_FULL_NAME as parameter in TCD (transaction record).

Then it will work.

Regards,

Chen Jian

5 REPLIES 5
Read only

Former Member
0 Likes
927

As mentioned by you, since both First name and last name are two different fields, it require two different parameters. Two fields in SAP cannot be concatenated, however the values can be concatenated.

Read only

Former Member
0 Likes
928

Hi,

Of course you can.

You can do it in ECATT script.

1. Define two parametrs(v_FIRST:first name, V_LAST:last name) as V (varible) in ECATT script.

2. Carry over first name and last name from import parametr to varible parameter:

V_FIRST = IV_FIRST.

V_LAST = IV_LAST.

  • IV_LAST, IV_FIRST defined as I (import) parameter

3. Concatenate V_FIRST and V_LAST in inner abap code in ecatt script:

ABAP.

  • Define Full Name

LV_FULL_NAME = ''.

CONCATENATE V_FIRST V_LAST

INTO LV_FULL_NAME SEPARATED BY ' '.

ENDABAP.

4. Use LV_FULL_NAME as parameter in TCD (transaction record).

Then it will work.

Regards,

Chen Jian

Read only

0 Likes
927

Just to add to what Jian Chen has said below ...

1) We need to create two parameters of type 'V' as parameters of type 'I/E' cannot be used inside ABAP block.

2) Ensure that the parameter - LV_FULL_NAME is set ( 'S' ) to the required field in the TCD recording.

Read only

Former Member
0 Likes
927

Hello,

I guess you can concatenate using the concatenate operator aswell.

V_VAL1 , V_VAL2, V_VAL3

V_VAL3 = V_VAL1 & V_VAL2.

But make sure the length of V_VAL3 is greater than both V_VAL2 & V_VAL2. Also data type is same for all the three variables.

Thanks & Best regards,

Ajay

Read only

Former Member
0 Likes
927

Thank you gentlemen, I got two excellent solutions. I'm a newby to eCATT and not an ABAP'er at all - just a lowly Basis guy - so both methods were very helpful.

I still need to handle the names that are longer than then the screen field so it just drops the remainder instead of crashing the script. For now I'll just truncate the test data in my spreadsheet but if you guys are feeling generous...

Thanks all.

David