Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Toolbox sap-dev Reply from ameensha on Dec 17 at 12:12 PM Hi Samis, It can be achieved by passing the values to an ITAB. I'm here providing a sample code for your reference, simulating the requirement. DATA : X TYPE STRING VALUE 'A1-A2-A3-A4', Y TYPE STRING. DATA : BEGIN OF WA, VAL(10), END OF WA, IT LIKE TABLE OF WA. DO. IF X CA '-'. SPLIT X AT '-' INTO X Y. IF SY-SUBRC EQ 0. WA-VAL = X. APPEND WA TO IT. CLEAR : WA, X. X = Y. CLEAR Y. ENDIF. ELSE. WA-VAL = X. APPEND WA TO IT. CLEAR WA. EXIT. ENDIF. ENDDO. All the data is stored in the internal table IT. Hope your issue is solved. Cheers, Ameen.
| | | ---------------Original Message--------------- From: samis Sent: Monday, December 17, 2012 11:39 AM Subject: Split N Number Words from String s1 : word1-word2-word3
word n etc.......... i have big sentence(string) i want to split by a separator(-),how can i store values spilted values into varibles insted of taking n number of varibles for each splited
ex:word1-word2-word3 for this simply we can put into three varibles like:split s1 at '-' into s2 s3 s4. write :s1,s2,s3
but i want n number of values to split
please buddys help me to do this | | Reply to this email to post your response. __.____._ | In the Spotlight Become a blogger at Toolbox.com and share your expertise with the community. Start today. _.____.__ |