cancel
Showing results for 
Search instead for 
Did you mean: 

SAP SLT Copy one column to another Substringed

0 Kudos

Hola,

I'm trying to copy a column to another new, but, with a Substring to get this transformation result in the Target System using LTRS t-code with SP15 notes.
Lets say for this case we have the table TABLE1 and column COLUMN_ID
I added TABLE1 into LTRS/"Table Settings", under "Table Structure" tab
and created the new column called COLUMN_ID_SUBSTRING with exactly the same definitoin (Data Type, Lenght, etc) than the original.


After this I want to copy the data from COLUMN_ID to COLUMN_ID_SUBSTRING,
I'm not sure but I'm using "Mapping Values" tab like this:



After the Mapping I want to apply the Substring Rule, added into "Rule Assgnment".
I'm aware that with SLT we can stablish a Rule with some ABAP Code Lines, so I'm trying to use one function that I found for the substring work and it should be something like this:

E_COLUMN_ID_SUBSTRING = E_COLUMN_ID_SUBSTRING+23(18).
To try to Start the function at Char #23 then leave other 18 chars.


I thought I was gonna work good but when I started the replication in LTRC T-code I got this error:

@5C@sql syntax error: incorrect syntax near"COLUMN_ID_SUBSTRING": line 210 col 18 (at pos 4963)@35@ @5C@Creation of table /TABLE1 failed.@35@


Could someone support this error or provide some suggestions for it?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Andrey_M
Advisor
Advisor
0 Kudos

use have wrongly interpret the option "Mapping Values". This option is used to change the Db field type in target table. In your case you have nothing to do here (just delete the entry that you have created before). After that, I guess, the table in target will be created successfully.

And as you have correctly noticed, the option "Rule Assigment" is exactly that you have to maintain.

0 Kudos

You're right!

Then, in this case, the only challenge is try to do the substring after duplicate the column into the new one, the limited options that I have on mind are E_COLUMN_ID_SUBSTRING = E_COLUMN_ID_SUBSTRING+23(18). but in this case, how does SLT know that the new column COLUMN_ID_SUBSTRING will be equal to the old applying substing?
I thought to use something like this E_COLUMN_ID_SUBSTRING = E_COLUMN_ID+23(18).
Other thing is try to send the COLUMN_ID in one of the Import Parameters but I'm not sure how does it work.

Does anyone here has some Documentation about all the Rule Assignment settings for SLT SP15?

Andrey_M
Advisor
Advisor

As documentation I would like to suggest you the standard help for LTRS transaction. On the left panel you will find the button "i", and then in opened help click on chapter "Rule Assignment" where you can find a some examples how to write a rule.
I rule you can specify input parameters as well, so your "copy" expression should look like:

E_COLUMN_ID_SUBSTRING = I_COLUMN_ID+23(18).

Answers (1)

Answers (1)

0 Kudos

Well... I've been trying in different ways without success, I'm wondering now if is it even possible to copy one column to other? Trough SLT Rule Assignment. I've been trying with this:

Import Parameter: COLUMN_ID
Line of Code: E_COLUMN_ID_SUBSTRING = I_COLUMN_ID_1.

It failed on my test, but is there an option to do this like the way I'm trying, or do I need to use the "Include Name" to get work done?

ThomasBailleul
Advisor
Advisor
0 Kudos

Hello Nahum,

did you check this note : https://launchpad.support.sap.com/#/notes/2618277

alternatively, you could inject a view between (at a structure level) and change the name of the column