on 12-01-2011 11:48 AM
Hi
Can you please give me the update rules code that would do the following in BW 3.5:
If Profit Center is 10 digits long, its ok but if Profit Center is 5 digits long, concatenate with 5 zeros.
Thanks
Jimi
Edited by: jimi ogun on Dec 1, 2011 1:44 PM
Hi Jimi,
Instead of doing manual conversion I think it's better if you use FM based conversion.
CONVERSION_EXIT_ALPHA_INPUT
Simply pass your input and get the output in required format.
Regards,
Durgesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jimi,
you can try the following logic.
data : len type i,
v1(10) TYPE c value 'abcde'.
len = strlen( v1 ).
if len = 5.
CONCATENATE v1 '00000' into v1.
endif.
the above code will check the length of the variable (in this case profit center).
If length is 5 concatenate '00000'.
hope this resolves your issue.
cheers:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Soorej
I tried teh code in my transfer rules but the result was blank. I guess it was because i didnt insert anything in the RESULT line... This is what i tried to do but i get a syntax error:
$$ begin of routine - insert your code only below this line -
DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
data : len type i,
v1(10) TYPE c value 'abcde'.
len = strlen( v1 ).
if len = 5.
CONCATENATE v1 '00000' into v1.
endif.
RESULT = /BI0/OIPROFIT_CTR.
returncode <> 0 means skip this record
RETURNCODE = 0.
abort <> 0 means skip whole data package !!!
ABORT = 0.
The syntax error i get is below:
E:Field "/BI0/OIPROFIT_CTR" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. "DATA" statement.
Hi Jimi,
This piece of would solve your problem for the trailing zeroes (note the source field name might be different but this is an example):
DATA: lv_len TYPE i.
CONSTANTS: lc_0(10) TYPE c VALUE '00000000000'.
lv_len = strlen( source_fields-prctr ).
IF lv_len = 5.
OVERLAY source_fields-prctr WITH lc_0.
ENDIF.
RESULT = source_fields-prctr.
Regards,
Ryan Crosby
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.