2007 Jan 09 10:35 AM
My requirement goes as follows:
When I am doing a BDC, if the Amount in the flat file which is for ex: 5,500.45 should get converted to 5.500,00 in SAP. Can someone help me finding out the solution for this. Is there any Funciton Module or some logic for this?
Thanks!!!!!!
Nitish.
2007 Jan 09 10:39 AM
hi,
1,234,567.89 => 1.234.567,89.
data: l_amnt(100) type c.
l_amnt = '1.234.567,89'.
replace all occurrences of ',' in l_amnt with '#'.
replace all occurrences of '.' in l_amnt with ','.
replace all occurrences of '#' in l_amnt with '.'.
write : l_amnt.Rgds
Anver
My requirement goes as follows:
When I am doing a BDC, if the Amount in the flat file which is for ex: 5,500.45 should get converted to 5.500,00 in SAP. Can someone help me finding out the solution for this. Is there any Funciton Module or some logic for this?
Thanks!!!!!!
Nitish.
2007 Jan 09 10:39 AM
hi,
1,234,567.89 => 1.234.567,89.
data: l_amnt(100) type c.
l_amnt = '1.234.567,89'.
replace all occurrences of ',' in l_amnt with '#'.
replace all occurrences of '.' in l_amnt with ','.
replace all occurrences of '#' in l_amnt with '.'.
write : l_amnt.Rgds
Anver
2007 Jan 09 11:21 AM
Thanks for the response. I still have things to clarify. Suppose there is a value in the flat file like for ex: 100000, then in that case what will be the o/p according to your logic?
As per my requirement it shld be like this:
100000 ==> 1.00.000,00
Can u please look into this & provide me with the solution?
Thanks!!!!
Nitish
2007 Jan 09 11:24 AM
Hi,
check the following code.
CASE l_dec.
WHEN 'X'. "N,NNN.NN
REPLACE ALL OCCURRENCES OF ',' IN p_comp_qty WITH ' '.
CONDENSE p_comp_qty NO-GAPS.
WHEN ' '. "N.NNN,NN
REPLACE ALL OCCURRENCES OF '.' IN p_comp_qty WITH ' '.
REPLACE ',' IN p_comp_qty WITH '.'.
CONDENSE p_comp_qty NO-GAPS.
WHEN 'Y'. "N NNN NNN,NN
REPLACE ',' IN p_comp_qty WITH '.'.
CONDENSE p_comp_qty NO-GAPS.
WHEN OTHERS.
RETURN.
ENDCASE.
hope its useful...
Sarath
2007 Jan 10 7:59 AM
Hi Anver,
The code which you gave works fine in ECC 6.0 but when I am trying to execute the same in 4.6 C it is throwing error. Can u please suggest on how to proceed with this?
Thanks!!!!!!
Nitish
2007 Jan 09 10:42 AM
2007 Jan 09 11:52 AM
hi,
parameters : val like vbap-netpr.
data: val2(13) type c.
val = trunc( val ). "--->use this
write:/ val.
write val to val2.
replace '.' with ',' into val2.
replace ',' with '.' into val2.
write:/ val2.check ur input as 5,500.45
regards
vijay.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |