SAP Classes

Share |

CONVERT_STRING_TO_QUANTITY SAP Method - BRS Convert a string to a quantity


CONVERT_STRING_TO_QUANTITY is a standard SAP ABAP method of class CL_FDT_QUANTITY_CONV available within R/3 SAP systems depending on your version and release level. Below is the standard documentation available for it. You can view this information and more if you enter the class name CL_FDT_QUANTITY_CONV into the relevant SAP transaction such as SE24 or SE80 and then select the method CONVERT_STRING_TO_QUANTITY

Contribute(Add Comment)
See the comments section below for any useful hints, tips and information specific to this SAP Method. Also please feel free to add any further details you feel would be useful or ask any questions you may have. You can then easily find this info again simply by searching on the method name CONVERT_STRING_TO_QUANTITY or its description.


Class Name: CL_FDT_QUANTITY_CONV

Method Name: CONVERT_STRING_TO_QUANTITY

Method Type: Static Method
This is a Static Method so you can call it directly

Importing Parameters:
   IV_TEXT " Quantity in string format (separated by Space) TYPE STRING

Returning Parameters:
   RS_QUANTITY " Elementary Data Type Quantity TYPE REF TO IF_FDT_TYPES=>ELEMENT_QUANTITY

Exceptions:
   CX_FDT_CONVERSION - FDT: Invalid Input


Example ABAP coding

DATA:
   ld_IV_TEXT TYPE STRING ,
   ld_RS_QUANTITY TYPE REF TO IF_FDT_TYPES=>ELEMENT_QUANTITY.

" ld_IV_TEXT = "<Populate with value>

CALL METHOD CL_FDT_QUANTITY_CONV=>CONVERT_STRING_TO_QUANTITY(
EXPORTING
   IV_TEXT = ld_IV_TEXT
RECEIVING
   RS_QUANTITY = ld_RS_QUANTITY
EXCEPTIONS
   CX_FDT_CONVERSION = 4 ).

"Alternate coding for Method Call with returning parameter

ld_RS_QUANTITY = CL_FDT_QUANTITY_CONV=>CONVERT_STRING_TO_QUANTITY(
EXPORTING
   IV_TEXT = ld_IV_TEXT ).


comments powered by Disqus