‎2008 Aug 12 7:31 AM
Hello experts,
In an internal table i have a field with value
'Spool request (number 0000012086) sent to SAP printer con_133'.
now from this, i wnat to get the number '0000012086' into a varaible g_num.
The value of the number in the table-filed will change dynamically.
how to use FIND in this case??
thanks.
Edited by: SAP USER on Aug 12, 2008 8:31 AM
Edited by: SAP USER on Aug 12, 2008 8:32 AM
‎2008 Aug 12 7:42 AM
Hi,
In such messages location of number is fixed, hence instead of using FIND you can use offset to determine the number
l_message+22(10).
To check if you have captured number only USE TRY ...CATCH...ENDTRY
DATA : l_num type i.
TRY.
l_num = l_message+22(10).
CATCH CX_SY_CONVERSION_NO_NUMBER.
MESSAGE exxx(mess class) with 'cannot assign number'.
ENDTRY.
Regards,
Mohaiyuddin
‎2008 Aug 12 7:37 AM
Hi,
You can get the spool number using system variable sy-spono.
assing sy-spono to g_num
regards
padma
‎2008 Aug 12 7:42 AM
Hi,
In such messages location of number is fixed, hence instead of using FIND you can use offset to determine the number
l_message+22(10).
To check if you have captured number only USE TRY ...CATCH...ENDTRY
DATA : l_num type i.
TRY.
l_num = l_message+22(10).
CATCH CX_SY_CONVERSION_NO_NUMBER.
MESSAGE exxx(mess class) with 'cannot assign number'.
ENDTRY.
Regards,
Mohaiyuddin