Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

extraction from a list

Former Member
0 Likes
650

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 ????

4 REPLIES 4
Read only

Former Member
0 Likes
615

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

Read only

Former Member
0 Likes
615

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

Read only

0 Likes
615

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???????????

Read only

Former Member
0 Likes
615

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 .