2012 May 18 7:26 AM
Hi All,
Can you people help me out in finding a function module, which takes conversion routine name as input and gives all the conversion exit function modules as output.
Thanks and Regards,
Shivaraj Naik.
2012 May 18 7:45 AM
Hi Shivaraj,
Conversion exit function modules follow a general naming as CONVERSION_EXIT_XXXXX_INPUT / CONVERSION_EXIT_XXXXX_OUTPUT, where xxxxx is the conversion routine name.
So you can write code as follows to find the conversion exit fms;
CONCATENATE 'CONVERSION_EXIT_' lv_conv_routine '_INPUT' into lv_conv_inpfm.
CONCATENATE 'CONVERSION_EXIT_' lv_conv_routine '_OUTPUT' into lv_conv_outfm.
Hope this helps.
Regards,
Karthik D
2012 May 18 10:01 AM
2012 May 18 10:06 AM
2014 Aug 21 1:21 PM
Hi Karthik,
Conversion exit function modules follow a general naming as CONVERSION_EXIT_XXXXX_INPUT / CONVERSION_EXIT_XXXXX_OUTPUT, where xxxxx is the conversion routine name.
So you can write code as follows to find the conversion exit fms;
Hope this helps.
In response to the above code I am having doubt regarding the declaration of lv_conv_inpfm and
lv_conv_outfm.Can you tell how we can declare them in our program.
Regards,
Chakradhar.
2012 May 18 7:49 AM
There is no function like that. As mentioned use 'concatenate' statement.
You can have a look at my wiki post if required http://wiki.sdn.sap.com/wiki/display/ABAP/Program+to+generalize+the+conversion+exits+dynamically.
Also you have a utility class CL_RSAN_UT_CONVERSION_EXIT available for conversion exit manipulations.
2012 May 18 9:12 AM
Thanks for the reply, actually i need to call it in remote system, so i need an RFC fm to get these values. Manually i cannot hardcode in remote system.
2012 May 18 9:19 AM
Hi Shivaraj,
Then you have to create a RFC function module in SAP which takes conversion routine as input and returns the conversion exit function modules using concatenate as i told.
After that you can access the RFC FM from the remote system.
Hope this helps.
Regards,
Karthik D
2012 May 18 9:21 AM
You can go ahead with creation of a custom RFC in the remote system and use the logic mentioned by Kesavadas for getting what you need.
2012 May 18 9:32 AM
Thanks all for the replies, Anyways, i want a fm which already exists as i cannot create it in remote system. Another thing is, to get conversion exit fm's, the logic what i would suggest you guys is, all conversion exit fm's follow a prefix of CONVERSION_EXIT_<con_routine>* , pass this value to table V_FDIR which gives you all fm's related to conversion routine. no need to concatenate, as it wont be always for INPUT and OUTPUT only.
2012 May 18 9:56 AM
"as it wont be always for INPUT and OUTPUT only." - It will be always( other than the ranges mentioned by Raymond ).
Please let us know then how will you find the function for the field ATNAM from
the table VFDIR. It doesn't hold it, the function ATINN_INPUT must be used for
the field ATNAM. So, fetching the functions from table willot help you. Use a
describe statement on the field and get the mask from either input or output
fields, then cocacatenate as suggested.
ex:
* Determine the mask from the domain
DESCRIBE FIELD input_value OUTPUT-LENGTH lfd_length
EDIT MASK lfd_mask.
IF lfd_mask IS INITIAL.
* This statement is included because its not necessary that all field
* will be having mask associated with it, for example: ATNAM. But to get the
* conversion exit of ATNAM the output variable type will be holding the respective mask
* for example: ATINN. So this works.
DESCRIBE FIELD output_value OUTPUT-LENGTH lfd_length
EDIT MASK lfd_mask.
IF lfd_mask IS INITIAL.
IF output_value IS INITIAL.
output_value = input_value.
ENDIF.
EXIT.
ENDIF.
ENDIF.
REPLACE '==' IN lfd_mask WITH ` `.
CONDENSE lfd_mask NO-GAPS.
As Raymond said, the RANGES are the exceptional cases.
2012 May 18 10:04 AM
2012 May 18 10:41 AM
2012 May 18 11:04 AM
Curious, I looked for the way SAP do the job in SE11, and they also use the CONCATENATE option...
From Include LSD11F01 Form OBJ_GOTO
*&---------------------------------------------------------------------*
* Objektspezifische Navigationsziele
*----------------------------------------------------------------------*
* --> GOTOID Kennung für Navigationsziele
* --> DDNAME Dictonary-Name
*----------------------------------------------------------------------*
form obj_goto using gotoid type gotoid
ddname.
case gotoid.
when 'CNVE'. "Konvertierungsexit zu Domäne
data: wb_request type ref to cl_wb_request.
data: fb_name like tfdir-funcname
value 'CONVERSION_EXIT_'.
concatenate fb_name ddname '*' into fb_name.
condense fb_name.
* Request für Infosystem erzeugen
class cl_wb_infosystem definition load.
call method cl_wb_infosystem=>create_request
exporting
p_object_type = 'FF'
p_object_name = fb_name
p_operation = swbm_c_op_search
p_suppress_selection = 'X'
p_show_as_popup = 'X'
importing
p_wb_request = wb_request
exceptions
action_cancelled = 1
execute_in_batch = 2
error_occured = 3.
Regards,
Raymond
2012 May 18 11:33 AM
2012 Aug 01 10:09 AM
Hi, I have tried using FM REPOSITORY_INFO_SYSTEM_F4, as follows.
DATA:
lf_object_name TYPE char40.
CONCATENATE 'CONVERSION_EXIT_'
<name of desired conversion exit>
'*'
INTO lf_object_name.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
object_type = 'FUNC'
object_name = lf_object_name
suppress_selection = abap_true
without_personal_list = abap_true
use_alv_grid = abap_true
EXCEPTIONS
cancel = 1
wrong_type = 2
OTHERS = 3.
When using e.g. 'MATN1' for <name of desired conversion exit> the result is an overview with 4 function modules.
Disadvantage is that the result is displayed, you do not get it into a return variable...
Kind regards,
René