EDI SE01 segment mapping

I am using database fields to send into EDI856 document segments finally i have to map SE01 segment as well on the basis of no. of segments used in it . how can i calculate the SE01 segment value?.i am using WEBMETHOD developer.


Here is the lit trick for SE01 (segmentcount),just intialize the SE01 with (setValue) icon in the pipeline editor before you call convertToString and this service will take care of the segmentcount from ST to SE and generate it for you.check the results/pipeline string to make sure the same.