‎2009 Apr 28 4:21 AM
Hi ... I am trying to extract partial string from a variable.
Some how, I am not able to find substring function per what describe here :
http://help.sap.com/abapdocu/en/ABENSUBSTRING_FUNCTIONS.htm
wa_date = '20090304120346'.
V_DATE = SUBSTRING( val = WA_DATE off = 0 len = 4 ).
V_MONTH = SUBSTRING( val = WA_DATE off = 5 len = 2 ).
V_DATE = SUBSTRING( val = WA_DATE off = 7 len = 2 ).
I got compile error ...
Am I doing the right thing ? Thanks.
‎2009 Apr 28 4:28 AM
Hello,
wa_date = '20090304120346'.
V_DATE = SUBSTRING( val = WA_DATE off = 0 len = 4 ).
V_MONTH = SUBSTRING( val = WA_DATE off = 5 len = 2 ).
V_DATE = SUBSTRING( val = WA_DATE off = 7 len = 2 ).
Try this
v_date = wa_date+00(04)
v_month = wa_date+04(02)
v_date = wa_date+06(02)
Hope its clear
Regards,
Mansi.
‎2009 Apr 28 4:30 AM
Hi Davidku,
I am not sure about the function that you have mentioned below.
But, you need to use the Offset concept to extract the substring you want.
Seach SDN with the keyword Offset. You will get what you wanted.
Thanks,
Babu Kilari
‎2009 Apr 28 4:30 AM
Hello David
As you can see in the upper right corner of the Webpage you mention this function is available in
NW AS ABAP Release 711Are you already working on (basis) release >= 7.10?
Regards
Uwe
‎2009 Apr 28 4:31 AM
‎2009 Apr 28 4:33 AM
Hi...
Try
V_DATE = WA_DATE+0(4).
V_MONTH = WA_DATE+5(2).
V_DATE = WA_DATE+7(2).
Hope this helps...
Regdrs,
Chintan.
Edited by: Chintan_SAP on Apr 28, 2009 9:03 AM
‎2009 Apr 28 6:05 AM
Perfect ... it works. Thanks.
I am still confined to SQL server and Oracle type of programming.
Trying to find the function but it exist in another form.
V_DATE = wa_date+00(04).
V_MONTH = wa_date+04(02).
V_DATE = wa_date+06(02).
This method is known as offset ?
‎2009 Apr 28 6:06 AM