2009 Sep 04 10:10 PM
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
2009 Sep 07 2:49 AM
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
2009 Sep 05 7:22 AM
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.
2009 Sep 07 2:49 AM
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
2009 Sep 07 12:42 PM
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.
2009 Sep 08 5:40 AM
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
2009 Sep 08 7:28 PM
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