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

Function module

Former Member
0 Likes
936

One of my requirement is to get the characterstic values for that iam using standard function module

DATA: WS_C LENGTHFT LIKE CUOV_01-ATWRT,

WS_C LENGTHLN LIKE CUOV_01-ATWRT.

DATA: WS_QUERY LIKE QUEREY OCCURS 0.

CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'

EXPORTING

ARGUMENT = 'Length_Feet'

IMPORTING

SYM_VAL = WS_C_LENGTH_FT

TABLES

QUERY = WS_QUERY

EXCEPTIONS

ARG_NOT_FOUND = 1.

IF SY-SUBRC <> 0.

RAISE INTERNAL_ERROR.

ENDIF.

When i run this function module when input values i have to give?Why it showing short dump?

Thanks & Regads,

Sairam

11 REPLIES 11
Read only

Former Member
0 Likes
882

hi Sairam,

do this way...

DATA: WS_C LENGTHFT LIKE CUOV_01-ATWRT,

WS_C LENGTHLN LIKE CUOV_01-ATWRT.

DATA: WS_QUERY <b>LIKE CUOV_01 OCCURS 0 with header line.</b>

CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'

EXPORTING

ARGUMENT = 'Length_Feet'

IMPORTING

SYM_VAL = WS_C_LENGTH_FT

TABLES

QUERY = WS_QUERY

EXCEPTIONS

ARG_NOT_FOUND = 1.

IF SY-SUBRC <> 0.

RAISE INTERNAL_ERROR.

ENDIF.

Read only

Former Member
0 Likes
882

Hi,

To get the characteristic value u can use AUSP table ...

"Reward Points if it is useful"

Thanks,

Manjunath MS

Read only

Former Member
0 Likes
882

hi Sairam,

it seems there is some error in the table decleration part.

Also, change the name to ws_query1..to avoid conflict in name with a standard

function module (WS_QUERY).

change your code as shown below:

CUOV_01



DATA: WS_C _LENGTH_FT  LIKE  CUOV_01-ATWRT,
           WS_C _LENGTH_LN LIKE  CUOV_01-ATWRT,
           WS_QUERY1           TYPE table of CUOV_01.

 CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
      EXPORTING
           ARGUMENT      = 'LENGTH_FEET'
      IMPORTING
           SYM_VAL       = WS_C_LENGTH_FT
      TABLES
           QUERY         = WS_QUERY1
      EXCEPTIONS
           ARG_NOT_FOUND = 01.

hope this helps,

Sajan Joseph.

Read only

Former Member
0 Likes
882

check the where-used-list of that FM , u can get some programs where this FM was used

also chk if the arguments to be in uppercase

'Length_Feet' -


> 'LENGTH_FEET'

Read only

Former Member
0 Likes
882

hI..

DATA: WS_C_LENGTH_FT LIKE CUOV_01-ATWRT,

WS_C_LENGTH_LN LIKE CUOV_01-ATWRT.

DATA: WS_QUERY LIKE <b>CUOV_01</b> OCCURS 0.

<b>DATA: T_ARGUMENT TYPE CUOV_01.</b>

<b>T_ARGUMENT-VARNAM = 'Length_Feet'.</b>

CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'

EXPORTING

ARGUMENT = <b>T_ARGUMENT-VARNAM</b>

IMPORTING

SYM_VAL = WS_C_LENGTH_FT

TABLES

QUERY = WS_QUERY

EXCEPTIONS

ARG_NOT_FOUND = 1.

IF SY-SUBRC <> 0.

<b>MESSAGE 'NOT GOOD' TYPE 'I'.</b>

*RAISE INTERNAL_ERROR.

ENDIF.

now check the values that u r passing ...pass proper values..

Read only

Former Member
0 Likes
882

I was tried for all suggested.But still it showing shortdump.

Thanks & Regards,

Sairam

Read only

Former Member
0 Likes
882

hi,

try to change the code like below

DATA: WS_C LENGTHFT LIKE CUOV_01-ATWRT,

WS_C LENGTHLN LIKE CUOV_01-ATWRT,

<b>v_argument like CUOV_01-VARNAM.</b>

DATA: WS_QUERY LIKE CUOV_01 OCCURS 0.

<b>v_argument = 'Length_Feet'.</b>

CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'

EXPORTING

<b>ARGUMENT = v_argument</b>

IMPORTING

SYM_VAL = WS_C_LENGTH_FT

TABLES

<b>QUERY = WS_QUERY</b>

EXCEPTIONS

ARG_NOT_FOUND = 1.

IF SY-SUBRC <> 0.

RAISE INTERNAL_ERROR.

ENDIF.

regards,

Navneeth.K

Message was edited by:

Navneeth Bothra

Read only

0 Likes
882

Hi Navneeth,

Its working.Thanks for all ur suggestions.I will give bonus points to u.

Thanks & Regards,

sairam

Read only

Former Member
0 Likes
882

hi,

in addition to my above post. see that when ever u pass parameters to a FM the type of the parameters you pass must match the type of the parameters in the FM.

regards,

Navneeth.K

Read only

Former Member
0 Likes
882

Hi Sairam ,

now is your FM working fine

Read only

Former Member
0 Likes
882

Thanku for all repiles.