2006 Dec 08 5:28 AM
hi all.
we have a requirement that
there is a FILE having no's separated by commas( Ex: file contents are 402,80-,567-,666,942-,.....(n rows and r colomns)) where the negative sign appears at the end rather than at the front.
we want that to be at the front.
for that we have found one FM named 'CLOI_PUT_SIGN_IN_FRONT' which changes the negative sign in front.but for this i need to extract each and every number from the above mentioned file contents to be inputted into this FM.
any ideas how to implement this FM for the above FILE ????
hi all.
we have a requirement that
there is a FILE having no's separated by commas( Ex: file contents are 402,80-,567-,666,942-,.....(n rows and r colomns)) where the negative sign appears at the end rather than at the front.
we want that to be at the front.
for that we have found one FM named 'CLOI_PUT_SIGN_IN_FRONT' which changes the negative sign in front.but for this i need to extract each and every number from the above mentioned file contents to be inputted into this FM.
any ideas how to implement this FM for the above FILE ????
2006 Dec 08 5:32 AM
hi kunal,
first you have to separate the values induvidually in order to pass this to the FM. you can use the command <b>SPLIT</b> to separate the values into different variables.
after that you can pass each variable into the FM and get the required.
hope this helps
pavan
2006 Dec 08 5:34 AM
Hi,
try it like this
v_xyz = itab-abc. " <b>value = 100-</b>
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = itab-abc.
v_xyz = itab-abc. "<b>value = -100</b>
Regards,
Pankaj singh
reward all helpful answers
2006 Dec 08 5:50 AM
hi pankaj,the problem is how to extract each particular no. from the FILE i mentioned so as to input it to the FM.
actuall the FILE is like
loop at itab2
itab2-sales_doc
itab2-sales_itm
itab2-prod_date
itab2-ship_date
l_revenue
l_mat_pla
l_mat_act
l_mat_var
l_lab_pla
l_lab_act
l_lab_var
l_bur_pla
l_bur_act
l_bur_var
l_tot_cost_pla
l_tot_cost_act
l_tot_cost_var
l_prm_var
endloop.
where each variable has some value changing after the loop.
now i have to input each and every variable into this FM.........
any ideas???????????
2006 Dec 08 6:52 AM
hi kunal ,
first thing u need to is read the entire file into an internal table .
declare th internal table as follows...
data: it_nos(80) type c occurs 0 with header line .
data: it_no(4) type c occurs 0 with header line .
data: no type i .
then do the foll ...
loop at it_nos .
split it_nos at ',' into table it_no
loop at it_no .
no = it_no .
call ur function module here passing it variable no .
endloop .
endoop .
this shud solve ur problem .
here i am using only 4 digit nos u can change dat as per ur requirement .
IF HELPFUL THEN PLZ REWARD POINTS .
regards ,
swapnil .
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |