Application Development 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: 

1.Select Distinct 2.Call Function v_name?????

kiran_k8
Active Contributor
0 Kudos

Hi Folks,

1.select distinct aufnr

from mseg

into table it_mseg_new

where mblnr in s_mblnr and

mjahr = p_mjahr.

What does Select Distinct mean?

2.Here we have called a smartform using the Fn Mod

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = v_form

IMPORTING

fm_name = v_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

...

....

CALL FUNCTION v_name

EXPORTING

v_werks = v_plant

v_name1 = v_name1

v_refer = p_refer

TABLES

it_header = it_header

it_final = it_final1.

v_names is declared rs38l_fnam.

I am not getting what is this fn mod v_name is.

What is the logic behind this.

can anyone here please let me know about the same.

Thanks,

K.Kiran.

1 ACCEPTED SOLUTION

former_member189059
Active Contributor
0 Kudos

2. Say i have a program in which I have called the smartform in direct method by using the function module generated.

Now if I change that smartform so much, sometimes a new function module will be generated. or if I delete that smartform and create a new one with same name, a new function module will be generated. Then I need to go and change all programs that call this smartform directly.

In the two step process, it is not necessary. Everytime the function module related to a smart form changes, the SSF_FUNCTION_MODULE_NAME fetches the latest. So we dont need to update our report programs each time we manipulate the smartform

10 REPLIES 10

former_member189059
Active Contributor
0 Kudos

1. Select distinct means that if there are two same values for aufnr in the table mseg, then only one value will be selected into your internal table

former_member189059
Active Contributor
0 Kudos

2. Say i have a program in which I have called the smartform in direct method by using the function module generated.

Now if I change that smartform so much, sometimes a new function module will be generated. or if I delete that smartform and create a new one with same name, a new function module will be generated. Then I need to go and change all programs that call this smartform directly.

In the two step process, it is not necessary. Everytime the function module related to a smart form changes, the SSF_FUNCTION_MODULE_NAME fetches the latest. So we dont need to update our report programs each time we manipulate the smartform

Former Member
0 Kudos

Hi Kiran,

1.

( (

To read a several entries from the database, use the following:

SELECT . If the target area is not an internal table, but a flat structure, you must include an ENDSELECT statement after the SELECT statement:

SELECT FM Name.

It is the same , but instead of hard-coding it you can take it as V_NAME.

Reward if useful!

Former Member
0 Kudos

Hi Kiran, Sorry for the last thread!

0 Kudos

Hi Folks,

In the SSF fn mod itself I am using v_name instead of giving the smartform name,that is fine.

But why we are using again <b>call function v_name</b>.

I just wanna know how this function module is called.I had checked in se37 but in vain.So,it is not a z fun.mod,then how is this called in the program,what is the logic.

Thanks,

K.Kiran.

0 Kudos

In the SSF function mod v_name is used as an import parameter

that means that the function returns a value (the name of the smartform function) and stores it in v_name

this fn module is dynamically generated when a smartform is activated

we call this v_name function which we get from the SSF function to execute the smartform

0 Kudos

kris,

So you mean to say this function module <b>call function v_name</b> has got generated automatically along with that ssf.......Did I get you right?

K.Kiran.

0 Kudos

You are half right

v_name is not the name of the function module but the name of the variable which stores the function module name

If you go into debug mode, you will be able to see the name of the function module

it will be something like '/1BCDWB/SF00000107' and that is the function that the smartform created upon activation of the smart form

0 Kudos

Kris,

You are right,I was able to see the same Fn Mod num in this v_name fn.

Thanks a ton.

K.Kiran.

kiran_k8
Active Contributor
0 Kudos

Problem Solved.

Thanks a ton.

K.Kiran.