Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert to Internal format

Former Member
0 Likes
2,126

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,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,495

hai Stephan,

Just check out these links....

regards,

Srikanth.

Reward points if helpful

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,

6 REPLIES 6
Read only

Former Member
0 Likes
1,495

These are the input parameters.. right??

Read only

0 Likes
1,495

right!

I should give that to the fm and get the internal value!

for example pa0001 - begda - 22.03.2006

ouput should be 20060322

Read only

0 Likes
1,495

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

Read only

Former Member
0 Likes
1,496

hai Stephan,

Just check out these links....

regards,

Srikanth.

Reward points if helpful

Read only

0 Likes
1,495

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

Read only

Former Member
0 Likes
1,495

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