‎2008 May 23 9:59 AM
hi,
i have an internal table int_edidd of type edidd.
int_edidd-sdata = shilpi,pasricha
i want to store this in filelds fname(shilpi) and lname(pasricha) in a table zidoc3.
how to split the sdata?
please guide.
shilpi
‎2008 May 23 10:11 AM
Declare a structure like the segment type.
Suppose the segment name is E1EDK01.
declare a structure of type E1EDK01.
ex:
lw_E1EDK01 type E1EDK01.
Now,
Loop Idocdata.
if Idocdata-segname eq 'E1EDK01'.
move Idocdata-sdata to lw_E1EDK01.
* Now you can access the fields like
lw_E1EDK01-fname = 'shilpi'.
lw_E1EDK01-fname = 'pasricha].
move lw_E1EDK01 to Idocdata-sdata.
modify Idocdata from Idocdata-sdata
Transporting sdata.
endif.
clear: Idocdata.
endloop.
‎2008 May 23 10:07 AM
Hi,
Declare two variables,
data:v_var1(500) type c,
v_var2(500) type c,
v_len type i.
v_len = STRLEN( int_edidd-sdata).
if v_len gt 500.
v_var1 = int_edidd-sdata+0(500).
shift int_edidd-sdat left by 500 places.
v_len = STRLEN( int_edidd-sdata).
v_var2 = int_edidd-sdata+0(v_len).
else.
v_Var1 = int_edidd-sdata+0(v_len).
endif.
zdoc1-fname = v_var1.
zdoc1-lname = v_var2.Regards
Kannaiah
‎2008 May 23 10:11 AM
Declare a structure like the segment type.
Suppose the segment name is E1EDK01.
declare a structure of type E1EDK01.
ex:
lw_E1EDK01 type E1EDK01.
Now,
Loop Idocdata.
if Idocdata-segname eq 'E1EDK01'.
move Idocdata-sdata to lw_E1EDK01.
* Now you can access the fields like
lw_E1EDK01-fname = 'shilpi'.
lw_E1EDK01-fname = 'pasricha].
move lw_E1EDK01 to Idocdata-sdata.
modify Idocdata from Idocdata-sdata
Transporting sdata.
endif.
clear: Idocdata.
endloop.
‎2008 May 23 10:37 AM
what about the 'comma' that separates shilpi and pasricha?
regards
shilpi
‎2008 May 23 10:42 AM
If you want to have the split at comma, then do like this
split int_edidd at ',' into fname lname.Regards
Kannaiah