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

Conversion Function module

Former Member
0 Likes
542

Hi Experts,

Hi Experts,

In my report i need to declare a select-option . This select-option is a combination of Period and fiscal year i..e the values in the select-option should be like

PPP/YYYY period and year need to be separated by "/".

I had declared in that format. Here the period starts from 001-012.So when ever the User enters 010/2005 in low and 007/2007 in high it is giving an error that Lower limit is greater than Higher limit .

For this i had created a Data element with domain that is having a function module

with the folowing code

FUNCTION CONVERSION_EXIT_ZCCON_INPUT.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(REFERENCE) OPTIONAL

*" EXPORTING

*" VALUE(REFERENCE1)

*"----


DATA : L_PPP(3) TYPE C,

L_YYYY(4) TYPE C.

REFERENCE1 = REFERENCE.

SPLIT REFERENCE1 AT '/' INTO L_PPP L_YYYY.

CONCATENATE L_YYYY '/' L_PPP INTO REFERENCE1.

ENDFUNCTION.

but when ever give some data in the selection-screen that is declred with this data element data is not passing to the function module.

3 REPLIES 3
Read only

Former Member
0 Likes
499

Hi

I believe your input format should be a number, so you should concantenate only the year and the month into the input:

FUNCTION CONVERSION_EXIT_ZCCON_INPUT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(REFERENCE) OPTIONAL
*" EXPORTING
*" VALUE(REFERENCE1)
*"----------------------------------------------------------------------

DATA :  L_PPP(3) TYPE C,
            L_YYYY(4) TYPE C.

  REFERENCE1 = REFERENCE.

  SPLIT REFERENCE1 AT '/' INTO L_PPP L_YYYY.

  CONCATENATE L_YYYY L_PPP INTO REFERENCE1.

ENDFUNCTION.

FUNCTION CONVERSION_EXIT_ZCCON_OUTPUT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(REFERENCE) OPTIONAL
*" EXPORTING
*" VALUE(REFERENCE1)
*"----------------------------------------------------------------------

DATA :  L_PPP(3) TYPE C,
            L_YYYY(4) TYPE C.

  L_YYYY = REFERENCE(4).
  L_PPP  = REFERENCE+4(3).

  CONCATENATE L_PPP '/' L_YYYY L_PPP INTO REFERENCE1.

ENDFUNCTION.

Max

Read only

former_member186741
Active Contributor
0 Likes
499

I think that you MUST name your parameters to conversdion exits INPUT and OUTPUT. I did the following and it works.

1. created a domain znrwperiod....char8....conversion routine znper

2. created a data element using the above domain

3. created function moduleS in the same group as each other

3a. CONVERSION_EXIT_ZNPER_OUTPUT

FUNCTION CONVERSION_EXIT_ZNPER_OUTPUT.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(INPUT)

*" EXPORTING

*" REFERENCE(OUTPUT)

*"----


DATA : L_PPP(3) TYPE C,

L_YYYY(4) TYPE C.

SPLIT input AT '/' INTO L_YYYY L_PPP.

CONCATENATE L_PPP '/' L_YYYY INTO output.

ENDFUNCTION.

3b. CONVERSION_EXIT_ZNPER_INPUT

FUNCTION CONVERSION_EXIT_ZNPER_INPUT.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(INPUT)

*" EXPORTING

*" REFERENCE(OUTPUT)

*"----


DATA : L_PPP(3) TYPE C,

L_YYYY(4) TYPE C.

SPLIT input AT '/' INTO L_PPP L_YYYY.

CONCATENATE L_YYYY '/' L_PPP INTO output.

ENDFUNCTION.

Read only

Former Member
0 Likes
499

Do you think you could close the "Error in Select-Option" thread

where this conversion exit was first suggested? Yes, you have to have INPUT and OUTPUT only defined, as provided in the example code there.