2006 Jun 22 10:31 AM
Hi
all
i have a unix file having data like that
PPPPMMMMMMMM
where p-is plant of 4 char
and m- is material of 8 char
No i m uploading them and i have to split them into plant and material .
How i can do it.?
i have to split at 4 th palce
plz suggest asap.
Thanks
Saurabh
2006 Jun 22 10:36 AM
Hi,
Since there no split char ; u have to use offset.
lv_data+0(4).-----> Plant
lv_data+4(8)------>Material.
use as above direcly or
lv_plant = lv_data+0(4).
lv_material = lv_data+4(8).
U can store is this into variable or directly access it.
2006 Jun 22 10:36 AM
Use offset.
move v_str+0(4) to plant.
move v_str+4(8) to material.
2006 Jun 22 10:37 AM
You will have to get the entire thing into variable.
DATA : VAR TYPE STRING.
VAR = 'PPPPMMMMMMMM'.
PLANT = VAR+0(4).
LEN = STRLEN( VAR ).
LEN = LEN - 4.
MATERIAL = VAR+4(LEN).
Regards,
Ravi
Note : Please mark the helpful answers
2006 Jun 22 10:38 AM
You will have to use the offset method.Since there is no sepeartor here you cannot use the split command.
Store the plant into suppose a variable l_plant and the material into say l_material.Then for your data file
l_plant = l_data+0(4).
l_material = l_data+4(8)