2006 Mar 22 12:29 PM
I do have 3 parameters...
Tabname
fieldname
fieldvalue
I want the fieldvalue to be converted to internal format according to the 3 values
The values are determined at runtime so It can not hard code the convertion exit!
Regards,
2006 Mar 22 12:37 PM
2006 Mar 22 12:33 PM
2006 Mar 22 12:35 PM
right!
I should give that to the fm and get the internal value!
for example pa0001 - begda - 22.03.2006
ouput should be 20060322
2006 Mar 22 12:44 PM
use the fm CONVERT_DATE_TO_EXTERNAL
Dynamically u can do by writing a program
Use any of the foll. FM
HRGPBS_HESA_DATE_FORMAT
Format a date valid for HESA: DD/MM/YYYY
HRGPBS_TPS_DATE_FORMAT
Format a date valid for TPS: DDMMYY
SLS_MISC_GET_USER_DATE_FORMAT
get the date format the user has defined as his/her default
========================================
REPORT ZES .
data: v_date type char10.
CALL FUNCTION 'HRGPBS_HESA_DATE_FORMAT'
EXPORTING
p_date = sy-datum
IMPORTING
DATESTRING = v_date.
replace all occurences of '/' in v_date with '.' .
write v_date.
Message was edited by: Eswar Kanakanti
2006 Mar 22 12:37 PM
2006 Mar 22 12:46 PM
Stephan,
You can use fieldcatalog and do something like:
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING i_structure_name = tabname
i_client_never_display = 'X'
CHANGING ct_fieldcat = t_fieldcat.
READ TABLE t_fieldcat ASSIGNING <fcat>
WITH KEY fieldname = fieldname.
CALL FUNCTION 'G_CONVERT_INPUT'
EXPORTING CONVERTED_LENGTH = <fcat>-intlen
CONVEXIT = <fcat>-convexit
DATATYPE = <fcat>-datatype
INPUT_LENGTH = <fcat>-intlen
INPUT_VALUE = fieldvalue
* LENGTH = 0
* LOWERCASE = 'X'
* FLAG_CONVERT_SPACE =
IMPORTING CONVERTED_VALUE = new_fieldvalue.HTH
Regards,
Igor
2006 Mar 22 12:39 PM
Got your point.
Go to the table DD03L .. Get the Domain by passing the tabname & fieldname.
Now go to the table DD01L.. Pass the Domain which you have got from the previous step, and get the Conversion routine name.
concatenate CONVERSION_EXIT_<conv routine name>_INPUT and make use of this function module.
I hope it solves your purpose. Get back to me in case of doubt
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |