cancel
Showing results for 
Search instead for 
Did you mean: 

Function In Varient Configuration

Former Member
0 Kudos

Hi All,

I have a requirement where i have a class Class1 and under it we have 3 Characteristics namely C1,C2 and C3.

I want to C1 and C2 value to be concatenated into C3.

For this I want to create a function.

Can someone help me how to do this??

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Check that they are given in standard Precondition Object dependencies before you call the function.

Please reward points if you feel I've provided enough information. You have all the function code, and the Obj. Dep code to call it

You just have to trial and error with getting it all working together

Former Member
0 Kudos

Thanks for the help Bill.

Answers (3)

Answers (3)

Former Member
0 Kudos

whatever function Group / module you decide to put it in.

The object dependency code to call it is:

function Z_FUNC_BU_GEN_WKGP(

CHAR1 = $ROOT.BU_WKSF,

CHAR2 = $ROOT.BU_WKSF_GRP,

CONCAT_CHAR = $SELF.BU_CONCAT_WKSF_WITH_WKSF_GRP).

Former Member
0 Kudos

Is to be put in the FM for the Function in U61??

Former Member
0 Kudos

I think this should get me full award points !

DATA:

CHARACTERISTIC1 LIKE CUOV_01-ATWRT,

CHARACTERISTIC2 LIKE CUOV_01-ATWRT,

CHAR_RETURN(30) TYPE C.

REFRESH MATCH.

CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'

EXPORTING ARGUMENT = 'CHAR1'

IMPORTING SYM_VAL = CHARACTERISTIC1

TABLES QUERY = QUERY

EXCEPTIONS ARG_NOT_FOUND = 01.

IF SY-SUBRC <> 0.

RAISE INTERNAL_ERROR.

ENDIF.

CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'

EXPORTING ARGUMENT = 'CHAR2'

IMPORTING SYM_VAL = CHARACTERISTIC2

TABLES QUERY = QUERY

EXCEPTIONS ARG_NOT_FOUND = 01.

IF SY-SUBRC <> 0.

RAISE INTERNAL_ERROR.

ENDIF.

CONCATENATE CHARACTERISTIC1 CHARACTERISTIC2 INTO CHAR_RETURN.

IF SY-SUBRC <> 0.

IF SY-SUBRC = 4.

WRITE : ' RETURN VALUE TOO LONG '.

ENDIF.

ELSE. WRITE: ' SOME OTHER ERROR '.

ENDIF.

CALL FUNCTION 'CUOV_SET_FUNCTION_ARGUMENT'

EXPORTING ARGUMENT = 'CONCAT_CHAR'

VTYPE = 'CHAR'

SYM_VAL = CHAR_RETURN

TABLES MATCH = MATCH

EXCEPTIONS EXISTING_VALUE_REPLACED = 01.

  • others = 2.

ENDFUNCTION.

Former Member
0 Kudos

I have 2 things to be done here.

If Char1 and Char2 are given then Concatenate them into Char3

If Char3 is given then split them into Char1 and Char2.

Can I do that in a single Function Module or need to have 2.

Where do i need to call them??

How would i associate the FM parameters the the Characteristics??

Thanks for the reply Bill.