on 12-21-2009 2:00 PM
Good day
I am not an ABAP'er, but I am trying to successfully write an ABAP routine where I want to change the lowercases to UPPER and split the description field (100) into two fields, one with (6) and the second to +60(40).
Routine1 on the first description is as follows:
"
RESULT = SOURCE_FIELDS-meta_package_des(60).
"
Routine2 on the second description is as follows:
"
RESULT = SOURCE_FIELDS-meta_package_des+60(40).
"
If I do only the above, the routine has no syntax error and the data will be split successfully from (100) to (60) and (40).
Now...I want to change (translate) the descriptions to UPPER as well, as I am receiving it from the source in lower cases.
How do I incorporate theTOUPPER formula and routine into 1 routine.
Seems as if you cannot use a formulae and a routine on a field in transformations.
I have done the following routine on description field 1:
" DATA meta_package_des TYPE string.
TRANSLATE meta_package_des TO UPPER CASE.
RESULT = SOURCE_FIELDS-meta_package_des(60)."
There are no syntax errors but DTP will not be successful.
Please assist
Thanks in advance>
Cj
Cornelius, you are correct that you cannot perform both a formula and a routine on the same infoobject in a transformation, but this is no problem since you can do anything within a routine.
The code shown in the previous post should work fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Instead - do it like this...
Routine1 on the first description is as follows:
"
RESULT = SOURCE_FIELDS-meta_package_des(60).
translate RESULT to UPPER CASE.
"
Routine2 on the second description is as follows:
"
RESULT = SOURCE_FIELDS-meta_package_des+60(40).
TRANSLATE RESULT to UPPER CASE.
the correct syntax for your previous code would be :
TRANSLATE SOURCE_FIELDS-meta_package_des TO UPPER CASE.
RESULT = SOURCE_FIELDS-meta_package_des(60)."
Edited by: Arun Varadarajan on Dec 21, 2009 10:17 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks to you both...
unfortunately I am getting the following error:
"E:The field "SOURCE_FIELDS-META_PACKAGE_DES" cannot be changed. -"
This is my latest code
"
TRANSLATE source_fields-meta_package_des TO UPPER CASE.
result = source_fields-meta_package_des(60).
"
This is more info on this routine
METHOD compute_ZSMETDES1.
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS-META_PACKAGE_DES TYPE C LENGTH 000100
EXPORTING
RESULT type tys_TG_1-/BIC/ZSMETDES1
DATA:
MONITOR_REC TYPE rsmonitor.
Please help again?
Thanks in advance
Cj
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.