on 03-26-2015 9:02 AM
Hi experts
There is a transformation from DSO_1 to DSO_2.
DSO_1 has an InfoObject CO_ITEMTX which contains text information for CO items, e.g.:
*DBD_G004 7026592.00 ABC-DE
DSO_2 needs the last char after the last space of this text information, in our example: ABC-DE.
The length of the last char can vary, e.g.:
*ABD_G004 7026552.00 ABCX-DDE
What is the correct coding?
Thanks
Hi Thomas,
you can split the text at space character using the SPLIT statement.
SPLIT <result_fields>-CO_ITEMTX AT SPACE INTO dummy1 dummy2 var_field.
The var_field contains the value you're looking for. This works if you know the text has three section and the information you need is in the last section.
Regards,
Gabriele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
problem solved, thanks.
SELECT * FROM /BI0/SCFM_FLO_TP
INTO table lt_POSTXT_1.
SELECT * FROM /BI0/SCFM_SEC_ID
INTO table lt_POSTXT_2.
SELECT * FROM /BI0/SCFM_SEC_AC
INTO table lt_POSTXT_3.
IF RESULT_PACKAGE[] IS NOT INITIAL.
ICOUNT = 1.
REFRESH ITAB.
SELECT * FROM /BIC/SCO_ITEMTX INTO TABLE ITAB
FOR ALL ENTRIES IN RESULT_PACKAGE WHERE
/BIC/CO_ITEMTX EQ RESULT_PACKAGE-/BIC/CO_ITEMTX.
SORT ITAB BY /BIC/CO_ITEMTX.
REFRESH ITAB_TARGET.
SORT RESULT_PACKAGE BY /BIC/CO_ITEMTX.
LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
LOOP AT ITAB INTO WA
WHERE /BIC/CO_ITEMTX = <RESULT_FIELDS>-/BIC/CO_ITEMTX.
IF SY-SUBRC = 0.
SPLIT <RESULT_FIELDS>-/BIC/CO_ITEMTX at SPACE into
V_POSTXT_1
V_POSTXT_2 V_POSTXT_3.
******************************************************
* check for existency of entry in table *
******************************************************
read table lt_postxt_1 into l_postxt_1 with key CFM_FLO_TP =
V_POSTXT_1+1.
if sy-subrc = 0.
<RESULT_FIELDS>-CFM_FLO_TP = V_POSTXT_1+1.
read table lt_postxt_2 into l_postxt_2 with key CFM_SEC_ID
=
V_POSTXT_2.
if sy-subrc = 0.
<RESULT_FIELDS>-CFM_SEC_ID = V_POSTXT_2.
read table lt_postxt_3 into l_postxt_3 with key
CFM_SEC_AC =
V_POSTXT_3.
if sy-subrc = 0.
<RESULT_FIELDS>-CFM_SEC_AC = V_POSTXT_3.
APPEND <RESULT_FIELDS> TO ITAB_TARGET.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
SORT ITAB_TARGET BY /BIC/CO_ITEMTX.
REFRESH RESULT_PACKAGE.
RESULT_PACKAGE[] = ITAB_TARGET[].
ENDIF.
I guess you need to use "split"... check the Help on it to understand how this can help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.