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

FM

Former Member
0 Likes
653

Hi Experts,

Can i declare a global declaration for a standard FM:

For Ex:there is a function ZFUNCTION in the function library.

for this can i declare constant in the global declaration..like

c_zfunction like Zfunction.If so how?

and can i call directly in my pgm like:

CALL FUNCTION c_zfunction?.Becoz...in one our requirements there is Z FM in the library.it hasbeen called using C_ZFM..while exicuting it is throwing error like

c_zfunction does not exist..

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
625

hi Ravi,

can you be more clear with the query. it will help us to understand problem clearly.

regards,

Navneeth.K

4 REPLIES 4
Read only

Former Member
0 Likes
626

hi Ravi,

can you be more clear with the query. it will help us to understand problem clearly.

regards,

Navneeth.K

Read only

Former Member
0 Likes
625

Hi,

Try this out.

data : func type string,

w-ans.

func = 'POPUP_TO_CONFIRM'.

CALL FUNCTION func

EXPORTING

TITLEBAR = 'Test '

  • DIAGNOSE_OBJECT = ' '

TEXT_QUESTION = 'Wanna Test'

  • TEXT_BUTTON_1 = 'Ja'(001)

  • ICON_BUTTON_1 = ' '

  • TEXT_BUTTON_2 = 'Nein'(002)

  • ICON_BUTTON_2 = ' '

  • DEFAULT_BUTTON = '1'

  • DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

  • START_COLUMN = 25

  • START_ROW = 6

  • POPUP_TYPE =

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

IMPORTING

ANSWER = W-ANS

  • TABLES

  • PARAMETER =

  • EXCEPTIONS

  • TEXT_NOT_FOUND = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Here, actually there is no use of using a variable for a FM bcoz anyways, u cant get the import export parameters for the function without callin it.

When u have to call that function, then there seems to be no use calling the function using variable func.

Regards,

Himanshu

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
625

Hi,

Go to SE11.

In that create a type group say zzzzz.

Inside the type-pool, declare the constant which should be begin with zzzzz.say zzzzz_c1.

Use the constants in your program to call function module.But you need to declare the type-pools in your program.

TYPE-POOL ZZZZZ .

constants zzzzz_c_1(11) value 'ZZZ_JAYTEST'.

Program:

type-pools zzzzz.

data result type i.

CALL FUNCTION zzzzz_c_1

EXPORTING

a = 5

b = 3

IMPORTING

C = result.

write result.

Kindly reward points if it helps.

Read only

Former Member
0 Likes
625

U just declare a variable with type <b>RS38L-FNAM</b> and pass the value to this field initially or assign it somewhere before calling the function module.

Using this variable u can the FM.

The same way we do while calling a FM created in <b>SMARTFORMS</b>.

Thanks & Regards

Santhosh

Message was edited by:

santhosh ds